Overview
The Brain exposes itself as a Model Context Protocol server via mcp_server.py. This allows Claude to call the delegate tool natively — it appears in Claude's tool list alongside Bash, Read, and Edit — rather than via a Bash call. The same orchestrator runs in both modes.
Registration
Add to ~/.claude/settings.json:
{
"mcpServers": {
"the-brain": {
"command": "python",
"args": ["C:\\Claude\\git\\the-brain\\mcp_server.py"]
}
}
}
Claude Code picks it up automatically on next launch. Run python mcp_server.py from the command line to verify the server starts before registering.
Exposed Tool: delegate
This is the only tool The Brain exposes. Claude reaches for it automatically for any AI task that matches the routing guide in CLAUDE.md.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
provider | string | yes | Provider key: cerebras groq gemini mistral sambanova fireworks openai huggingface cloudflare openrouter ollama pollinations |
task_type | enum | yes | classification summarization coding creative reasoning factual_qa extraction translation general |
prompt | string | yes | Full prompt to send to the worker |
context | string | no | Optional context block prepended to the prompt |
max_tokens | integer | no | Maximum output tokens (default: 2048) |
Response Format
Each call returns TextContent with a header line followed by the content:
[mistral / mistral-small-latest | 512 tokens | 1172ms | free]
<content from the worker>
CLI Equivalent
The MCP tool call above is equivalent to running:
python delegate.py --provider mistral --type coding --prompt "..."
Both invoke the same Orchestrator and log to stats/usage.json.