MCP resource reads require server names that differ from exposed tool namespaces

Open 💬 0 comments Opened Jun 30, 2026 by drewclifton

What happened

In a Codex session using Unity MCP, callable MCP tools were exposed to the model under the namespace mcp__unityMCP, for example:

  • mcp__unityMCP.read_console
  • mcp__unityMCP.refresh_unity
  • mcp__unityMCP.validate_script

The Unity MCP instructions also said to read MCP resources such as:

  • mcpforunity://custom-tools
  • mcpforunity://instances

When the agent attempted to read those resources through the generic read_mcp_resource tool using server: "mcp__unityMCP", Codex returned:

resources/read failed: unknown MCP server 'mcp__unityMCP'

The actual resource server key was unityMCP, as discovered later via list_mcp_resources.

Why this is confusing

Codex exposes the same underlying MCP integration with two different identifiers:

  • Tool namespace: mcp__unityMCP
  • Resource server key: unityMCP

That distinction may be valid internally, but it is not obvious from the tool surface. The model naturally inferred that the tool namespace was also the resource server key.

Impact

This causes avoidable failed tool calls, extra discovery steps, token overhead, and user confusion. It is especially likely when an MCP server's instructions ask the agent to read resources before using tools.

Suggested fixes

Any of these would help:

  1. Accept mcp__unityMCP as an alias for unityMCP in generic MCP resource tools.
  2. Include the resource server key beside MCP tool namespaces in the tool description or session metadata.
  3. Improve the read_mcp_resource error message to list available server keys, e.g. unknown MCP server 'mcp__unityMCP'; available servers: unityMCP, codex_apps.
  4. Add guidance to the generic MCP resource tools: use list_mcp_resources first and pass the returned server value exactly.

Environment

  • Codex CLI: codex-cli 0.140.0
  • MCP server involved: Unity MCP / MCP For Unity
  • Resource reads worked after using server: "unityMCP"

View original on GitHub ↗