Skip to Content
GuidesAI MCP

AI MCP Integration

The Model Context Protocol (MCP) is an open standard that lets AI agents discover and interact with external tools. The django_mcp module turns your Django-CFG project into an MCP server, giving agents structured access to your models, management commands, and custom tools — all behind a single access key.

Quick Start

Add the MCP module to your config.py:

from django_cfg import DjangoConfig from django_cfg.modules.django_mcp.__cfg__ import DjangoMCPModuleConfig class MyConfig(DjangoConfig): mcp = DjangoMCPModuleConfig( enabled=True, access_key="your-secret-key", )

Django-CFG automatically registers the MCP endpoints:

EndpointDescription
POST /cfg/mcp/MCP JSON-RPC 2.0 endpoint
POST /cfg/mcp/agent/AI Agent chat endpoint

The module is disabled by default (enabled=False). Set enabled=True and provide an access_key before using any MCP functionality.

Full Documentation

Last updated on