--- title: MCP server description: Wire Foyer into any MCP-aware agent. --- `@getfoyer/mcp` is a Model Context Protocol server. Wire Foyer into any MCP-aware agent (Claude Code, Codex, Cursor, Windsurf, …) so the agent can pull [intent](/agents/concepts#intent), [repair prompts](/agents/concepts#repair-prompt), plan artifacts, and blockers directly — same surface the GitHub App uses. Run `foyer login` first so a token exists at `~/.foyer/credentials`. See the [CLI reference](/agents/cli) for what `login` does and where the credentials live. ## Install (Claude Code) ```bash claude mcp add foyer \ --scope user \ --env FOYER_TOKEN="$(jq -r .token ~/.foyer/credentials)" \ -- npx -y @getfoyer/mcp@latest ``` The MCP server defaults to `https://api.getfoyer.dev`. Only set `FOYER_API_URL` if you're pointing at a non-production deployment. **Why the `jq`?** Reading the token directly from the file (instead of via shell variable or copy-paste) strips any trailing newline — that newline is the `-32000` MCP JSON-RPC error footgun. If `~/.foyer/credentials` is plain text instead of JSON (older CLI), swap: ```bash --env FOYER_TOKEN="$(tr -d '[:space:]' < ~/.foyer/credentials)" ``` ## Install (other MCP clients) ```json { "mcpServers": { "foyer": { "command": "npx", "args": ["-y", "@getfoyer/mcp@latest"], "env": { "FOYER_TOKEN": "" } } } } ``` ## Verify In Claude Code: run `/mcp` — `foyer` should show up green with the tool list. If the entry is red, see [troubleshooting](/agents/troubleshooting). --- [agent navigation] - prev: https://docs.getfoyer.dev/agents/cli - next: https://docs.getfoyer.dev/agents/concepts - index: https://docs.getfoyer.dev/llms.txt - human: https://docs.getfoyer.dev/mcp