What it does
Django MCP Server is a Django extension that exposes your application's models and business logic as tools via the Model Context Protocol, enabling AI agents and MCP clients like Claude AI to query and interact with your app. You define tool access by subclassing ModelQueryToolset (for Django models) or MCPToolset (for custom methods), and the server automatically exposes them at an HTTP endpoint. It works with both WSGI and ASGI deployments without infrastructure changes.
Who it's for
Backend engineers building Django applications who want Claude AI or other MCP clients to access application data and logic. Particularly useful for teams with REST APIs or complex business logic that benefits from AI reasoning.
Common use cases
- Expose Django ORM models to Claude AI for direct querying and filtering
- Convert existing Django REST Framework endpoints to MCP tools
- Enable Claude AI Code to query a local Django development database
- Integrate Google Agent Development Kit with a Django backend
- Build custom AI tools from Django business logic without writing REST APIs
Setup pitfalls
- Requires adding
mcp_servertoINSTALLED_APPSand includingmcp_server.urlsin Django's URL config — the endpoint is not automatically available without both steps - OAuth2 authentication is required for Claude AI integration; Django OAuth Toolkit lacks native Dynamic Client Registration support, though community add-ons exist
- OAuth2 URLs must remain at
/register,/token, and/authorize— moving them breaks Claude AI's server discovery - No continuous integration is configured in the repository, so validation depends on community contributions