Skip to main content

django-xprez-mcp

Admin-style MCP servers for Django. Register providers, models, admin classes and plain functions on a server; they become MCP tools, resources and prompts, filtered by the calling user's permissions.

Early development: phase 1 (core) only. See docs/design.md for the full design and roadmap.

# settings.py
INSTALLED_APPS = [..., "xprez_mcp"]
XPREZ_MCP = {"TOKEN_RESOLVER": "myapp.tokens.resolve"}  # (request, token) -> user | None

# urls.py
from xprez_mcp import mcp

urlpatterns = [path("mcp/", mcp.urls)]
# myapp/mcp.py: discovered automatically, like admin.py
from xprez_mcp import Provider, mcp, prompt, resource, tool


@mcp.register
class NotesProvider(Provider):
    namespace = "notes"

    @tool(read_only=True, permission="myapp.view_note")
    def search(self, ctx, query: str, limit: int = 20):
        """Search notes by title."""
        notes = Note.objects.filter(owner=ctx.user, title__icontains=query)
        return {"notes": list(notes.values("id", "title")[:limit])}

    @resource("notes://{id}", mime_type="text/markdown")
    def note(self, ctx, id: int):
        return Note.objects.get(owner=ctx.user, pk=id).text

    @prompt
    def summary(self, ctx, id: int):
        """Summarize one note."""
        return f"Summarize the note notes://{id}."


@mcp.tool
def ping(ctx) -> str:
    return "pong"

Development

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m django test xprez_mcp.tests --settings=xprez_mcp.tests.settings
.venv/bin/black --check .

Metadata

Release files for django-xprez-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-xprez-mcp 0.1.0
File Size Uploaded Provenance Actions
django_xprez_mcp-0.1.0.tar.gz 32.8 kB With provenance Details for django_xprez_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-xprez-mcp 0.1.0
File Interpreter ABI Platform Actions
django_xprez_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for django_xprez_mcp-0.1.0-py3-none-any.whl

Total release size: 65.3 kB

Release files / django_xprez_mcp-0.1.0.tar.gz

Download URL django_xprez_mcp-0.1.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f9a39fd7901fc25eccdc52af53558eb0c14052451f7e71dea53c8c31ec81439b
BLAKE2b-256 checksum
How to use checksums
9d3e39ff1c9db1c810206176395d81d28e5af6fcb9f5ca830fcb3152e9010b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / django_xprez_mcp-0.1.0-py3-none-any.whl

Download URL django_xprez_mcp-0.1.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2ed96a7524cbe0bfab168104d02fcb0d910be5a2af6840b86ce3dfbb98dc28b
BLAKE2b-256 checksum
How to use checksums
210805f924cacb4c533d9fdd03acb6b7f3d5088ac3c2fea184b9843cb537a931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for django-xprez-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_xprez_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page