Django
Connect Django apps to AI assistants with Model Context Protocol. Simple decorators expose models, admin functions, and custom tools to Claude and other AI assistants.
What is Django?
Django is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to connect django apps to ai assistants with model context protocol. simple decorators expose models, admin functions, and custom tools to claude and other ai assistants.
Connect Django apps to AI assistants with Model Context Protocol. Simple decorators expose models, admin functions, and custom tools to Claude and other AI assistants.
This server falls under the Coding Agents and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Connect Django apps to AI assistants with Model Context Prot
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx djangoConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Django
django-mcp is a Python library that bridges Django web applications and MCP-compatible AI assistants like Claude by using simple decorators to expose Django models, admin actions, REST framework viewsets, and custom functions as MCP tools and resources. With decorators like @mcp_tool() and @mcp_model_tool(Model), developers can register any Django function or model CRUD operation without boilerplate, and the library auto-discovers MCP components across all installed Django apps. It is ideal for Django developers who want to give AI assistants direct, controlled access to their application data and business logic.
Prerequisites
- Python 3.9+ with an existing Django project
- Django 4.0+ installed
- pip or uv package manager
- An MCP client such as Claude Desktop
- Optional: Django REST Framework if exposing viewsets
Install django-mcp
Install the django-mcp package into your Django project environment using pip or uv.
pip install django-mcp
# or with uv
uv add django-mcpAdd to INSTALLED_APPS
Add 'django_mcp' to the INSTALLED_APPS list in your Django settings.py file to enable the library.
# settings.py
INSTALLED_APPS = [
...
'django_mcp',
]Update ASGI configuration
Update your project's asgi.py to use the django-mcp ASGI application wrapper.
# asgi.py
from django_mcp.asgi import get_asgi_application
application = get_asgi_application()Include MCP URLs
Add the django-mcp URL patterns to your project's urls.py. This enables the MCP endpoint and optional dashboard.
# urls.py
from django.urls import path, include
urlpatterns = [
...
path('', include('django_mcp.urls')),
]Expose tools and models with decorators
Create mcp_tools.py files in your Django apps and use the provided decorators to expose functions and models as MCP tools.
# myapp/mcp_tools.py
from django_mcp import mcp_tool, mcp_model_tool
from .models import Product
@mcp_tool()
def search_products(context, query: str) -> list:
"""Search for products by name"""
return list(Product.objects.filter(name__icontains=query).values())
@mcp_model_tool(Product)
def product_crud(context):
passConfigure Claude Desktop
Add a Django MCP server entry to your Claude Desktop config. The server runs as part of your Django application via ASGI or a management command.
{
"mcpServers": {
"django": {
"command": "python",
"args": ["manage.py", "run_mcp_server"],
"cwd": "/path/to/your/django/project"
}
}
}Django Examples
Client configuration
Claude Desktop configuration to launch the django-mcp server via Django's management command interface.
{
"mcpServers": {
"django": {
"command": "python",
"args": ["manage.py", "run_mcp_server"],
"cwd": "/path/to/your/django/project"
}
}
}Prompts to try
Example prompts for interacting with Django models and custom tools through the MCP server.
- "Search for products matching 'widget' in the database"
- "List the last 10 orders placed in the system"
- "Create a new customer record with name 'Acme Corp' and email '[email protected]'"
- "What MCP tools are registered in the Django app?"Troubleshooting Django
MCP tools not discovered automatically across apps
Ensure each Django app containing MCP tools has a mcp_tools.py file and that the app is listed in INSTALLED_APPS. django-mcp auto-discovers components only from installed apps.
ASGI connection errors when the AI client tries to connect
Verify that asgi.py imports from django_mcp.asgi and that the django_mcp URLs are included in urls.py. Check that the Django app is running with an ASGI server like uvicorn, not the development WSGI server.
Frequently Asked Questions about Django
What is Django?
Django is a Model Context Protocol (MCP) server that connect django apps to ai assistants with model context protocol. simple decorators expose models, admin functions, and custom tools to claude and other ai assistants. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Django?
Follow the installation instructions on the Django GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Django?
Django works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Django free to use?
Yes, Django is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Django Alternatives — Similar Coding Agents Servers
Looking for alternatives to Django? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Django in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Django?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.