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

Built distribution (wheel)

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

Total release size: 96.7 kB

Release files / django_mcpz-1.1.0.tar.gz

Download URL django_mcpz-1.1.0.tar.gz
Size 41.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3fd6aa4e72d6b4e91599354504bef40fe17d40d0feaa9d77a59fb246af43e61a
BLAKE2b-256 checksum
How to use checksums
c03e0dfb5bf0dcec0ed873c841ab94ccd0174ccf06f94fd53386c7e32f4eb386
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 Oct 1, 2026.

Transparency log

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

Download URL django_mcpz-1.1.0-py3-none-any.whl
Size 55.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae64ca6ceae8bf8c81954b079f327c58d1c4960c1fb6b3bf83527bc5ca27b09e
BLAKE2b-256 checksum
How to use checksums
1fcd5d92c01534e33bdb8643a31577e5d1c59d09d1c19986a638ea1e29ea6d5e
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 Oct 1, 2026.

Transparency log

Security for django-mcpz 1.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

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

Select from 2 files

Attestation for django_mcpz-1.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 Oct 1, 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