Expand description
Async MCP (Model Context Protocol) implementation.
Structs§
- McpAuth
Config - Optional auth block on a remote MCP server (
sse/httptransports). - McpCall
Record - One completed MCP RPC or tool invocation (sanitized for UI).
- McpConfig
- Full MCP configuration from mcp.json
- McpConnection
- McpDiscovered
Item - McpManager
Snapshot - McpPool
- Pool of MCP connections for reuse
- McpPrompt
- Prompt discovered from an MCP server
- McpPrompt
Argument - Argument for an MCP prompt
- McpReload
Report - Summary of an in-place MCP pool reload (config diff + optional reconnect).
- McpResource
- Resource discovered from an MCP server
- McpResource
Template - Resource template discovered from an MCP server
- McpServer
Config - Configuration for a single MCP server
- McpServer
Snapshot - McpTimeouts
- Global timeout configuration
- McpTool
- Tool discovered from an MCP server
Enums§
- Connection
State - State of an MCP connection
- McpTransport
Kind - Which wire transport a server uses. Resolved from the explicit
transport/typeconfig field, falling back to inference fromcommand(stdio) vsurl(SSE, for backward compatibility). - McpWrite
Status
Traits§
Functions§
- add_
server_ config - discover_
manager_ snapshot - extract_
tool_ content - Extract the model-facing content from an MCP
tools/callresult. - format_
tool_ result - Human-readable rendering of a tool result, prefixing
Error:on failure. Preferis_tool_error+extract_tool_contenton 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/callresult signals a tool-level failure via the spec’sisErrorflag. This is distinct from a JSON-RPC protocol error (handled inconnection.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 intomcp.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
truewhen removed,falsewhen 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