Skip to content

Plugin MCP server keys with hyphens are listed but not exposed as callable tools #33063

Open

Description

@kpbarrett

Summary

A plugin-provided MCP server whose .mcp.json key contains a hyphen can appear enabled in codex mcp list, but its tools are not exposed to the model as callable mcp__... tools. Renaming the MCP server key from context-library to context_library made the same server immediately callable.

This is easy to confuse with MCP startup or tools/list failures, because the plugin skill is loaded and codex mcp get <server> shows the server configuration, but the model cannot call or discover the tools.

Environment

  • Codex CLI: codex-cli 0.144.3
  • Platform: Linux x86_64 / RHEL-family host
  • Plugin source: local marketplace plugin
  • Plugin shape:
    • .codex-plugin/plugin.json with "mcpServers": "./.mcp.json"
    • bundled stdio Python MCP server
    • plugin skill loaded successfully

Reproduction

Install a local plugin whose .mcp.json uses a hyphenated MCP server key:

{
  "mcpServers": {
    "context-library": {
      "command": "python3",
      "args": ["./mcp/context_library_server.py"],
      "cwd": "./"
    }
  }
}

After installing the plugin:

codex plugin add context-library@vcinity-eng
codex mcp get context-library

codex mcp get reports the server as enabled. However, a fresh codex exec cannot call or discover the expected tool namespace:

mcp__context-library__get_library_status

The model reports that the MCP tool is not available / not exposed.

Now change only the MCP server key from context-library to context_library:

{
  "mcpServers": {
    "context_library": {
      "command": "python3",
      "args": ["./mcp/context_library_server.py"],
      "cwd": "./"
    }
  }
}

Reinstall the plugin, then run a fresh codex exec asking it to call:

mcp__context_library__get_library_status

The same MCP server becomes callable and returns a valid result.

Actual behavior

  • Hyphenated MCP server key is accepted/listed by codex mcp list / codex mcp get.
  • Plugin skill loads successfully.
  • The tool namespace is not exposed to the model as callable tools.
  • There is no clear diagnostic explaining that the MCP server key is invalid or unsupported for model-visible tool naming.

Expected behavior

One of these should happen:

  1. Codex rejects plugin MCP server keys that cannot become valid callable model tool namespaces, with a clear validation error at install/load time.
  2. Codex normalizes hyphenated MCP server keys into a valid namespace, such as context_library.
  3. Codex documents that plugin-provided MCP server keys must be valid callable namespace identifiers and surfaces a diagnostic when tools are dropped for naming reasons.

Related issue found while debugging

This was discovered alongside plugin-root path handling problems. That separate concern is already covered by:

For this issue, after changing the launch config to use cwd: "./" and a relative args path, the remaining difference was the MCP server key: hyphenated key not callable, underscore key callable.

Impact

Plugin authors can ship an MCP server that appears installed and enabled, but agents cannot use its tools. The failure mode sends users toward debugging MCP transport/server implementation even though the practical fix is just the server key name.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    mcpIssues related to the use of model context protocol (MCP) servers
    skillsIssues related to skills
    tool-callsIssues related to tool calling
    on Jul 14, 2026
  2. vismaytiwari commented on Jul 14, 2026

    @vismaytiwari

    Had a dig into where this diverges. There's already a name sanitizer on the connectors path — connectors/src/metadata.rs does roughly connector_name_slug(name).replace('-', '_'), so a connector named context-library becomes mcp__context_library__…. Plugin-provided MCP server keys, though, look like they're used raw as the tool namespace (the __-delimited name built in tools/handlers/mcp.rs) without going through that same normalization.

    That fits what you're seeing exactly: a hyphenated key like context-library still shows up in codex mcp get (the server loads fine), but the tool name it produces never lines up as callable, and renaming the key to context_library makes it work — because then it doesn't need normalizing.

    So the fix is likely to run plugin MCP server keys through the same hyphen→underscore sanitization the connectors path already uses (or, if you'd prefer to be strict about it, reject a hyphenated key at load time with a clear error rather than silently dropping the tools).

    I haven't built it end-to-end to pin the exact spot where the hyphenated name gets dropped (i.e. whether it's rejected upstream or just never mapped by the tool router), so I'm flagging this as a root-cause hypothesis rather than a confirmed one — happy to dig further or take a crack at a change if that'd be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) serversskillsIssues related to skillstool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions