BUILD / remove-mcp-server-with-grok-cli

Build

Remove an MCP server with the Grok CLI

Delete a configured MCP server from Grok Build when a remote is stale, a stdio path moved, or you no longer want its tools namespaced as <server>__<tool> in the agent. Official MCP Servers documents grok mcp remove <name> beside list, add, and doctor, and the CLI Reference lists the same grok mcp <list|add|remove|doctor> surface. Install the CLI from the Grok Build overview if it is not already on your PATH.

What you need

The Grok Build CLI signed in (grok login), the exact server name as shown by grok mcp list, and clarity about whether that name lives in user ~/.grok/config.toml, a project .grok/config.toml, or only in a vendor compat file. Neighboring jobs include Add MCP servers in Grok Build when you need to put a server back, List MCP servers with the Grok CLI before you pick the name to delete, and Diagnose MCP servers with grok mcp doctor when a listed server fails before you decide to remove it. More Build jobs live on the Build hub.

Remove from the shell

  1. Change into the project (so project-scoped names resolve) and list what Grok currently loads:
cd /path/to/your-project
grok mcp list
# optional machine-readable:
grok mcp list --json
  1. Remove the server by the name from that list:
grok mcp remove filesystem

Replace filesystem with your server’s configured name. Official docs pair remove with add/list/doctor on the same grok mcp command family.

  1. Confirm the name is gone:
grok mcp list
grok inspect

If the name still appears, it may be coming from a project .grok/config.toml you are not editing, a parent walk of .grok/config.toml, or a vendor compat file (~/.claude.json, .cursor/mcp.json, project .mcp.json). Edit or disable that source, then list again.

  1. Prefer the TUI when you are already inside a session. Open /mcps and use x to remove (official MCP docs: Space toggles, r refreshes, i authenticates OAuth, a / x add or remove). Refresh after config edits before you assume the namespace is gone.

Pitfalls

Removing a user-scoped name while a project .grok/config.toml still declares the same server leaves the tools available from the project layer. Deleting only the OAuth token file under ~/.grok/mcp_credentials.json does not unregister the server — run grok mcp remove (or remove the config.toml block) when the goal is to drop the server entirely. Expecting remove to fix a broken stdio binary path is backwards; doctor first, then remove or re-add with a corrected command.