django-stateless-mcp
Provides tools for interacting with Django, enabling AI agents to manage Django models, queries, and other ORM operations through the MCP server.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@django-stateless-mcpshow me all models in my app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
django-stateless-mcp
A stateless Model Context Protocol server for Django, built on the 2026-07-28 spec. An MCP endpoint becomes an ordinary Django view — no sessions, no SSE, no sticky routing, and no dedicated single-process service.
GitHub | PyPI | Documentation
Created by Ben Atkinson | GitHub @BenA-SA
MIT License
Why stateless
Before 2026-07-28, MCP needed a persistent connection: elicitation held an open stream and a blocked worker, so a reply that round-robined to another worker failed. The 2026-07-28 spec makes MCP plain request/response HTTP — Django's home turf — and turns elicitation into a retry any instance can serve. That is the change this package is built on; see Why stateless for the full story.
Related MCP server: MCP Server
Usage
# myproject/mcp.py
from mcp.server.mcpserver import MCPServer
from django_stateless_mcp import request_state_security
server = MCPServer(
name="my-server",
version="1.0.0",
request_state_security=request_state_security(),
)
@server.tool()
def add(a: int, b: int) -> int:
"""Add two integers."""
return a + b# urls.py
from django.urls import path
from django_stateless_mcp import mcp_view
from myproject.mcp import server
urlpatterns = [path("mcp/", mcp_view(server))]That is the whole integration. The endpoint runs under both WSGI and ASGI.
What it provides
mcp_view(server)— serve anMCPServeras a stateless streamable-HTTP Django view, optionally requiring OAuth bearer auth via atoken_verifier.mcp.pyautodiscovery — adddjango_stateless_mcptoINSTALLED_APPSand each app'smcp.pyregisters tools, likeadmin.py.request_state_security()— key the SDK's elicitation-resume encryption fromSECRET_KEY, so elicitation survives a multi-worker deployment.django_request(ctx)— reach the authenticated Django request from inside a tool, with no global state.StructlogRequestLogger— optional flow-logging middleware.
Tool registration, elicitation, resources and prompts are the MCP SDK's own API; this package is the Django layer around it.
Supported versions
Python 3.12–3.14
Django 5.2 LTS and 6.0
mcp2.0.x
Each is exercised in CI, along with an advisory job tracking the SDK's git main.
Try it live
The repo ships a runnable example project. just demo-asgi starts it behind
four worker processes; the example README walks through
watching an elicitation started on one worker resume on another — the
package's thesis, observable with curl or any MCP client.
Documentation
Full documentation, including a worked elicitation example and the design decisions behind the package, is at https://django-stateless-mcp.readthedocs.io/.
Development
git clone git@github.com:Streamlined-Analytics/django-stateless-mcp.git
cd django-stateless-mcp
uv sync
uv run pytest # quick run: locked Django
uvx --with tox-uv tox run -f py313 # the full matrix: Django 5.2 + 6.0
just qa # format, lint, type check, test
just conformance # the official MCP conformance suiteAuthor
django-stateless-mcp was created in 2026 by Ben Atkinson.
Started from the audreyfeldroy/cookiecutter-pypackage template.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA Model Context Protocol service that wraps Django's migration commands as MCP endpoints, making it easy to manage migrations across multiple services and integrate with CI/CD pipelines.Last updated6
- Alicense-qualityDmaintenanceAn implementation of the Model Context Protocol (MCP) server that enables multiple clients to connect simultaneously and handles basic context management and messaging with an extendable architecture.Last updatedMIT
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for MediaWikiLast updated292,072115MIT
- Flicense-qualityDmaintenanceExposes Django runtime information (settings, apps, URLs, models, migrations) as MCP resources for AI agents to inspect a live Django project without static analysis.Last updated
Related MCP Connectors
MCP (Model Context Protocol) server for Appwrite
A Model Context Protocol server for Wix AI tools
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Streamlined-Analytics/django-stateless-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server