Guide · List your MCP servers

How to List Your MCP Servers in Claude Code and Codex

Claude Code and Codex both run MCP servers, the small programs and web services that give an agent its tools. You add one for GitHub, one for a database, and a teammate puts another in the repo. A claude.ai connector you turned on months ago joins them. After a while nobody knows the whole list, you least of all.

Then a tool call fails halfway through a task. You need three answers fast. What’s installed, which one is broken, and where it was set, so you can fix it.

Each agent answers with one command. Below is what each one prints, what it leaves out, and how to clear out the servers you don’t use. The outputs are real, from a test setup we built for this post.

Quick answer
  • In Claude Code, run claude mcp list. It checks every server it can use from your current folder and prints each one’s state. Type /mcp for the same list inside a session.
  • In Codex, run codex mcp list. Add —json for JSON. It only reads your config, so a server that can’t start still says enabled.
  • For one server, run claude mcp get sentry. It prints the scope, the state and the exact command that removes it. codex mcp get does the same.
  • The settings live in three files. ~/.claude.json and a project’s .mcp.json for Claude Code, and ~/.codex/config.toml for Codex.
  • Each command covers one agent on one computer. Context Board lists every server of both agents on every computer you link, with what’s failing, waiting for a sign-in or doubled up first.

How to list MCP servers in Claude Code

Open a terminal in the folder you work in and run this.

claude mcp list

Claude Code gathers every server it can use from that folder, checks each one, and prints a line per server. This is part of what it printed for our test setup.

Checking MCP server health…

notes: node notes-server.mjs - ✔ Connected
sentry: https://mcp.sentry.dev/mcp (HTTP) - ! Needs authentication
team-docs: https://docs.example.com/mcp (HTTP) - ⏸ Pending approval (run `claude` to approve)

Each line ends with the server’s state. These are the four you’ll see.

  • ✔ Connected: it started and answered. Its tools are there in your next session.
  • ! Needs authentication: it’s a web server that wants you to sign in. Run claude mcp login sentry, or type /mcp in a session and pick it.
  • ✘ Failed to connect: it didn’t start, or didn’t answer. The reason follows on the same line. Ours said CONNECTION_CLOSED: Connection closed, because its command didn’t exist.
  • ⏸ Pending approval: it’s in the project’s .mcp.json, and you haven’t said yes to it in this folder. Claude Code won’t connect to it until you do. Run claude in the folder to approve it.

The check is real. To print Connected, Claude Code starts each approved server, the way a new session would. That makes the list depend on where you run it. In a project folder you see that project’s servers too. In your home folder you see the ones that follow you everywhere.

Two kinds of server join the list without a line in any file you wrote. If you sign in to Claude Code with a claude.ai account, your claude.ai connectors show up, named like claude.ai Gmail. You manage those at claude.ai, in Settings, under Connectors. Plugins bring servers too, named like plugin:productivity:slack.

Inside a session, /mcp shows the same servers with their states. It’s also where you sign in to one that needs it, and where you can turn a server off for one project without removing it.

See one server’s details with claude mcp get

claude mcp list tells you a server’s state. claude mcp get tells you where it lives and how to remove it.

$ claude mcp get old-db
old-db:
  Scope: User config (available in all your projects)
  Status: ✘ Failed to connect
  Issue: CONNECTION_CLOSED: Connection closed
  Type: stdio
  Command: db-mcp-server-missing
  Args:

To remove this server, run: claude mcp remove old-db -s user

The Scope line is the one to read. Claude Code has three scopes, and a server can sit in any of them.

ScopeWhere it’s savedWho gets it
local, “private to you in this project”~/.claude.json, under the project’s pathYou, in that one folder
project, “shared via .mcp.json”.mcp.json at the project’s rootEveryone who opens the repo, once they approve it
user, “available in all your projects”~/.claude.json, at the topYou, in every folder

claude mcp add uses local unless you pass -s. That’s why a server you added last month works in one repo and is missing in the next.

When the same server is in two scopes

We added a server called sentry for every project, then another sentry in one folder. In that folder, claude mcp list showed one sentry, not two. The local one won. claude mcp get sentry said Scope: Local config, and the user copy stayed in ~/.claude.json, out of sight.

So if a server behaves differently in one folder, look for a second copy with the same name.

