-
Notifications
You must be signed in to change notification settings - Fork 0
MCP Servers
Steps can declare MCP stdio servers to add custom tools on demand. Claude will see these tools alongside its built-in tools (Read, Write, Bash, etc.).
graph LR
A[CodeGenesis] -->|"--mcp-config"| B[Claude CLI]
B --> C[MCP Server 1]
B --> D[MCP Server 2]
C -->|stdio| E["π§ custom tool A"]
D -->|stdio| F["π§ custom tool B"]
steps:
- name: "Analyze codebase"
prompt: "Use the analyzer tool to check for issues"
mcp_servers:
analyzer:
command: "python"
args: ["tools/analyzer_server.py"]
env:
MODE: "strict"
allowed_tools:
- "mcp__analyzer__run_analysis"settings:
mcp_servers:
shared-db:
command: "python"
args: ["tools/db_server.py"]
env:
DB_HOST: "{{db_host}}"
steps:
- name: "Query data"
prompt: "Use the database tool to fetch user stats"
allowed_tools:
- "mcp__shared-db__query"# contexts/data-analyst/agent.yml
system_prompt: "You are a data analyst with access to the database."
allowed_tools:
- "mcp__db__query"
- "mcp__db__schema"
mcp_servers:
db:
command: "dotnet"
args: ["run", "--project", "tools/DbServer"]When multiple levels define MCP servers, they merge with later sources winning on key collision:
graph LR
A["1οΈβ£ Global<br/>(settings.mcp_servers)"] --> B["2οΈβ£ Context Bundle<br/>(agent.yml)"]
B --> C["3οΈβ£ Step-level<br/>(steps[].mcp_servers)"]
style C fill:#2d5016,color:#fff
| Field | Required | Description |
|---|---|---|
command |
β | Executable to run ("python", "dotnet", "node") |
args |
β | Command-line arguments |
env |
β | Environment variables for the MCP process |
description |
β | Human-readable description of what this server does (injected into system prompt) |
parameters |
β | Documents the parameters the server's tools accept (injected into system prompt) |
Tip
All fields support template variables ({{variable}}), resolved from pipeline inputs at build time.
MCP servers expose tools via the MCP protocol, but the LLM may not know when or how to use them. Add description and parameters to give the LLM context:
settings:
mcp_servers:
jira:
command: "npx"
args: ["-y", "@anthropic/mcp-jira"]
description: "Search and manage Jira tickets"
parameters:
project_key:
description: "The Jira project key"
example: "PROJ-123"
assignee:
description: "Filter by assignee email"
env:
JIRA_TOKEN: "{{jira_token}}"| Field | Description |
|---|---|
description |
What this parameter does |
example |
Example value (shown inline) |
When a step has MCP servers with description or parameters, CodeGenesis automatically appends an Available MCP Tools section to the system prompt:
## Available MCP Tools
### jira
Search and manage Jira tickets
**Parameters:**
- `project_key`: The Jira project key (example: `PROJ-123`)
- `assignee`: Filter by assignee emailNote
description and parameters are YAML-only metadata. They are injected into the system prompt β they are not written to the --mcp-config JSON sent to Claude CLI.
Tip
Servers without description or parameters are silently skipped β no noise in the system prompt.
- CodeGenesis writes the MCP server config to a temporary JSON file
- Passes
--mcp-config <path>to the Claude CLI process - Claude CLI starts the MCP server(s), making their tools available
- When the step finishes, servers are terminated and the temp file is cleaned up
Note
Each step invocation gets its own temp file (GUID-based naming), so parallel steps are fully thread-safe.
π Home
- π Getting Started
- π» CLI Reference
- π YAML Reference
- π Step Types
- π MCP Servers
- π¦ Context Bundles
- βοΈ Configuration
- ποΈ Project Structure
- π§ͺ Testing