Files
coder/docs/ai-coder
coder[bot]andNick Vigilante effc49e80c docs(docs): add bring your own MCP servers guide for Coder Agents (#31495)
Adds a user-facing **Bring your own MCP servers** page for Coder Agents,
aimed at developers coming from Claude Code who want `claude mcp
add`-style personal servers without an org admin registering each one.

The page compares the three options (workspace `.mcp.json`, organization
MCP servers, inline MCP servers), then walks through writing `.mcp.json`
from dotfiles or `~/personalize`, keeping tokens in user secrets, and
reusing a Claude Code setup. It also links the page from **Extending
agents** and adds it to the manifest.

Behavior verified against `main`:

- `.mcp.json` resolves relative to the agent's `dir`. With no `dir`, no
file is read (`agent/agentcontextconfig`, `agent.go` `workingDirFn`).
- stdio servers inherit user-secret env vars through `updateCommandEnv`.
`${VAR}` expansion only applies to `env` values and uses the agent
process env, which doesn't include user secrets
(`agent/x/agentmcp/config.go`).
- Accepted `type` values are `stdio`, `http`, `sse`. `streamable-http`
is not accepted yet (#29324 would change that).
- The config watcher picks up a late-created `.mcp.json`. MCP-only edits
don't mark existing chats out of date.

The `claude mcp add --scope project` example follows Claude Code's docs
and hasn't been tested end to end in a Coder workspace.

`markdownlint-cli2`, `markdown-table-formatter`, and Vale pass on the
new page.

Requested in Slack by Michael Suchacz, prompted by a customer ask for
BYO MCP in Coder Agents.

---------

Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
Co-authored-by: Nick Vigilante <nick.vigilante@coder.com>
2026-11-03 09:13:02 -05:00
..