-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Description
When using Docker MCP Gateway with tool-name-prefix enabled, tool names are generated with colons (:) and potentially dots (.), which violate the Model Context Protocol's naming pattern requirements. This causes errors when connecting to MCP clients like Claude Desktop.
Error Message
tools.0.FrontendRemoteMcpToolDefinition.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'
Environment
- OS: macOS
- Docker Desktop Version: [Latest with MCP Toolkit enabled]
- MCP Client: Claude Desktop
- Docker MCP Gateway: Latest version
Current Behavior
Tool names are currently formatted as servername:toolname (e.g., context7:get-library-docs, memory:create_entities, duckduckgo:search). When the gateway adds prefixes or aggregates tools, these names fail validation because:
- The colon character (
:) is not allowed in the regex pattern^[a-zA-Z0-9_-]{1,64}$ - Dots (
.) used in prefixing also violate the pattern - This prevents the tools from being registered with MCP clients
Expected Behavior
Tool names should be sanitized to replace invalid characters with valid ones:
- Replace
:with_or- - Replace
.with_or-
Example transformations:
context7:get-library-docs→context7_get-library-docsorcontext7-get-library-docsmemory:create_entities→memory_create_entitiesormemory-create-entitiesduckduckgo:search→duckduckgo_searchorduckduckgo-search
Steps to Reproduce
- Enable Docker MCP Toolkit in Docker Desktop
- Install multiple MCP servers from the catalog (e.g., context7, memory, duckduckgo)
- Enable tool prefixes using
docker mcp feature enable tool-name-prefix - Configure Claude Desktop with the following config:
{ "mcpServers": { "MCP_DOCKER": { "command": "docker", "args": ["mcp", "gateway", "run"] } } } - Start Claude Desktop
- Observe the error:
tools.0.FrontendRemoteMcpToolDefinition.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'
Current Tools Affected
When running docker mcp tools ls, the following tools all use the servername:toolname format:
- context7:get-library-docs
- context7:resolve-library-id
- curl:curl
- duckduckgo:fetch_content
- duckduckgo:search
- llmtxt:get_domain_llms_txt_as_docs
- llmtxt:git
- memory:add_observations
- memory:create_entities
- memory:create_relations
- memory:delete_entities
- memory:delete_observations
- memory:delete_relations
- memory:open_nodes
- memory:read_graph
- memory:search_nodes
- sequentialthinking:sequentialthinking
All tools use colons in their names, making them incompatible with the MCP specification when used with certain clients.
Additional Context
- MCP Specification: Tool names must match
^[a-zA-Z0-9_-]{1,64}$ - The issue occurs regardless of whether tool-name-prefix is explicitly enabled or not
- The current naming convention (with colons) is useful for identifying which server a tool belongs to, so any fix should preserve this information while complying with the naming requirements