---
title: "Use the same MCP servers in Claude Code, Codex and OpenCode"
description: "Where Claude Code, Codex, OpenCode, OpenClaw and Hermes keep MCP servers, and how one command gives them all the same ones."
canonical_url: https://antonio-amore-akiki.vercel.app/guides/shared-mcp-servers/
last_updated: 2026-11-17
---

# Use the same MCP servers in Claude Code, Codex and OpenCode

Where Claude Code, Codex, OpenCode, OpenClaw and Hermes keep MCP servers, and how one command gives them all the same ones.

Every AI coding app keeps its own list of [Model Context Protocol](https://en.wikipedia.org/wiki/Model_Context_Protocol) (MCP) servers, in its own file and its own format. Add a server to Claude Code and Codex still does not see it. This guide lists where each app keeps that list, and shows how [Centralino](https://antonio-amore-akiki.vercel.app/centralino/) writes one shared server into all of them at once.

## Where each app keeps its MCP servers

| App | File | Key | Format | Add from the command line |
|---|---|---|---|---|
| Claude Code | `~/.claude.json` (user and local scope), `.mcp.json` (project) | `mcpServers.<name>` | JSON | `claude mcp add` |
| Claude Desktop | Windows `%APPDATA%\Claude\claude_desktop_config.json`, macOS `~/Library/Application Support/Claude/` | `mcpServers.<name>` | JSON | none, restart the app |
| Codex | `~/.codex/config.toml`, or `.codex/config.toml` in a trusted project | `[mcp_servers.<name>]` | TOML | `codex mcp add` |
| OpenCode | `~/.config/opencode/opencode.json` | `mcp.<name>` | JSON or JSONC | none |
| OpenClaw | `~/.openclaw/openclaw.json` | `mcp.servers.<name>` | JSON | `openclaw mcp add` |
| Hermes | `~/.hermes/config.yaml` | `mcp_servers.<name>` | YAML | `hermes mcp add` |
Table: Where six AI apps keep their MCP server list, the key, the format and the command that adds a server

Sources: [Claude Code MCP](https://code.claude.com/docs/en/mcp), [Codex MCP](https://developers.openai.com/codex/mcp), [OpenCode MCP servers](https://opencode.ai/docs/mcp-servers/), [OpenClaw MCP](https://docs.openclaw.ai/cli/mcp) and the [Hermes agent docs](https://github.com/NousResearch/hermes-agent), collected in Centralino's [host registration reference](https://gitlab.com/antonio-amore-akiki/centralino/-/blob/master/docs/host-mcp-registration.md).

## The same server in each format

One stdio server, here called `mcp_dispatcher`, looks different in every file:

```json
{"mcpServers": {"mcp_dispatcher": {"command": "python", "args": ["server.py"]}}}
```

```toml
[mcp_servers.mcp_dispatcher]
command = "python"
args = ["server.py"]
```

```json
{"mcp": {"mcp_dispatcher": {"type": "local", "command": ["python", "server.py"], "enabled": true}}}
```

The first is Claude Code and Claude Desktop, the second Codex, the third OpenCode. OpenCode is the odd one: `command` is a single array that holds the program and its arguments, it needs `"type": "local"`, and environment variables go under `environment` rather than `env`.

## One command for all of them

Centralino puts all your MCP servers behind one dispatcher server and writes that single entry into each app it finds, in the app's own format. Adding or changing a server later never means editing six files again.

On a new machine, with Node 20+ and Python 3.10+:

```text
npx gitlab:antonio-amore-akiki/centralino setup
```

If the dispatcher already runs in Claude, only wire the other apps:

```text
npx gitlab:antonio-amore-akiki/centralino install
```

It detects which of the six apps are present, merges its one entry without touching your other servers, keeps a `.bak` of every file it changes, and then runs its health check, which fails below 90 out of 100. `uninstall` removes the entry from every app again. Restart Claude Desktop afterwards, because it has no hot reload.

[Read more about Centralino](https://antonio-amore-akiki.vercel.app/centralino/), free and open source under the MIT license.

Written by [Antonio Amore Akiki](/), aerospace and manufacturing engineer in Enschede, the Netherlands.

## Frequently asked questions

### Where does Claude Code store its MCP servers?

User-scoped and local-scoped servers are stored in ~/.claude.json in your home folder. Project-scoped servers live in .mcp.json at the project root.

### Where does Codex store its MCP servers?

In ~/.codex/config.toml, one `[mcp_servers.name]` table per server. A trusted project can also have its own .codex/config.toml.

### Can Claude Code and Codex share one MCP config file?

No. Each app reads its own file in its own format (JSON for Claude Code, TOML for Codex, JSON with a command array for OpenCode). Centralino writes the same server into each file in that app's own format.

### Does Centralino overwrite my other MCP servers?

No. It only merges its own entry, writes a .bak copy of every file it touches, and its uninstall command removes the entry again.


By Antonio Amore Akiki, aerospace and manufacturing engineer: https://antonio-amore-akiki.vercel.app/about/
Canonical page: https://antonio-amore-akiki.vercel.app/guides/shared-mcp-servers/
