MCP tool list cached by server name — adding new tools requires renaming server

Resolved 💬 4 comments Opened Mar 27, 2026 by Kyle01 Closed Apr 27, 2026

Summary

Claude Code caches the MCP tool list by server name and does not invalidate the cache when the server's tools/list response changes. This means adding new tools to an MCP server is invisible to Claude Code until the server is renamed in .mcp.json.

Reproduction

  1. Configure an MCP server in .mcp.json with name "foo" that registers 5 tools
  2. Start Claude Code — /mcp shows 5 tools. Correct.
  3. Update the server to register 15 tools (same binary, same path)
  4. Restart Claude Code — /mcp still shows 5 tools. Bug.
  5. Rename the server in .mcp.json from "foo" to "foo-bar" (same command and args)
  6. Restart Claude Code — /mcp shows 15 tools. Workaround confirms cache is keyed by name.

Investigation

  • Verified the server correctly returns all 15 tools via direct stdio tools/list JSON-RPC call
  • Verified no tool filtering in any Claude Code settings (settings.json, settings.local.json, .mcp.json)
  • Verified ENABLE_TOOL_SEARCH is set to "false"
  • Created a separate test MCP server with 15 tools and identical payload sizes (~11KB) — Claude Code showed all 15 tools for the test server, but still only 5 for the original "foo" server
  • Disabling other MCP servers (e.g., Playwright with 22 tools) did not free up tool slots for the "foo" server — ruling out a total tool budget
  • The only fix was renaming the server in .mcp.json

Expected behavior

Claude Code should re-discover tools from MCP servers on each startup (or when tools/list responses change), not serve a stale cached list keyed solely by server name.

Environment

  • Claude Code CLI (latest)
  • macOS Darwin 25.2.0
  • MCP server: custom stdio server using @modelcontextprotocol/sdk 1.27.1

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