MCP Server Setup
Overview
Section titled “Overview”Jina Connect includes a built-in MCP (Model Context Protocol) server that lets AI agents interact with your messaging infrastructure through natural language. The MCP server exposes 15 tools for sending messages, managing contacts, running campaigns, and monitoring provider health.
Architecture
Section titled “Architecture”AI Agent (Claude, GPT, etc.) │ ▼MCP Client (Claude Desktop, VS Code, etc.) │ ▼ HTTP (stateless)Jina Connect MCP Server (FastMCP) │ ▼ API Key → Tenant resolutionDjango ORM → PostgreSQLThe MCP server uses:
- FastMCP framework with
stateless_http=True - JSON responses for structured tool outputs
- API Key auth — each tool requires an
api_keyparameter that resolves to a(Tenant, TenantWAApp)pair
-
Create an API Key
In Django Admin → Tenant Access Keys → Add:
- Select your tenant
- Name: “MCP Access Key”
- Save and copy the generated key
-
Configure your MCP client
Add to
~/Library/Application Support/Claude/claude_desktop_config.json:{"mcpServers": {"jina-connect": {"command": "python","args": ["-m", "mcp_server"],"cwd": "/path/to/jina-connect-unified-cpaas","env": {"DJANGO_SETTINGS_MODULE": "jina_connect.settings"}}}}Add to
.vscode/mcp.json:{"servers": {"jina-connect": {"command": "python","args": ["-m", "mcp_server"],"cwd": "${workspaceFolder}","env": {"DJANGO_SETTINGS_MODULE": "jina_connect.settings"}}}} -
Test the connection
Ask your AI agent:
“List my WhatsApp templates using API key
your-key-here”
Authentication
Section titled “Authentication”Every MCP tool requires an api_key parameter. The server resolves the key:
def resolve_tenant(api_key: str) -> tuple[Tenant, TenantWAApp]: access_key = TenantAccessKey.objects.get(key=api_key) tenant = access_key.tenant wa_app = TenantWAApp.objects.get(tenant=tenant) return tenant, wa_appInvalid or missing API keys return an error response.
Running Standalone
Section titled “Running Standalone”# From the project rootpython -m mcp_serverThis starts the MCP server with Django settings loaded.