How to disable MCP servers in Claude Code, Codex, VS Code and Antigravity
An MCP server you do not need is a running process with tokens and access. Here is how to stop one, switch it off, or turn MCP off for every machine so nobody can switch it back on.
Next step
AI Agent Blocklist: MCP servers blocked where settings cannot reach
MCP server domains, MCP packages and MCP bridge extensions for your firewall, DNS filter and device policies, updated every day.
From $99 a month for one organisation
Stop, disable, remove or block: four different things
People search "how to stop an MCP server" when they mean four different actions. Only one of them survives the next restart, the next git pull and a curious user. Pick the one that matches your goal.
Stop
Ends the server process now. It can start again with the next chat or restart.
Lasts until the next start
Disable
Keeps the configuration but prevents it from starting. The user can switch it back on.
Lasts until the user changes it
Remove
Deletes the entry from the config file. A project file or a reinstall can bring it back.
Lasts until it is added again
Block by policy
A managed setting decides which servers may run. Users cannot override it.
Lasts until IT changes it
Why MCP servers come back after you switch them off
Admins often disable a server and find it running again a week later. These are the usual reasons, and each one is a sign that you need a policy, not a toggle.
Project files
A repository can carry its own MCP file. Cloning or pulling the project brings the server back for everyone who opens it.
Imported configs
Some editors can import MCP servers configured in other AI tools on the same machine. One switch-off does not cover the others.
Auto-start
Clients start configured servers when a chat begins. A stopped server simply starts again.
User scope
Users can add servers in their own profile. A project-level change does not touch those.
Extensions and plugins
Editor extensions and agent plugins can ship MCP servers of their own.
Account connectors
Connectors added in a web account follow the user to every device where they sign in.
How to disable MCP in Claude Code
CLI, IDE extensions and desktop- Type /mcp in a Claude Code session to see the configured servers.
- Select the server and switch it off. It stays configured but no longer starts.
- To delete it, run claude mcp remove followed by the server name. Run claude mcp list to confirm.
- For servers from a project's .mcp.json, add their names to disabledMcpjsonServers in your settings.
Servers can be saved at local, project or user scope. If a removed server is still listed, it is defined at another scope.
Place a managed-mcp.json file in the Claude Code system folder. It takes exclusive control: only the servers it lists load, and users cannot add their own. An empty list turns user-added MCP off.
macOS: /Library/Application Support/ClaudeCode/
Linux and WSL: /etc/claude-code/
Windows: C:\Program Files\ClaudeCode\
To allow some servers instead, use allowedMcpServers and deniedMcpServers in managed-settings.json. See the MCP allowlist guide.
How to disable MCP in Codex
Codex CLI, IDE extension and desktop app share one config- Open ~/.codex/config.toml. Each server has its own table.
- Add enabled = false under the server to switch it off without deleting it.
- Or run codex mcp remove with the server name, and check with codex mcp list.
- To keep a server but drop risky tools, list them in disabled_tools.
A project can also carry a .codex/config.toml, read only in trusted projects.
Codex reads hard limits from requirements.toml. When its mcp_servers section is present but empty, the local client disables all MCP servers. Add entries to allow named servers only.
Linux and macOS: /etc/codex/requirements.toml
Windows: %ProgramData%\OpenAI\Codex\requirements.toml
macOS MDM: the key requirements_toml_base64 in the Codex preference domain
How to stop or disable an MCP server in VS Code
Applies to GitHub Copilot chat and agent mode- Open the Command Palette and run MCP: List Servers.
- Pick the server. Choose Stop to end the current run only.
- Choose Disable to keep it off, or Uninstall for servers installed from the gallery. Delete the entry from mcp.json for servers you added by hand.
- To turn MCP off in your editor, set chat.mcp.access to none.
Workspace servers live in .vscode/mcp.json. In Restricted Mode they do not start, because they follow Workspace Trust.
Enforce the same setting with the ChatMCP policy. Users then see it as managed by the organisation.
- Windows: the VS Code ADMX template, under Administrative Templates, Visual Studio Code.
- macOS: a configuration profile built from the sample shipped with VS Code.
- Linux: /etc/vscode/policy.json, with policy names as keys.
For GitHub Copilot Business or Enterprise, the "MCP servers in Copilot" policy in the organisation or enterprise settings is off by default. Keep it off if you want no MCP in Copilot.
How to disable an MCP server in Antigravity
Google's agent-first IDE- Open the menu in the agent panel and choose MCP Servers.
- Select Manage MCP Servers to see each installed server.
- Use the server's menu to Disable or Delete it.
- Or choose View raw config and set "disabled": true on the server.
The raw config also takes disabledTools to switch off single tools.
We found no documented admin setting that controls MCP in Antigravity. Until one exists, company-wide control has to come from outside the app.
- Decide whether Antigravity is approved at all. If not, block the app with MDM using IDs such as Google.Antigravity (winget) and com.google.Antigravity (macOS).
- Block unapproved hosted MCP domains at the firewall or DNS filter.
- Check devices for the MCP config file during inventory.
Other tools: Cursor, Gemini CLI, Claude Desktop and JetBrains
The same split applies everywhere: a toggle for the user, a managed setting for IT. Menu names change between releases, so check the current settings screen if a label differs.
Cursor
Users switch a server off with its toggle under Customize in the sidebar. Servers live in ~/.cursor/mcp.json and .cursor/mcp.json.
On the Enterprise plan, the MCP allowlist in the team settings blocks every server that does not match.
Gemini CLI
Run /mcp disable or gemini mcp disable with the server name.
Admins set mcp.allowed or mcp.excluded in the system settings file, such as /etc/gemini-cli/settings.json, which overrides user settings.
Claude Desktop
Device policy keys isLocalDevMcpEnabled and isDesktopExtensionEnabled set to false turn off local MCP servers and desktop extensions.
Team and Enterprise owners also have a desktop extension allowlist in the organisation settings.
JetBrains IDEs
In AI Assistant, untick the server under Settings, Tools, AI Assistant, Model Context Protocol (MCP), then Apply.
With IDE Services, admins can switch off "Allow users to add MCP in their IDE".
GitHub Copilot cloud agent
The agent that works on GitHub itself reads MCP servers from the repository settings under Copilot, not from the editor.
Remove servers there, and limit who can change repository settings, because this agent runs its tools without asking.
Claude connectors in the web account
Remote MCP connectors added at Organization settings, Connectors follow users to every device.
Owners can remove a connector for the whole organisation, and Claude Code respects disableClaudeAiConnectors in managed settings.
Quick reference: where each control lives
Keep this table next to your change ticket. It lists the user action and the admin control for each tool on this page.
| Tool | Stop or disable one server | Remove | Admin control |
|---|---|---|---|
| Claude Code | /mcp toggle | claude mcp remove | managed-mcp.json, managed-settings.json |
| Codex | enabled = false | codex mcp remove | requirements.toml |
| VS Code | MCP: List Servers, Stop or Disable | Uninstall, or delete from mcp.json | ChatMCP policy, Copilot MCP policy |
| Antigravity | Manage MCP Servers, Disable | Delete | None documented |
| Cursor | Toggle under Customize | Delete from mcp.json | Team MCP allowlist (Enterprise) |
| Gemini CLI | /mcp disable | gemini mcp remove | System settings file |
| Claude Desktop | Settings, extensions | Uninstall extension | Device policy keys, extension allowlist |
| JetBrains AI Assistant | Untick and Apply | Remove in the MCP settings | IDE Services AI Enterprise settings |
How to stop an MCP server that will not stop
Local MCP servers are ordinary processes started by the AI client. When a client crashes or a server hangs, the process can stay behind and keep its tokens in memory.
Restart from the client first
Use Restart or Stop in the client's MCP list. In VS Code that is MCP: List Servers. In Claude Code, ending the session ends the servers it started.
Find leftover processes
Open Task Manager or Activity Monitor and look for runtimes started by the editor, such as Node, Python or Docker, with the server's name in the command line.
Rotate the token
If you stop a server because you no longer trust it, revoke its token as well. Stopping the process does not cancel what it already sent.
Remove the start trigger
Disable or remove the entry so the server does not start with the next chat, then check the project's MCP file in the repository.
Before you switch MCP off for everyone
A company-wide switch-off can break workflows that engineering depends on. Run through these points first, then use the rollout plan below.
Check first
- Which servers are in use today, from devices and logs
- Which teams depend on them for daily work
- Which of them hold tokens to production systems
- Who owns each AI client's policy in IT
Roll out in this order
- Announce the change and the request route for exceptions
- Push the managed setting to a small pilot group
- Confirm servers no longer start, then push to everyone
- Block unapproved MCP domains at the network the same day
Disabling in settings is one layer. Add two more.
Every tool keeps its own MCP list, and new AI clients arrive faster than policies get written. The network and the browser give you a second and third layer that work across tools.
Client settings
- Managed MCP files and policies per tool
- Stops local servers from starting
- Needs one policy per AI client
Network
- Blocks hosted MCP servers and MCP directories
- Covers tools you have not written a policy for
- See blocking AI at the firewall
Browser and device
- Blocks MCP bridge extensions such as bjfgambnhccakkhmkepdoekmckoijdlc
- Blocks unapproved coding agents by package or process name
- See blocking AI extensions
Turn MCP off once, and keep it off
Settings decide what each client may start. Our lists decide what the network and the browser let through. Both update every day, and we set up your download access within one business day of your order.
- MCP server and integration domains, with risk grade
- Firewall, DNS filter, hosts and PAC files
- Coding agent and MCP package names, process names
- Chrome and Edge extension block lists
- CSV and JSON with all columns
Ask us or order a plan
Tell us what you need to block and where your rules live. We reply within one business day.
- Files for firewalls, DNS filters, secure web gateways, MDM and browser policies
- Updated every day as new AI browsers, agents and extensions appear
- Plans for one organisation, for MSPs and for product makers, or a hosted filter we run for you
Disabling MCP: common questions
How do I disable MCP in Claude Code?
For one server, type /mcp and switch the server off, or run claude mcp remove with the server name.
For every machine, an admin places a managed-mcp.json file with an empty mcpServers object in the Claude Code system folder, which leaves no user-added servers running.
How do I disable MCP in Codex?
Set enabled = false under the server's table in ~/.codex/config.toml, or run codex mcp remove with the name.
Admins can enforce a requirements.toml: if its mcp_servers section is present but empty, the local client disables all MCP servers.
How do I stop an MCP server in VS Code?
Run MCP: List Servers, pick the server and choose Stop. Stop only ends the current run. Choose Disable to keep it off, or Uninstall to remove it.
To turn MCP off entirely, set chat.mcp.access to none, or enforce it with the ChatMCP policy.
How do I disable an MCP server in Antigravity?
Open MCP Servers, choose Manage MCP Servers and disable or delete the server. In the raw config you can set disabled to true.
We found no documented admin setting for MCP in Antigravity, so use device and network controls for company-wide rules.
What is the difference between stopping and disabling an MCP server?
Stopping ends the process for now; it can start again on the next chat. Disabling keeps the configuration but prevents it from starting. Removing deletes it. Only a managed policy stops a user turning it back on.
Does disabling MCP in one tool disable it everywhere?
No. Each AI client keeps its own MCP settings. A server switched off in VS Code can still run in Claude Code, Cursor or Codex on the same laptop.
Set the managed policy in each tool and block unapproved MCP domains at the network.
How do I disable MCP servers in Cursor?
Open Customize in the sidebar and switch the server off, or delete it from ~/.cursor/mcp.json or the project's .cursor/mcp.json.
On the Enterprise plan, admins set an MCP allowlist in the team settings, and servers that do not match are blocked. See also how to block Cursor.
How do I turn off MCP servers in Claude Desktop?
Users remove extensions in the app's settings. Admins set the device policy keys isLocalDevMcpEnabled and isDesktopExtensionEnabled to false, which turns off local MCP servers and desktop extensions on that machine. For the CLI, see how to block Claude Code.
Claude, Claude Code and Claude Desktop are trademarks of Anthropic, PBC. Codex is a trademark of OpenAI. Visual Studio Code, VS Code and Windows are trademarks of Microsoft Corporation. GitHub and GitHub Copilot are trademarks of GitHub, Inc.
Google, Antigravity and Gemini are trademarks of Google LLC. Cursor is a trademark of Anysphere, Inc. JetBrains and IntelliJ are trademarks of JetBrains s.r.o. macOS is a trademark of Apple Inc. Smithery and Browser MCP are trademarks of their respective owners.
Names are used only to identify the products discussed. AI Agent Blocklist is not affiliated with, sponsored or endorsed by these companies.