Download

Dev blog · Features · 2026-11-22

How to remove an MCP server from Claude Code, Codex, Cursor and Gemini CLI

Adding an MCP server is one line. Removing it is usually where configs get damaged: a trailing comma left behind, the wrong closing brace deleted, a second copy in a project file you forgot about. Here’s the clean way for each agent, then what Calyban’s Undo does.

The command for each agent

Four agents have a CLI command, which is the safest manual route because the agent edits its own file:

claude mcp remove <name>
codex mcp remove <name>
gemini mcp remove <name>
copilot mcp remove <name>

Use the name exactly as the server is listed (claude mcp list shows them). For Claude Code, add --scope project or --scope user if the same name exists in more than one place.

Agents without a command

When you edit JSON by hand, check the comma on the line before the entry you removed. A trailing comma makes the whole file invalid in strict JSON, and some agents then load none of your servers.

Check you got all the copies

A server can be defined in more than one place: your user config and a project’s .mcp.json, for instance. Claude Code and GitHub Copilot both read a project’s .mcp.json, so removing it from one agent’s user config can leave it active in a project. Search the project too.

How does Calyban remove things?

For anything it installed, Remove (or Undo right after installing) takes out exactly what it added and nothing else:

In our test, Calyban added Context7 to five agents’ config files, each already holding a server and settings of the user’s own, then removed it. All five files came back identical byte for byte. The full test is in Calyban vs. setting up AI agents by hand.

For things you added by hand, Calyban shows them in Library with a switch to turn them off without deleting, which is often what you wanted anyway.

Should I remove it or switch it off?

Switch it off if you might want it back: it stops loading (and stops costing tokens on every request) but keeps its settings and API key. Remove it if you’re done with it. The Capabilities page shows which servers you never call, which is a good list to start from.

More on installs, Undo and switching off: Install and Undo. Stuck with a config that won’t load after a hand edit? Paste the error in Discord.

← More features · All field notes