MCP Server Setup
The MCP (Model Context Protocol) server provides the deepest integration with Claude Code, exposing AI Mantras as native tools.
What You Get
Section titled “What You Get”Core Tools
Section titled “Core Tools”| Tool | Description |
|---|---|
bootstrap_session | Initialize a session with all needed resources |
assess_complexity | Automatically triage requests |
get_persona | Load personas by name or domain |
get_pattern | Load thinking patterns |
get_skill | Load skills by name, task, or category |
get_workflow | Get orchestration workflows |
create_handoff | Generate handoff templates |
list_available | Discover all personas, patterns, and skills |
Multi-Agent Tools (when enabled)
Section titled “Multi-Agent Tools (when enabled)”| Tool | Description |
|---|---|
spawn_agent | Spawn isolated agents with specific personas |
get_agent_result | Retrieve results from spawned agents |
list_agents | Monitor all spawned agents |
Installation
Section titled “Installation”-
Install the package globally:
Terminal window npm install -g @ai-mantras/mcp-server -
Add to your Claude Code MCP configuration (
~/.claude/mcp.jsonor project.mcp.json):{"mcpServers": {"ai-mantras": {"command": "npx","args": ["-y", "@ai-mantras/mcp-server"]}}}
-
Clone and build:
Terminal window git clone https://github.com/kd5ziy/AIMantras.gitcd AIMantras/ai-mantras-mcpnpm installnpm run build -
Add to your MCP configuration:
{"mcpServers": {"ai-mantras": {"command": "node","args": ["/path/to/AIMantras/ai-mantras-mcp/dist/index.js"]}}}
Multi-Agent Mode (Optional)
Section titled “Multi-Agent Mode (Optional)”By default, AI Mantras runs in single-agent mode where all personas share one AI model. To enable multi-agent mode where each persona spawns as an isolated agent:
{ "mcpServers": { "ai-mantras": { "command": "npx", "args": ["-y", "@ai-mantras/mcp-server"], "env": { "MANTRAS_MULTI_AGENT_ENABLED": "true", "ANTHROPIC_API_KEY": "sk-ant-your-key-here" } } }}Multi-Agent Benefits
Section titled “Multi-Agent Benefits”- True context isolation between personas
- Each agent only sees its persona, task, and inputs
- Support for parallel execution
- Mix Anthropic and OpenAI models per persona
Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
MANTRAS_MULTI_AGENT_ENABLED | Enable multi-agent tools | false |
ANTHROPIC_API_KEY | API key for Claude models | - |
OPENAI_API_KEY | API key for GPT models | - |
MANTRAS_DEFAULT_PROVIDER | Default: anthropic or openai | anthropic |
MANTRAS_MAX_CONCURRENT_AGENTS | Max parallel agents | 5 |
MANTRAS_AGENT_TIMEOUT_MS | Agent timeout (ms) | 120000 |
Once configured, Claude Code automatically has access to AI Mantras tools. You can:
- Ask questions and let the framework triage automatically
- Request specific personas: “Use Clara to analyze this investment”
- Apply patterns: “Use chain-of-thought to work through this problem”