Skip to main content

Module mcp

Module mcp 

Source
Expand description

Async MCP (Model Context Protocol) implementation.

Structs§

McpAuthConfig
Optional auth block on a remote MCP server (sse / http transports).
McpCallRecord
One completed MCP RPC or tool invocation (sanitized for UI).
McpConfig
Full MCP configuration from mcp.json
McpConnection
McpDiscoveredItem
McpManagerSnapshot
McpPool
Pool of MCP connections for reuse
McpPrompt
Prompt discovered from an MCP server
McpPromptArgument
Argument for an MCP prompt
McpReloadReport
Summary of an in-place MCP pool reload (config diff + optional reconnect).
McpResource
Resource discovered from an MCP server
McpResourceTemplate
Resource template discovered from an MCP server
McpServerConfig
Configuration for a single MCP server
McpServerSnapshot
McpTimeouts
Global timeout configuration
McpTool
Tool discovered from an MCP server

Enums§

ConnectionState
State of an MCP connection
McpTransportKind
Which wire transport a server uses. Resolved from the explicit transport/type config field, falling back to inference from command (stdio) vs url (SSE, for backward compatibility).
McpWriteStatus

Traits§

McpTransport

Functions§

add_server_config
discover_manager_snapshot
extract_tool_content
Extract the model-facing content from an MCP tools/call result.
format_tool_result
Human-readable rendering of a tool result, prefixing Error: on failure. Prefer is_tool_error + extract_tool_content on execution paths that need to map failures onto a structured error type.
get_server_entry
Load a single server block from mcp.json (for edit UIs).
init_config
is_tool_error
Whether an MCP tools/call result signals a tool-level failure via the spec’s isError flag. This is distinct from a JSON-RPC protocol error (handled in connection.rs): a tool can return a successful RPC response whose payload still represents a failed tool invocation.
load_config
manager_snapshot_from_config
manager_snapshot_from_pool
Build a manager snapshot from a live pool (shared sidecar pool / hot-reload path).
merge_mcp_json_fragment
Merge servers (and optionally timeouts) from a JSON fragment into mcp.json.
merge_preserved_secrets
When the UI saves a server block after a redacted GET, restore secret fields that were omitted (not re-entered by the user).
recent_mcp_calls
Recent MCP calls, newest last (up to [MAX_RECENT_CALLS]).
record_mcp_call
Record a completed MCP operation for the desktop diagnostics panel.
remove_server_config
remove_server_from_config
Remove a server entry and persist. Returns true when removed, false when the name was already absent (idempotent).
replace_server_in_config
Replace an existing server block (full document for that key). Errors if the name is missing.
save_config
set_server_enabled