<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97" -->

---
title: Django: introducing django-mcpz, for making MCP servers
description: A new open-source package, django-mcpz, lets developers build Model Context Protocol (MCP) servers directly inside a Django project. It targets the latest...
canonical: https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Django: introducing django-mcpz, for making MCP servers | daily.dev
og:description: A new open-source package, django-mcpz, lets developers build Model Context Protocol (MCP) servers directly inside a Django project. It targets the latest...
og:url: https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97
og:image: https://api.daily.dev/og/posts/JL9cdhd97.png
og:image:alt: Django: introducing django-mcpz, for making MCP servers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Django: introducing django-mcpz, for making MCP servers

**[Adam Johnson](https://daily.dev/sources/adamj)** · 9 min read · 0 upvotes · 0 comments

## Summary

A new open-source package, django-mcpz, lets developers build Model Context Protocol (MCP) servers directly inside a Django project. It targets the latest stateless MCP spec version (2026-07-28), which removed the session/streaming requirements of earlier versions, meaning MCP servers can now run on a plain synchronous WSGI Django deployment without needing Channels or ASGI. The package provides a server object for registering tool functions, uses msgspec (via the author's django-msgspec) for schema generation and validation, and ships optional apps for bearer-token auth (for CLI tools like Claude Code, Codex, Cursor) and OAuth (for hosted assistants like Claude.ai and ChatGPT). An example 'MCPizza' project demonstrates tools for querying a pizza shop's menu and orders. Future additions may include elicitations, prompts, and resources, but async/streaming support is not planned.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://adamj.eu/tech/2026/09/15/introducing-django-mcpz>

## Questions this post answers

### What changed in the MCP specification version 2026-07-28 that makes it easier to use with Django?

MCP version 2026-07-28 made the protocol stateless, removing the initialization handshake, session IDs, and the server-sent events streaming requirement present in earlier versions. Each request is now a plain HTTP POST with a JSON body returning a single JSON response, like a typical HTTP API. This means an MCP server can run inside a normal synchronous WSGI Django deployment without needing a separate ASGI setup via Channels.

_Track protocol changes like this MCP update on daily.dev before they force a redeploy._

### How do I add authentication to an MCP server built with django-mcpz?

django-mcpz requires an auth callable on every server, which runs before the request body is processed and returns None to allow or an HttpResponse to reject the call. The django_mcpz.bearer_tokens app issues per-client, revocable bearer tokens (hashed like Django passwords) for developer tools such as Claude Code, Codex, and Cursor, while the django_mcpz.oauth app implements the MCP authorization spec and OAuth for hosted assistants like Claude.ai and ChatGPT.

_Developers wiring auth into MCP servers can follow implementation details like this on daily.dev._

### What Django libraries does django-mcpz use for validating and serializing MCP tool parameters?

django-mcpz uses msgspec Struct classes to declare tool parameters and results, generating JSON Schemas from the type annotations and validating each call's arguments before the tool executes. Serialization and deserialization are handled through django-msgspec, a separate package by the same author, giving fast JSON handling and in-band error messages an LLM can read and correct from.

_Following new Django tooling like msgspec integrations helps teams pick libraries confidently, something daily.dev supports._

## Similar posts on daily.dev

- [MCP Servers for Python Devs](https://daily.dev/posts/mcp-servers-for-python-devs-zy6zukegx) · Planet Python · 0 upvotes · 0 comments
- [What is an MCP server?](https://daily.dev/posts/what-is-an-mcp-server--1lghnlfr5) · R-bloggers · 0 upvotes · 0 comments
- [Model Context Protocol Guide](https://daily.dev/posts/model-context-protocol-guide-ugw9j9a04) · SitePoint · 1 upvotes · 1 comments
- [Medium](https://daily.dev/posts/medium-avonr6rrx) · Medium · 0 upvotes · 0 comments
- [How to Build an MCP Server with Python, Docker, and Claude Code](https://daily.dev/posts/how-to-build-an-mcp-server-with-python-docker-and-claude-code-vlirajm4s) · freeCodeCamp · 4 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#mcp](https://daily.dev/tags/mcp), [#django](https://daily.dev/tags/django), [#oauth](https://daily.dev/tags/oauth)

[View this post on daily.dev](https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Django: introducing django-mcpz, for making MCP servers","url":"https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97"},"datePublished":"2026-09-15T22:46:11.191Z","dateModified":"2026-09-15T22:46:36.853Z","description":"A new open-source package, django-mcpz, lets developers build Model Context Protocol (MCP) servers directly inside a Django project. It targets the latest...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bec5003b8fee4f3c1360d1c673d0fd1d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bec5003b8fee4f3c1360d1c673d0fd1d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Adam Johnson","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Adam Johnson","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/bf70f4401c284aa5b628d1966029342c","url":"https://daily.dev/sources/adamj"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,mcp,django,oauth","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Adam Johnson","item":"https://daily.dev/sources/adamj"},{"@type":"ListItem","position":3,"name":"Django: introducing django-mcpz, for making MCP servers"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/django-introducing-django-mcpz-for-making-mcp-servers-jl9cdhd97#faq","mainEntity":[{"@type":"Question","name":"What changed in the MCP specification version 2026-07-28 that makes it easier to use with Django?","acceptedAnswer":{"@type":"Answer","text":"MCP version 2026-07-28 made the protocol stateless, removing the initialization handshake, session IDs, and the server-sent events streaming requirement present in earlier versions. Each request is now a plain HTTP POST with a JSON body returning a single JSON response, like a typical HTTP API. This means an MCP server can run inside a normal synchronous WSGI Django deployment without needing a separate ASGI setup via Channels. Track protocol changes like this MCP update on daily.dev before they force a redeploy."}},{"@type":"Question","name":"How do I add authentication to an MCP server built with django-mcpz?","acceptedAnswer":{"@type":"Answer","text":"django-mcpz requires an auth callable on every server, which runs before the request body is processed and returns None to allow or an HttpResponse to reject the call. The django_mcpz.bearer_tokens app issues per-client, revocable bearer tokens (hashed like Django passwords) for developer tools such as Claude Code, Codex, and Cursor, while the django_mcpz.oauth app implements the MCP authorization spec and OAuth for hosted assistants like Claude.ai and ChatGPT. Developers wiring auth into MCP servers can follow implementation details like this on daily.dev."}},{"@type":"Question","name":"What Django libraries does django-mcpz use for validating and serializing MCP tool parameters?","acceptedAnswer":{"@type":"Answer","text":"django-mcpz uses msgspec Struct classes to declare tool parameters and results, generating JSON Schemas from the type annotations and validating each call's arguments before the tool executes. Serialization and deserialization are handled through django-msgspec, a separate package by the same author, giving fast JSON handling and in-band error messages an LLM can read and correct from. Following new Django tooling like msgspec integrations helps teams pick libraries confidently, something daily.dev supports."}}]}
```

