Every CLI adapter implements MCP (Model Context Protocol) differently. Crewship’s per-adapterDocumentation Index
Fetch the complete documentation index at: https://docs.crewship.ai/llms.txt
Use this file to discover all available pages before exploring further.
WriteMCPConfig translates a single canonical MCP config into each CLI’s expected file path + format. This page documents the per-CLI schema so operators can debug MCP issues directly.
Quick reference
| CLI | Config file | Top-level key | Env-var syntax | Bearer token field | Approve flag |
|---|---|---|---|---|---|
| Claude Code | /crew/agents/<slug>/.mcp.json | mcpServers | ${VAR} | (in headers) | none |
| Codex | /crew/agents/<slug>/.codex/config.toml | [mcp_servers.X] | TOML literal | bearer_token_env_var = "VAR" | none |
| Gemini | /output/<slug>/.gemini/settings.json | mcpServers | ${VAR} or $VAR | (in headers) | none |
| OpenCode | /output/<slug>/opencode.json | mcp | {env:VAR} | (in headers) | none |
| Cursor | /output/<slug>/.cursor/mcp.json | mcpServers | ${env:VAR} | (in headers) | --approve-mcps |
| Factory Droid | /output/<slug>/.factory/mcp.json | mcpServers | ${VAR} | (in headers) | none |
Schema differences
Stdio servers (local subprocess)
Claude / Cursor / Gemini / Droid — separatecommand + args:
command is an array (binary + args together), env field is environment:
HTTP servers (remote)
Claude / Cursor / Droid —url + headers:
httpUrl (current) or legacy url (SSE):
type: remote:
Common pitfalls
1. Cursor MCP is currently inert in --print mode
cursor-agent --print does not invoke MCP servers at runtime even with --approve-mcps set — the binary lists registered servers via cursor-agent mcp list but never actually calls them in headless mode (forum #143045, #148397, confirmed against latest builds). The Crewship adapter reflects this honestly: adapter_cursor.go returns SupportsMCP() == false, which means the orchestrator skips WriteMCPConfig entirely — no .cursor/mcp.json is written and the --approve-mcps flag is suppressed despite being a known cmdline option. If a future Cursor release wires MCP into --print, flip SupportsMCP and the rest of the pipeline (config write, flag, table row above) lights up automatically.
2. Codex doesn’t interpolate ${VAR}
If you write env = { LINEAR_TOKEN = "${LINEAR_TOKEN}" } to Codex’s config, Codex passes the LITERAL string "${LINEAR_TOKEN}" as the env var to spawned MCP servers — they get the raw ${LINEAR_TOKEN} string instead of the secret. Crewship’s writer omits ${VAR}-style entries from the env block; Codex inherits container env instead.
3. OpenCode {env:VAR} syntax
Cursor’s ${env:VAR} and Anthropic’s ${VAR} are NOT recognised by OpenCode. Crewship’s translateEnvRefsToOpenCode converts standard forms — including substrings like "Bearer ${LINEAR_TOKEN}" (the dominant Authorization header pattern).
4. Codex config in $HOME, not project root
Codex’s project-scoped .codex/config.toml is only loaded for “trusted” projects, with trust established interactively. Headless invocations skip it. Crewship writes to /crew/agents/<slug>/.codex/config.toml (HOME) so Codex picks it up unconditionally.
Verifying MCP config
Adding an MCP server
Crew settings → MCP Servers → Add. Crewship merges crew + agent configs and writes per-adapter viamcp_writers.go. Standard input format is the Anthropic/Claude shape — every other adapter’s format is generated from it via the shared normaliseMCPInputs helper.