# MCP servers for coding agents

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> An MCP server gives a coding agent extra tools, and an Integration registers one with the coding agents on a workstation.


An MCP server gives a coding agent extra tools, and an Integration registers one with the
coding agents on a workstation. An `mcp` block registers one server with Codex on every
workstation the Integration reaches. It registers the server with Claude Code, OpenCode and pi
on each of those workstations that has the agent's devtool. Cursor CLI and Antigravity CLI get
nothing, and neither does an agent Ringleader does not support, unless you read the server's file
yourself.

## MCP server registration by agent

An `mcp` block registers its server with each agent as the table says.
[Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/) lists the
other things each agent gets.

| Agent | Where the server lands | On which workstations |
|-------|------------------------|-----------------------|
| Claude Code | User scope, the same way `claude mcp add --scope user` adds one. | Those with the `claude-code` devtool. |
| Codex | An `[mcp_servers.<name>]` table in `~/.codex/config.toml`. | Every workstation, even one without Codex installed. |
| OpenCode | A `remote` entry under `mcp` in `~/.config/opencode/opencode.json`. | Those with the `opencode` devtool. |
| pi | An entry in `~/.pi/agent/mcp.json`, which pi 0.99.0 and newer read. | Those with the `pi` devtool. |
| Cursor CLI | Nothing. | None. |
| Antigravity CLI | Nothing. | None. |

