MCP Catalogs
Home

django-mcp

by hyperb1iss·16·Score 36

A Python package that bridges Django apps with AI assistants using MCP through decorators.

developer-toolsai-llmdatabase
4
Forks
2
Open issues
14 mo ago
Last commit
2d ago
Indexed

Overview

Django-MCP is a Model Context Protocol implementation designed to expose Django applications' functionality to AI assistants like Claude. It provides a decorator-based API for exposing models, admin functions, and custom tools. The project features seamless Django integration with automatic discovery of MCP components, built-in ASGI server support, and compatibility with Django REST Framework. It follows Django's configuration patterns and emphasizes security with permission controls.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Allow AI assistants to interact with and query Django application data
you:Expose Django admin functionality to AI assistants for automated tasks
you:Create AI-powered interfaces for exploring and managing Django application content
you:What MCP features does Django-MCP support?
you:How does Django-MCP handle security?

When to choose this

Choose Django-MCP if you're building a Django application and want to enable AI assistants to interact with your models, admin functions, and custom tools without complex integrations.

When NOT to choose this

Avoid Django-MCP if you need write access to your database (currently read-only), have non-Django applications, or require a production-ready solution (this is still in alpha status).

Tools this server exposes

4 tools extracted from the README
  • search_productssearch_products(context: Context, query: str) -> list

    Search for products by name and return product details

  • product_toolsproduct_tools()

    Exposes CRUD operations for Product model

  • product_resourceproduct_resource()

    Exposes Product instances as resources

  • get_categoryget_category(slug: str) -> str

    Get information about a product category including its products

Comparable tools

langchain-djangodjango-ai-toolsmcp-database-server

Installation

Installation

# Install with pip
pip install django-mcp

# Or with UV
uv add django-mcp

Configuration

  1. Add to INSTALLED_APPS:
# settings.py
INSTALLED_APPS = [
    # ... your other apps ...
    'django_mcp',
]
  1. Update ASGI configuration:
# asgi.py
from django_mcp.asgi import get_asgi_application

application = get_asgi_application()
  1. Include MCP URLs:
# urls.py
from django.urls import path, include

urlpatterns = [
    # ... your other URLs ...
    path('', include('django_mcp.urls')),
]

Claude Desktop Configuration

Add to Claude Desktop's claude_desktop_config.json:

{
  "mcpServers": {
    "django-mcp": {
      "command": "python",
      "args": ["-m", "django_mcp.server"],
      "env": {
        "DJANGO_SETTINGS_MODULE": "your_project.settings"
      }
    }
  }
}

FAQ

What MCP features does Django-MCP support?
Django-MCP supports tools (functions), resources (data objects), and prompts. It can expose Django models, admin functions, DRF viewsets, and custom tools through a decorator-based API.
How does Django-MCP handle security?
Django-MCP follows Django's security patterns with permission controls. It allows configuration of allowed origins for SSE endpoints and inherits Django's authentication system for protected resources.

Compare django-mcp with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.