Skip to main content

Module mcp_naming

Module mcp_naming 

Source
Expand description

MCP wire-name encoding: mcp__<server>__<tool>.

Single source of truth for the wire-name contract shared by the agent runtime (tool registry) and mur-core (per-tool policy patterns).

The LLM tool-name field must match ^[a-zA-Z0-9_-]{1,64}$. Server names are sanitised by collapsing non-alphanumeric/dash chars into _.

Functions§

sanitize_server
Sanitise an MCP server name so it’s safe to embed in a wire name.
tool_pattern
Prefix-glob ToolRule pattern matching every tool of server (sanitises first): mcp__<server>__*. Feed to mur_common::agent::resolve_tool_policy / ToolRule.pattern.
wire_name
Encode a server + tool name into the mcp__<server>__<tool> wire format.