MCP Integration¶
MCP Zen of Languages is designed as an MCP server first. The server exposes zen analysis as tools that AI agents can call — analyze code, generate reports, and produce remediation prompts, all from within your editor. This is the recommended way to use the project.
Start the server¶
Compatibility aliases remain available: mcp-zen-of-languages and zen-mcp-server
The server communicates via stdin/stdout using the MCP protocol. It doesn't serve HTTP — MCP clients connect to it as a subprocess.
The server enables advanced FastMCP features: centralized middleware (logging, timing, rate limiting, response caching/limiting, duplicate-call suppression), OpenTelemetry-compatible spans, lifecycle hooks, and paginated listing (list_page_size=100) for scalable client discovery.
When your client supports version targeting, use analyze_zen_violations and generate_prompts v2.0 for stricter request-quality guardrails; v1.0 remains available for compatibility.
Naming guide (important)¶
| Concept | Value | Where it is used |
|---|---|---|
| Package name | mcp-zen-of-languages |
pip install, uvx --from ..., and the package-style server shortcut |
| Preferred CLI command | mcp-zen-of-languages-cli |
Explicit local terminal / CI command |
| Preferred server command | mcp-zen-of-languages-server |
MCP subprocess command |
| Compatibility aliases | mcp-zen-of-languages, zen, zen-mcp-server |
Backward-compatible shell commands |
| MCP server key | zen-of-languages |
JSON config key (servers/mcpServers), one-click install name=, and a quoted TOML table name in Codex |
VS Code configuration¶
Use one-click install or add config manually.
mcp-zen-of-languages-cli init --mcp-target vscode can generate .vscode/mcp.json for you (zen init --mcp-target vscode is a compatibility alias); keep the server key as zen-of-languages.
For user-prompted configuration paths:
{
"servers": {
"zen-of-languages": {
"command": "uvx",
"args": ["--from", "mcp-zen-of-languages", "mcp-zen-of-languages-server"],
"env": {
"ZEN_CONFIG_PATH": "${input:zenConfigPath}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "zenConfigPath",
"description": "Path to zen-config.yaml",
"default": "${workspaceFolder}/zen-config.yaml"
}
]
}
Once configured, MCP-compatible clients (VS Code with Copilot, Codex, Claude Desktop, etc.) can invoke zen tools directly.
Quick verification checklist¶
- Run
mcp-zen-of-languages-cli --helpto confirm the CLI is installed. - Run
uvx --from mcp-zen-of-languages mcp-zen-of-languages-server(or your configured command) to confirm server startup. - In VS Code, run MCP: List Servers and confirm
zen-of-languagesappears.
Claude Desktop configuration¶
Add to your claude_desktop_config.json (usually in ~/Library/Application Support/Claude/ on macOS or %APPDATA%\Claude\ on Windows):
{
"mcpServers": {
"zen-of-languages": {
"command": "uvx",
"args": ["--from", "mcp-zen-of-languages", "mcp-zen-of-languages-server"],
"env": {
"ZEN_CONFIG_PATH": "/path/to/your/zen-config.yaml"
}
}
}
}
Replace /path/to/your/zen-config.yaml with the absolute path to your config file, or omit the env section to use default auto-discovery.
Claude Code integration¶
Install the server using the Claude Code CLI:
This automatically adds the server to Claude Code's MCP configuration.
Codex configuration¶
Add this to ~/.codex/config.toml:
[mcp_servers."zen-of-languages"]
command = "uvx"
args = ["--from", "mcp-zen-of-languages", "mcp-zen-of-languages-server"]
enabled = true
Codex reads MCP entries from the global config file rather than a workspace .json file. mcp-zen-of-languages-cli init --mcp-target codex can append this block for you (the shorter zen init --mcp-target codex is available as a compatibility alias). If you want to pin a repo-specific config file, add env = { ZEN_CONFIG_PATH = "/absolute/path/to/zen-config.yaml" } under the same table.
GitHub Copilot-compatible JSON configs¶
mcp-zen-of-languages-cli init can also scaffold Copilot-compatible JSON files:
mcp-zen-of-languages-cli init --mcp-target copilot-localwrites.github/mcp.jsonmcp-zen-of-languages-cli init --mcp-target copilot-globalwrites~/.copilot/mcp-config.json
Legacy users can also run the shorter zen init --mcp-target ... alias, which behaves the same but is kept primarily for compatibility.
Cursor/Windsurf integration¶
For Cursor and Windsurf, add to your MCP configuration file:
Edit .cursor/mcp.json in your project root:
```json
{
"mcpServers": {
"zen-of-languages": {
"command": "uvx",
"args": ["--from", "mcp-zen-of-languages", "mcp-zen-of-languages-server"],
"env": {
"ZEN_CONFIG_PATH": "${workspaceFolder}/zen-config.yaml"
}
}
}
}
```
Edit .windsurf/mcp.json in your project root:
```json
{
"mcpServers": {
"zen-of-languages": {
"command": "uvx",
"args": ["--from", "mcp-zen-of-languages", "mcp-zen-of-languages-server"],
"env": {
"ZEN_CONFIG_PATH": "${workspaceFolder}/zen-config.yaml"
}
}
}
}
```
Available MCP tools¶
The server exposes 13 MCP tools, plus 3 resources and 1 prompt.
| Family | Tools |
|---|---|
| Analysis | analyze_zen_violations, analyze_repository, check_architectural_patterns |
| Reporting | generate_prompts, generate_agent_tasks, generate_report |
| Configuration | get_config, set_config_override, clear_config_overrides |
| Metadata | detect_languages, get_supported_languages, export_rule_detector_mapping |
| Onboarding | onboard_project |
For full parameter and return schemas, see the MCP Tools Reference.
Perspective-aware MCP requests¶
The current runtime supports five public perspectives:
all— full rule-first resultzen— rule-level result without dogma-analysis payloadsdogma— dogma-focused result with universal dogma analysis preservedtesting— test-family view resolved from real file pathsprojection— explicit family projection driven byproject_as
Repository or report target¶
Use generate_report when you want a perspective-aware result over files that
already exist on disk:
{
"tool": "generate_report",
"arguments": {
"target_path": "tests",
"perspective": "testing",
"include_prompts": true
}
}
Explicit projection target¶
Projection requests must include project_as:
{
"tool": "generate_report",
"arguments": {
"target_path": "src/frontend",
"language": "react",
"perspective": "projection",
"project_as": "nextjs"
}
}
Snippet-tool caveat¶
analyze_zen_violations and generate_prompts accept perspective, but
testing is only meaningful when the runtime can inspect a real file path.
For test-family filtering, use a file- or directory-based surface such as
generate_report or the CLI.
Workflow example¶
- Open a Python file in VS Code
- Ask Copilot: "Run zen analysis on this file"
- The agent calls
analyze_zen_violationsvia MCP - You get back violations with severity scores and fix suggestions
- Ask: "Fix the highest-severity violation" — the agent uses the remediation context to apply changes
Troubleshooting¶
Server not showing up in VS Code¶
- Verify uvx is installed:
If not found, install uv: pip install uv
- Check VS Code MCP extension is enabled:
- Open Command Palette (
Cmd/Ctrl+Shift+P) - Search for "MCP: List Servers"
-
Verify "zen-of-languages" appears
-
Test server manually:
You should see JSON output indicating the server is ready.
- Check logs:
- VS Code: Open "Output" panel → Select "MCP" from dropdown
- Look for connection errors or startup failures
Python version conflicts¶
If you see errors about Python 3.12+ requirement:
# Check your Python version
python --version
# Use a specific Python version with uvx
uvx --python 3.12 --from mcp-zen-of-languages mcp-zen-of-languages-server
Config file not discovered¶
The server looks for zen-config.yaml in:
- Current working directory
- Nearest parent directory containing
pyproject.toml
Override with environment variable:
Debugging with verbose output¶
Enable debug logging:
This logs detailed MCP protocol messages and tool invocations.
Common issues¶
| Problem | Solution |
|---|---|
uvx: command not found |
Install uv: pip install uv |
Server exits immediately |
Check Python version is 3.12+ |
No violations found |
Verify language is enabled in zen-config.yaml |
Config file ignored |
Use ZEN_CONFIG_PATH env var with absolute path |
Workspace server missing |
Validate .vscode/mcp.json is valid JSON (no trailing commas) and check VS Code MCP output logs |
Tool timeouts |
Large codebases may need increased timeout in client config |
Next steps¶
- CLI Reference — Full CLI command documentation
- Prompt Generation — How remediation prompts work
- Configuration — Customize which detectors run