[Bug] MCP Tool Name Prefix 'mcp' Gets Truncated After First Call

Resolved 💬 3 comments Opened Feb 4, 2026 by Sapientropic Closed Mar 5, 2026

MCP Tool Name Prefix mcp Gets Truncated After First Call

Environment

  • OS: Windows 11
  • Claude Code Version: Latest (as of 2026-02-04)
  • MCP Servers:
  • Notion MCP (short name: n)
  • Exa MCP (short name: x)

Description

When calling MCP tools in a conversation, the first call works correctly with the full tool name (e.g., mcp__n__notion-fetch), but subsequent calls in the same session have the mcp prefix automatically truncated, resulting in invalid tool names like _n__notion-search.

Steps to Reproduce

  1. Configure an MCP server with a short name (e.g., Notion MCP with short name n)
  2. Verify the server is connected: claude mcp list shows n: ... - ✓ Connected
  3. In a Claude Code conversation, make the first MCP tool call:

``
Tool: mcp__n__notion-fetch
Parameters: {"id": "some-page-id"}
Result: ✅ Success
``

  1. Make a second MCP tool call in the same conversation:

``
Tool: mcp__n__notion-search (intended)
Actual tool called: _n__notion-search (truncated)
Result: ❌ Error: No such tool available: _n__notion-search
``

  1. All subsequent calls in the same session continue to have the mcp prefix truncated

Expected Behavior

All MCP tool calls should use the complete tool name with the mcp__ prefix:

  • mcp__n__notion-fetch
  • mcp__n__notion-search
  • mcp__n__notion-create-pages
  • mcp__x__web_search_exa

Actual Behavior

After the first successful call, subsequent calls have the mcp prefix removed:

  • _n__notion-fetch
  • _n__notion-search
  • _n__notion-create-pages
  • _x__web_search_exa

Impact

This bug makes it impossible to use MCP tools reliably in a conversation. Users must restart Claude Code after each MCP tool call to work around the issue.

Additional Context

  • The MCP servers themselves are working correctly (verified with claude mcp list)
  • The issue appears to be in how Claude Code handles tool name resolution after the first call
  • This may be related to context learning or tool name caching within a session

Workaround

Currently, the only workaround is to restart Claude Code before each MCP tool call, which severely impacts usability.

View original on GitHub ↗

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