What it does
Django MCP Server exposes your Django application to AI agents and MCP clients through the Model Context Protocol. Define Django model queries and custom business logic as toolsets in Python classes, and the server publishes them over an HTTP endpoint. Any MCP-compatible client—including Claude—can then interact with your models and functions safely, querying data with permission control and invoking Django logic from external AI workflows.
Who it's for
Backend engineers building Django applications who need AI agents to query their data and invoke business logic. Teams using Claude or other MCP tools that require structured, authenticated access to Django models. Development teams automating workflows by connecting Django to external AI systems.
Common use cases
- Query Django ORM models from Claude by wrapping them in
ModelQueryToolset - Expose custom business logic as MCP tools using
MCPToolsetfor AI agents to invoke - Safely filter model queries at the request level so agents only access permissioned data
- Integrate with Claude Desktop to give local AI coding assistants access to a dev Django instance
- Automate multi-step workflows by chaining Claude tool calls to Django functions and model queries
Setup pitfalls
- OAuth2 setup required for Claude integration; Django OAuth Toolkit lacks Dynamic Client Registration support—use the third-party DCR add-on from the maintainer
- MCP endpoint registration omitted from
urls.pyis common; addpath("", include('mcp_server.urls'))to activate the/mcproute - Last commit was 95 days ago with CI not passing—verify stability and compatibility with your Django/Python version before production use
- By default, all toolsets are public; add
DJANGO_MCP_AUTHENTICATION_CLASSESfor non-public data