How to list MCP servers in Codex

Codex keeps its own list, in its own file. Run this.

codex mcp list
Name    Command                Args              Env  Cwd  Status   Auth
notes   node                   notes-server.mjs  -    -    enabled  Unsupported
old-db  db-mcp-server-missing  -                 -    -    enabled  Unsupported

Name    Url                         Bearer Token Env Var  Status   Auth
sentry  https://mcp.sentry.dev/mcp  -                     enabled  Not logged in

Programs come first, then web servers. Status says whether a server is turned on in your config, and Auth whether you’re signed in to it. Unsupported means it’s a program that has no sign-in, not that anything is wrong.

Now look at old-db. Its command doesn’t exist, and it still says enabled. codex mcp list reads ~/.codex/config.toml and stops there. It never starts a server, so it can’t tell you one is broken. When Codex does start them for a session, old-db fails with MCP startup failed: program not found. That’s the first you hear of it.

Add --json for the same list as data, with enabled and auth_status on each server. codex mcp get sentry prints one server’s settings and ends with the command that removes it.

$ codex mcp get sentry
sentry
  enabled: true
  transport: streamable_http
  url: https://mcp.sentry.dev/mcp
  bearer_token_env_var: -
  http_headers: -
  env_http_headers: -
  http_headers_helper: -
  remove: codex mcp remove sentry

For a server that says Not logged in, run codex mcp login sentry. It opens the service’s sign-in in your browser. Add --no-browser on a computer without one, and it prints the link instead.

One more thing the list leaves out. Codex can use the apps on your ChatGPT account, and those aren’t in config.toml, so codex mcp list doesn’t show them.

When a server fails to connect

A failing server is nearly always one of four things. Check them in this order, because the first two are the most common and the quickest to rule out.

  • The program isn’t there. Copy the command from claude mcp get or codex mcp get and run it yourself in a terminal. If the terminal says it can’t find it, install it, or give the server the full path to the program.
  • It wants a sign-in. Claude Code says Needs authentication, and Codex says Not logged in. Run claude mcp login or codex mcp login with the server’s name.
  • Its key stopped working. A server that takes a key in a header or an environment variable fails once the key expires or is revoked. A 401 in the reason is the giveaway. Make a new key at the service and update the server.
  • It’s slow to start. Some servers download themselves on first run and take longer than the agent waits. Claude Code reads a longer wait from the MCP_TIMEOUT environment variable, in milliseconds. In Codex, set startup_timeout_sec in the server’s block.

Fix it, then run the list again. A server that still fails after all four is worth removing until its maker fixes it.

Where MCP settings live

Everything above comes out of a handful of places. Knowing them helps when a command won’t run, or when you want to copy a setup to a new computer.

AgentWhatWhere
Claude CodeYour servers, for every project~/.claude.json, at the top
Claude CodeYour servers, for one project~/.claude.json, under that project
Claude CodeYour team’s servers.mcp.json in the project
Claude Codeclaude.ai connectorsYour claude.ai account
CodexYour servers~/.codex/config.toml, one [mcp_servers.name] block each
CodexChatGPT appsYour ChatGPT account

On Windows, ~ is your user folder. Two settings move these files. CLAUDE_CONFIG_DIR puts Claude Code’s .claude.json inside that folder, and CODEX_HOME points Codex at another folder for its config.toml. If a server you know you added is missing, check whether either is set in your shell.

Both agents write these files for you through mcp add, and that’s the safer route. A stray comma in a hand edit can break the whole file.

How to remove an MCP server

In Claude Code, give the name and, when it’s in more than one scope, the scope.

claude mcp remove old-db -s user

Leave -s off and Claude Code removes the name from whichever scope it finds it in. claude mcp get prints the exact command, scope included, so copying it from there is the safe way.

For project servers, there’s one more command. claude mcp reset-project-choices clears every yes and no you gave that folder’s .mcp.json servers, and Claude Code asks again next time.

In Codex, the name is enough.

codex mcp remove old-db

To keep a Codex server but stop it starting, set enabled = false in its block in config.toml. codex mcp list then shows it as disabled.

