Skip to main content

django-mcpz

https://img.shields.io/readthedocs/django-mcpz?style=for-the-badge https://img.shields.io/github/actions/workflow/status/adamchainz/django-mcpz/main.yml.svg?branch=main&style=for-the-badge https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge https://img.shields.io/pypi/v/django-mcpz.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

Easy peasy MCP servers in Django.

django-mcpz lets you build a Model Context Protocol (MCP) server in your Django project. Create an MCP server object with metadata, give it a URL, and attach Python functions to it as tools. The MCP server acts like a regular synchronous Django view, handling the intricacies of the MCP protocol. django-mcpz leans on msgspec for defining schemas and fast JSON serialization and deserialization.

A quick example:

from typing import Literal

import msgspec

from django_mcpz.server import MCPServer
from django_mcpz.bearer_tokens.auth import token_auth
from example.models import Order

server = MCPServer(
    name="shop",
    version="1.0.0",
    instructions="Query the shop’s order database.",
    auth=token_auth,
)


class CountOrdersParams(msgspec.Struct):
    status: Literal["pending", "shipped", "cancelled"] | None = None


class CountOrdersResult(msgspec.Struct):
    count: int


@server.tool(
    description="Count Order rows, optionally filtered by status.",
    read_only=True,
)
def count_orders(request, params: CountOrdersParams) -> CountOrdersResult:
    qs = Order.objects.all()
    if params.status is not None:
        qs = qs.filter(status=params.status)
    return CountOrdersResult(count=qs.count())

Documentation

Please see https://django-mcpz.readthedocs.io/.

Metadata

Release files for django-mcpz 1.0.4

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-mcpz 1.0.4
File Size Uploaded Provenance Actions
django_mcpz-1.0.4.tar.gz 35.5 kB With provenance Details for django_mcpz-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-mcpz 1.0.4
File Interpreter ABI Platform Actions
django_mcpz-1.0.4-py3-none-any.whl Python 3 none any Details for django_mcpz-1.0.4-py3-none-any.whl

Total release size: 85.1 kB

Release files / django_mcpz-1.0.4.tar.gz

Download URL django_mcpz-1.0.4.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
69e231e9768f6ea7206473a590c322dea35aa825ef29bc52134e4fa5c30773c7
BLAKE2b-256 checksum
How to use checksums
d36cf160ff85981704f74cd49b037c70be61fb0788f1aeb873e711a70d51c9bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 18, 2026.

Transparency log

Release files / django_mcpz-1.0.4-py3-none-any.whl

Download URL django_mcpz-1.0.4-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
beeb5d41965ad588c3ce62148acb44bd4c3fe49a4eaf80146b1267bce663e19a
BLAKE2b-256 checksum
How to use checksums
dcb4c734d2e5b0382150cbfc79c84f3d221363f8577207744e060a1d6a4476d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 18, 2026.

Transparency log

Security for django-mcpz 1.0.4

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_mcpz-1.0.4.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 Sep 18, 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