Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nicobailon/pi-mcp-adapter/llms.txt
Use this file to discover all available pages before exploring further.
Overview
If you already have MCP servers configured in other tools, Pi MCP Adapter can import those configurations automatically. This saves you from duplicating server definitions across multiple config files.Supported Import Sources
The adapter supports importing from these tools:Cursor IDEConfig location:
~/.cursor/mcp.jsonClaude CodeConfig location:
~/.claude/claude_desktop_config.jsonClaude DesktopConfig location:
~/Library/Application Support/Claude/claude_desktop_config.jsonVS CodeConfig location:
.vscode/mcp.json (relative to project)WindsurfConfig location:
~/.windsurf/mcp.jsonCodexConfig location:
~/.codex/config.jsonBasic Usage
Add animports array to your mcp.json:
- Load your Pi config (
~/.pi/agent/mcp.json) - Import servers from specified sources
- Merge them together (local config takes precedence)
- Apply any project-specific overrides from
.pi/mcp.json
Merge Behavior
Configurations are merged with this precedence order (highest to lowest):If the same server name exists in multiple locations, the higher-precedence config wins. This means you can override imported server settings in your local config.
Examples
Import from Multiple Sources
my-custom-server.
Override Imported Server
Cursor’s config (~/.cursor/mcp.json):
~/.pi/agent/mcp.json):
github server uses your Pi config settings (with directTools and lifecycle), not Cursor’s.
Project-Specific Overrides
Global config (~/.pi/agent/mcp.json):
.pi/mcp.json in your project):
- All Claude Desktop servers are available
- Settings use project values:
toolPrefix: "short",idleTimeout: 5 - Additional
project-dbserver is available only in this project
Import Path Resolution
Absolute Paths
Most imports use absolute paths from the home directory:Relative Paths
VS Code uses a project-relative path:process.cwd()).
Config Format Differences
Different tools use different config formats. The adapter handles these automatically:Standard Format (Cursor, Windsurf, VS Code)
Claude Desktop Format
Codex Format
The adapter automatically detects and extracts the
mcpServers object regardless of format variations.Error Handling
The adapter gracefully handles import errors:- File not found: Silently skipped (no error)
- Invalid JSON: Warning logged, import skipped
- Invalid format: Warning logged, import skipped
Import Provenance Tracking
The adapter tracks where each server came from. This is visible in the/mcp interactive panel:
- User config servers: Changes written to
~/.pi/agent/mcp.json - Imported servers: Changes written to the original import location
- Project config servers: Changes written to
.pi/mcp.json
Performance
Imports are processed synchronously at startup but are very fast:- File reads: ~1-5ms per import
- JSON parsing: ~1-2ms per import
- Merge logic: ~1ms
Complete Example
- All servers from Cursor, Claude Desktop, and VS Code
githubserver uses Pi-specific settings (overrides any importedgithub)pi-only-serveris only available in Pi- Global settings apply to all servers
Best Practices
Troubleshooting
Imported Servers Not Showing Up
-
Check file exists:
-
Validate JSON:
-
Check import spelling:
Unexpected Server Behavior
If an imported server behaves differently than expected:-
Check local override:
Look for the server name in your
~/.pi/agent/mcp.json -
Check project override:
Look in
.pi/mcp.jsonin your project directory -
Check provenance:
Run
/mcpto see where each server is defined
Changes Not Persisting
If you modify imported servers via/mcp and changes disappear:
- Changes to imported servers are written to the original config file, not Pi’s config
- If the other tool overwrites its config, your changes may be lost
- Solution: Define the server in your Pi config to take ownership
Next Steps
Server Setup
Configure MCP servers from scratch
Global Settings
Set defaults for toolPrefix, idleTimeout, and directTools