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.5

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.5
File Size Uploaded Provenance Actions
django_mcpz-1.0.5.tar.gz 35.6 kB With provenance Details for django_mcpz-1.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 85.2 kB

Release files / django_mcpz-1.0.5.tar.gz

Download URL django_mcpz-1.0.5.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
95c69f03db1df224d562ed239b3a7c169d34553daab446bc4ed9aeb7bf2c9d64
BLAKE2b-256 checksum
How to use checksums
fae355f08211384011585561ab86c046d1d1f543a782d05bcce67074454c0672
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.0.5-py3-none-any.whl

Download URL django_mcpz-1.0.5-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eefffaf6b5aee3d76a97d565316d6be87e26a20b68fb6e8c92be8a113fa9f511
BLAKE2b-256 checksum
How to use checksums
5fd3e1cddc823381a235671387480509292dd40e3a906b866baddfebdc990d90
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.0.5

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.5.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