Django AI Boost
A Model Context Protocol (MCP) server for developing Django applications, inspired by Laravel Boost. This server exposes Django project information through MCP tools, enabling AI assistants to better understand and interact with Django codebases.
Table of Contents
Features
- Project Discovery: List models, URLs, and management commands
- Database Introspection: View schema, migrations, and relationships
- Configuration Access: Query Django settings with dot notation
- Log Reading: Access recent application logs with filtering
- Production-Ready Authentication: Bearer token authentication for secure deployments
- Read-Only: All tools are safe, read-only operations
- Fast: Built on FastMCP for efficient async operations
Screenshots
Click to view screenshots
Django AI Boost in Action

Django AI Boost MCP server providing Django project introspection through AI assistants (Example using OpenCode)
Installation
For End Users
# Using uv (recommended)
uv pip install django-ai-boost
# Or with pip
pip install django-ai-boost
For Development
If you want to contribute or run the latest development version:
# Clone the repository
git clone https://github.com/vinta/django-ai-boost.git
cd django-ai-boost
# Install uv if you haven't already
# On macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install dependencies (creates virtual environment automatically)
uv sync --dev
# Verify installation
uv run django-ai-boost --help
Usage
Running the Server
The server requires access to your Django project's settings:
# Set the Django settings module
export DJANGO_SETTINGS_MODULE=myproject.settings
django-ai-boost
# Or specify settings directly
django-ai-boost --settings myproject.settings
# Run with SSE transport (default is stdio, which doesn't use network ports)
django-ai-boost --settings myproject.settings --transport sse
# Run with SSE transport on a custom port (default port is 8000)
django-ai-boost --settings myproject.settings --transport sse --port 3000
# Run with SSE transport on custom host and port
django-ai-boost --settings myproject.settings --transport sse --host 0.0.0.0 --port 8080
Note: The stdio transport (default) communicates via standard input/output and does not use network ports. The --port and --host options only apply when using --transport sse.
Authentication
Django AI Boost supports bearer token authentication for secure production deployments when using SSE transport.
Quick Start
Set authentication token (recommended for production):
export DJANGO_MCP_AUTH_TOKEN="your-secret-token"
django-ai-boost --settings myproject.settings --transport sse
Or use CLI argument:
django-ai-boost --settings myproject.settings --transport sse --auth-token "your-secret-token"
How It Works
- Automatic Production Mode: When Django's
DEBUG=False and using SSE transport, authentication is automatically required
- Token Precedence: Environment variable takes precedence over CLI argument for security
- Transport Support:
- β
SSE Transport: Full authentication support (HTTP-based)
- β Stdio Transport: No authentication (local-only, trusted environments)
- Error on Mismatch: If you provide
--auth-token with --transport stdio, the server will exit with an error to prevent false security assumptions
Production Deployment
When running in production (DEBUG=False) with SSE transport, you must provide an authentication token:
# This will fail without a token
django-ai-boost --settings myproject.production_settings --transport sse
# Error: Production mode detected but no authentication token provided
# This works
export DJANGO_MCP_AUTH_TOKEN="strong-secret-token"
django-ai-boost --settings myproject.production_settings --transport sse
# Authentication enabled with bearer token for SSE transport
Security Best Practices
-
Generate strong tokens:
python -c "import secrets; print(secrets.token_urlsafe(32))"
-
Never commit tokens to version control
-
Use environment variables in production (not CLI arguments)
-
Rotate tokens periodically
-
Use HTTPS with a reverse proxy for external access
Client Configuration with Authentication
When using authentication, configure your MCP clients to include the token:
Cursor / Claude Desktop:
{
"mcpServers": {
"django-ai-boost": {
"command": "django-ai-boost",
"args": ["--settings", "myproject.settings", "--transport", "sse"],
"env": {
"DJANGO_MCP_AUTH_TOKEN": "your-secret-token",
"DJANGO_SETTINGS_MODULE": "myproject.settings",
"PYTHONPATH": "/path/to/your/django/project"
}
}
}
}
Testing with curl:
# Without auth - fails
curl http://127.0.0.1:8000/sse
# With correct token - works
curl -H "Authorization: Bearer your-secret-token" http://127.0.0.1:8000/sse
Troubleshooting Authentication
"Production mode detected but no authentication token provided"
- Set
DJANGO_MCP_AUTH_TOKEN environment variable or use --auth-token
"Authentication token provided but transport is 'stdio'"
- This is now an error that stops the server from starting
- Authentication only works with
--transport sse
- Either use
--transport sse with your token, or remove the --auth-token argument for stdio
"Running in production mode with stdio transport"
- This is OK for local/trusted environments, but stdio has no authentication capability
- For remote access, use
--transport sse with authentication
AI Tools Setup
Cursor
Cursor is a popular AI-powered code editor with built-in MCP support.
- Open Cursor Settings (Cmd/Ctrl + Shift + J)
- Navigate to the "Tools & MCP" section
- Add the Django AI Boost server configuration:
{
"mcpServers": {
"django-ai-boost": {
"command": "django-ai-boost",
"args": ["--settings", "myproject.settings"],
"env": {
"DJANGO_SETTINGS_MODULE": "myproject.settings",
"PYTHONPATH": "/path/to/your/django/project"
}
}
}
}
Note: Replace /path/to/your/django/project with the actual path to your Django project root directory.
For more information, see the Cursor MCP documentation.
Claude Desktop
Add to your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"django": {
"command": "django-ai-boost",
"args": ["--settings", "myproject.settings"],
"env": {
"DJANGO_SETTINGS_MODULE": "myproject.settings",
"PYTHONPATH": "/path/to/your/django/project"
}
}
}
}
Note: Make sure to replace /path/to/your/django/project with the actual path to your Django project root directory.
Github Copilot (VS Code Extension)
- Install the Github Copilot Chat extension from VS Code marketplace
- Create or edit
.vscode/mcp.json in your Django project root:
{
"inputs": [
// The "inputs" section defines the inputs required for the MCP server configuration.
{
"type": "promptString"
}
],
"servers": {
// The "servers" section defines the MCP servers you want to use.
"django-ai-boost": {
"command": "uv",
"args": ["run", "django-ai-boost", "--settings", "myproject.settings"],
"env": {
"DJANGO_SETTINGS_MODULE": "myproject.settings"
}
}
}
}
-
Click "Start" in the JSON

-
Github Copilot Code will automatically connect to the MCP server when you start a conversation in "Agent" mode.
Claude Code (VS Code Extension)
- Install the Claude Code extension from VS Code marketplace
- Create or edit
.mcp.json in your Django project root:
{
"mcpServers": {
"django-ai-boost": {
"command": "uv",
"args": ["run", "django-ai-boost", "--settings", "myproject.settings"],
"env": {
"DJANGO_SETTINGS_MODULE": "myproject.settings"
}
}
}
}
- Restart VS Code or reload the Claude Code extension
- Claude Code will automatically connect to the MCP server when you start a conversation
OpenAI ChatGPT Desktop with MCP