Which ones to remove first? Anything that fails every time, since it only adds an error. Then copies. A GitHub server of your own and the GitHub claude.ai connector give the agent two ways into the same account. Then anything you don’t remember adding. A server can read and change things in whatever it connects to, so check what a server can do before you keep one you can’t place.

Every server, on every computer, in one place

Both commands answer for one agent, in one folder, on one computer. Run Claude Code and Codex on a laptop and a desktop, and that’s four lists in four terminals. One of them won’t tell you what’s broken.

Context Board is ours, so weigh the bias. It’s a live board you build for yourself, and its Connections widget counts every MCP server your agents use and says how many need you. It turns red while one is failing, and amber while one waits for a sign-in.

Connections2 computers4m
37connections3 need you1 failing · 1 to sign in · 1 doubled up
AI usageClaude Code · Codexnow
Claude Code
58%leftCurrent sessionresets in 2h 10m
64%leftThis weekresets Mon 9:00 AM
Codex
81%leftCurrent sessionresets in 4h 30m
47%leftThis weekresets Sat 11:00 AM
As they last checked, 2m ago
Codexapi · main1m
Working
Moving the webhook queue to Postgres

Sentry wants a sign-in again. Run claude mcp login sentry before Friday's deploy.

Today
  • Remove the old database server
  • Sign in to Sentry
  • Pick one GitHub server, drop the other
An example Context Board named Agents. Every number on it is example data.

Click it and every server is there, by computer and by agent. Each place groups its servers by where they come from: your own, claude.ai connectors, ChatGPT apps, plugins and project servers. What needs you comes first.

  • Failing: the server wouldn’t start, or turned down its key, with the reason.
  • Sign in: it’s waiting for you to sign in.
  • Doubled up: one agent has two ways into the same service, like GitHub as a claude.ai connector and as your own server.

Beside each one is its fix. For a server of your own that’s a command, the same ones as above, with a button to copy it. For a claude.ai connector or a ChatGPT app it’s a link to where it’s managed. The board never changes your settings itself. You run the command on that computer and press Look again.

It checks the way a new session does, so a Codex server that can’t start shows as failing, not enabled. It never starts a project’s servers. It reads those from the file and marks them Not checked. Each server also shows which of its tools can change things and which only read.

The reading is done by the runner, a small program you set up once with one line from Connect. It looks every six hours while the widget is on a board, and whenever you press Look again. Keys, tokens and passwords are stripped on your computer, and again on the board. The board gets names, states and the fix, never a secret.

It reads Claude Code and Codex, not Cursor or Claude Desktop. Context Board is free for 3 days, then $12 a month, with every widget included.

For the protocol itself, Anthropic’s Claude Code MCP docs cover adding servers, scopes and sign-in, OpenAI’s Codex MCP docs cover config.toml, and the Model Context Protocol site explains how servers and clients talk.

Frequently asked questions

Something else on your mind? Get in touch.

How do I list MCP servers in Claude Code?

Run claude mcp list in a terminal. Claude Code checks every server it can use from that folder and prints each one's address or command and its state, such as Connected, Needs authentication, Failed to connect or Pending approval. Inside a session, type /mcp to see the same servers.

How do I list MCP servers in Codex?

Run codex mcp list. It prints a table of every server in ~/.codex/config.toml with its command or URL, whether it's enabled and its sign-in state. Add --json for the same list as JSON. It doesn't start the servers, so it can't tell you one is broken.

Where does Claude Code store MCP servers?

Servers for you alone live in ~/.claude.json. Ones for every project sit at the top of the file (user scope), and ones for a single project sit under that project's path (local scope). Servers for your team live in .mcp.json at the project's root (project scope).

How do I remove an MCP server from Claude Code?

Run claude mcp remove with its name. Add -s and the scope (local, project or user) when the name is in more than one. claude mcp get prints the exact remove command for any server.

Why does claude mcp list show a server once when I added it twice?

Because two servers with one name are one server to Claude Code. A local server hides a user server of the same name, and claude mcp list shows only the one it uses. Run claude mcp get with the name to see which scope won.

Can I see every MCP server across Claude Code, Codex and my computers?

Not with either command, since each covers one agent on one computer. Context Board's Connections widget lists every server of Claude Code's and Codex's on each computer you link, with what's failing, waiting for a sign-in or doubled up first. It's free for 3 days, then $12 a month.