The [Integration reference](https://docs.ringleader.dev/reference/resources/integration/#mcp-server-fields-and-names)
gives the rules for a server's name. It also says which server wins when you declare one of
the same name in a toolconfig.

### Other agents

An agent without a row in the table can read the server from
`/etc/ringleader/mcp/<name>.json`. [The endpoint files](https://docs.ringleader.dev/reference/resources/integration/#the-endpoint-files)
lists its fields. Use `injected` mode for this, because in `local` mode the file holds a reference
to a Secret and not the key. [Run your own coding agent in Ringleader](https://docs.ringleader.dev/guides/run-own-coding-agent/)
shows how an agent uses it.

## Injected and local modes

The `mode` field decides how the server's key reaches it:

- `injected`, the default, keeps the key off the workstation. The key is added to each request
  as it leaves, as [Injected credentials](https://docs.ringleader.dev/security/credentials/injected-credentials/)
  describes. So the Integration must be `type: httpProxy`. It works on cloud workstations.
  On a local workstation, a key from a Secret is added only where the Integration's author owns
  the workstation. An MCP server's rule has no `allowDaemonPlacement` setting. A token from a [credential provider](https://docs.ringleader.dev/reference/resources/credentialprovider/#the-credential-source)
  with `userAuthorization: boxOwner` is added on every local workstation. On any other local
  workstation, requests to the server go out without the key.
- `local` puts the key on the workstation, in each tool's own settings. It works on every
  provider, with either type. The Secret's whole value becomes the header. Store any prefix, such as
  `Bearer `, inside the Secret.

Ringleader adds an MCP server's host to the workstation's egress policy. See
[Destinations Ringleader adds](https://docs.ringleader.dev/security/outbound/outbound-restrictions/#destinations-ringleader-adds).

## MCP server requirements

Two things about the workstations an Integration reaches decide whether its MCP server works:

- Declare the agent's devtool in the same layers, or the server is not registered with that agent.
  That means the [`claude-code`](https://docs.ringleader.dev/reference/tools/devtools/claude-code/),
  [`opencode`](https://docs.ringleader.dev/reference/tools/devtools/opencode/) or
  [`pi`](https://docs.ringleader.dev/reference/tools/devtools/pi/) devtool. Codex needs none. A `claude-code`
  toolconfig that declares `mcpServers` on a workstation without the devtool fails its step.
- For pi, the devtool's `version` must be 0.99.0 or newer, or left out.
- In `local` mode, every owner of a workstation the Integration reaches must be able to read
  the Secret, as for an
  [`llm` key](https://docs.ringleader.dev/workstations/coding-agents/llm-gateways/#gateway-key-handling).

## Removal of an MCP server

Removing the server takes it out of Codex, and out of pi along with anything pi stored for it.
OpenCode follows its [toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/opencode/#file-merging),
which removes a key it stops declaring.
It stays in Claude Code when it was the last server Ringleader registered there. To remove it
from Claude Code, run `claude mcp remove --scope user <name>` on the workstation.

## MCP servers in a toolconfig

A toolconfig can declare servers of its own. Ringleader writes them into the agent's own
configuration, and a server you declare wins over an Integration's server of the same name:

- Claude Code takes `mcpServers`, as the next section describes.
- Codex takes [`mcpServers`](https://docs.ringleader.dev/reference/tools/tool-configuration/codex/#mcp-servers).
- pi takes [`mcpServers`](https://docs.ringleader.dev/reference/tools/tool-configuration/pi/#mcp-servers).
- OpenCode takes servers under `mcp` in `settings` of the
  [`opencode` toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/opencode/).
- Cursor CLI and Antigravity CLI have no toolconfig.

## MCP servers in Claude Code

A `claude-code` toolconfig declares servers in `mcpServers`. Ringleader adds them the
way you would yourself, with `claude mcp add --scope user` as the login user. So they land
where the terminal and the editor panels both read them, and you can still add your own by
hand. The [claude-code toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/claude-code/#mcp-servers)
lists the fields.

## claude.ai connectors in Claude Code

By default Claude Code also fetches and connects the connectors of the claude.ai account that
is signed in. To keep a workstation on the MCP servers its toolconfig declares, set
`claudeAiConnectors: deny` in the `claude-code` toolconfig:

```yaml
spec:
  toolconfigs:
    - id: claude-code
      name: claude-code
      config:
        claudeAiConnectors: deny
        mcpServers:
          linear:
            type: http
            url: https://mcp.linear.app/mcp
```

It writes two keys into the managed settings layer:

- `disableClaudeAiConnectors: true` stops the account's connectors from being fetched or
  connected.
- `disableSideloadFlags: true` makes `claude` refuse the `--plugin-dir`, `--plugin-url`,
  `--agents` and `--mcp-config` flags, which would hand a server back in at startup.

The servers in `mcpServers` still work, because they are added with `claude mcp add`, which
that setting does not cover. `allow`, the default, writes nothing. Set either key in
`managedSettings` yourself and your value stands. A `false` there re-opens connectors only
when no other settings file sets the key to `true`.

## Register an MCP server with the key kept off the workstation

This Integration registers a Linear MCP server in `injected` mode for every workstation
labeled `team: platform`:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: Integration
metadata:
  name: linear-mcp
  namespace: acme
spec:
  type: httpProxy
  selector:
    matchLabels:
      team: platform
  mcp:
    name: linear
    url: https://mcp.linear.app/mcp
    inject:
      header: Authorization
      value: "Bearer ${secret:linear/token}"
```

Do not also list the server's host under `httpProxy.rules`. The `mcp` rule is the one used,
and the other rule for that host is dropped. For a workstation that gets no key, use `local`
mode, as [Injected and local modes](#injected-and-local-modes) explains.

For a server that signs people in with OAuth, no key is needed. Each workstation's owner connects their
own account, as
[Connect an MCP server with each person's own account](https://docs.ringleader.dev/guides/connect-mcp-server/)
shows.

## Register an MCP server with the key on the workstation

In `local` mode, the key is in each tool's own settings. This `local` example adds a Linear
MCP server beside an LLM gateway:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: Integration
metadata:
  name: llm
  namespace: acme
spec:
  type: llm
  selector:
    matchLabels:
      team: platform
  llm:
    endpoint:
      source: external
      vendor: openrouter
      credentialRef:
        name: openrouter
        key: token
  mcp:
    name: linear
    url: https://mcp.linear.app/mcp
    mode: local
    header: Authorization
    credentialRef:
      name: linear
      key: token
```

An Integration needs a `type`, and `local` mode works with either. This example uses `llm`, so
the same Integration also points the agents at OpenRouter. With `type: httpProxy`, `local`
mode also needs an `httpProxy` block. The
[Integration reference](https://docs.ringleader.dev/reference/resources/integration/#mcp-server-fields-and-names)
lists the `mcp` fields.

## Check that an injected MCP server gets its key

Each agent has a command that lists its MCP servers. Run the agent's command on the workstation
to see that it registered the server:

- Claude Code: `claude mcp list` reports an `injected` server connected.
- Codex: `codex mcp list` reports `Not logged in`, because Codex has no key on the
  workstation. That is expected: Ringleader adds the key as each request leaves the workstation.
- OpenCode: `opencode mcp list` lists the server and its connection state.
- pi: `pi mcp list` connects to each enabled server and prints its state, tools and errors.
  Inside pi, `/mcp` shows the same.
- Cursor CLI and Antigravity CLI: nothing is registered, so there is nothing to check.

To check that it did, run
[`rl workstation egress <name> --credentials`](https://docs.ringleader.dev/reference/cli/commands/workstation-access/#rl-workstation-egress-workstation).
The command lists the server's host and request count. New credential-use records can take a
few minutes to appear. On a workstation where the key is not added, the command prints
`Nothing recorded in this window.` On a provider that no Edge serves, it says that no Edge serves
the workstation. [Keys on local workstations](https://docs.ringleader.dev/security/credentials/injected-credentials/#keys-on-local-workstations)
says where the key is added.

## Sign in to an MCP server in Claude Code

Declaring an MCP server in a toolconfig does not sign you in to it. Unless you supply a header
or environment token, you sign in from Claude Code with `/mcp`, and the token is then on the
workstation. To have the sign-in page open on your computer, follow
[Sign in to a tool from a workstation](https://docs.ringleader.dev/guides/tool-sign-in/#sign-in-from-a-workstation).
To keep the token off the workstation, use an Integration, as
[Connect an MCP server with each person's own account](https://docs.ringleader.dev/guides/connect-mcp-server/)
shows.

For the other agents, sign in with the agent's own command, as its documentation describes.
Cursor CLI and Antigravity CLI get no server from an Integration, so there is nothing to sign in
to.

## Next steps

- [Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/) says which
  agents get an MCP server from an Integration.
- [LLM gateways for coding agents](https://docs.ringleader.dev/workstations/coding-agents/llm-gateways/)
  points your agents at an LLM gateway.
- [Integration behavior](https://docs.ringleader.dev/workstations/configuration/integration-behavior/) says which
  workstations an Integration reaches and what happens when it stops applying.
- [Integration](https://docs.ringleader.dev/reference/resources/integration/) lists the `mcp` fields and the rules
  for a server's name.
- [Injected credentials](https://docs.ringleader.dev/security/credentials/injected-credentials/) explains how a key
  is added to a request as it leaves.
- [OWASP lists](https://docs.ringleader.dev/security/model/owasp/) says what a workstation does
  about each item on the OWASP MCP Top 10.

