[BUG] HTTP MCP server with a hyphenated name: tools injected to the model as mcp__server_name__* (underscore) while /mcp UI shows mcp__server-name__* (hyphen) → "No such tool available"

Status Open
Reported on v2.1.217
Maintainer reply None cached
Activity 0 comments · opened Jul 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

### What happened
An HTTP-transport MCP server whose config key contains a hyphen connects
successfully (visible and correctly named in /mcp), but its tools are
uncallable by the model. Every call fails with:

Error: No such tool available: mcp__unreal_mcp__list_toolsets

The root cause appears to be an internal naming inconsistency:

  • .mcp.json key: unreal-mcp (hyphen)
  • /mcp UI shows the tool: mcp__unreal-mcp__list_toolsets (hyphen — correct)
  • Function schema injected

to the model: mcp__unreal_mcp__list_toolsets (underscore — WRONG)

So the model can only call the underscore form, but the router is registered
under the hyphen form, and the call is rejected. The hyphen→underscore
normalization happens only on the model-injection path, not on the UI/routing
path.

A stdio server in the same .mcp.json (key enginelink, no hyphen) works
perfectly, which is why this looks specific to (a) HTTP transport and/or
(b) hyphenated server keys.

What Should Happen?

mcp__unreal-mcp__list_toolsets, not mcp__unreal_mcp__list_toolsets

Error Messages/Logs

Steps to Reproduce

Repro

.mcp.json:

```json
{
"mcpServers": {
"enginelink": {
"command": "node",
"args": ["...\\dist\\mcp-server.js"]
},
"unreal-mcp": {
"type": "http",
"url": "http://127.0.0.1:8123/mcp"
}
}
}

  1. Start the HTTP MCP server on 127.0.0.1:8123/mcp.
  2. Open Claude Code. Run /mcp → unreal-mcp shows Connected, tools listed

with full name mcp__unreal-mcp__list_toolsets.

  1. Ask the model to call a tool from unreal-mcp.
  2. It calls mcp__unreal_mcp__list_toolsets (only form available in its

function table) → No such tool available.

  1. /clear and reopening the session does not help — every re-injection

reproduces the underscore form.

Expected

The tool name injected to the model must match the routing key exactly.
Either preserve the hyphen everywhere (mcp__unreal-mcp__list_toolsets,
consistent with #71688 which shows hyphens are otherwise preserved), or
normalize both paths identically.

Workaround

Rename the server key to use an underscore (unreal-mcp → unreal_mcp).
This aligns the injected name with the routing key and the tools become
callable. (Consistent with the "rename the key fixes it" reports in #40219
and #73663.)

Environment

  • Claude Code version: 2.1.217 (Claude Code)
  • Platform: Windows 11 Pro (10.0.26200)
  • Shell: VS Code
  • MCP transport of the affected server: HTTP (Streamable HTTP)
  • MCP transport of the working server: stdio

---

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.217 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Related

  • #40219 — renaming the server key fixes silent tool-registration failure
  • #73663 — renaming the connector key is the only fix
  • #34494 — HTTP MCP server connected but tools not exposed to the model
  • #71688 — confirms hyphens in server names are normally preserved (exact-match)
  • #15350 — HTTP MCP tools unavailable in conversation while stdio works

View original on GitHub ↗