Expand description
MCP (Model Context Protocol) integration layer.
MCP is a standard protocol for communication between AI agents and tools/data sources. See: Anthropic MCP specification.
This module provides stdio-based communication with MCP servers via JSON-RPC 2.0.
§Protocol Overview
MCP defines several message types:
initialize- Establish connection with capabilities negotiationtools/list- List available tools from a servertools/call- Execute a tool with argumentsresources/list- List available resourcesresources/read- Read a resource by URI
§Architecture
Agent → McpBridge → McpClient (per server)
↓
tokio::process::Command (stdio)
↓
JSON-RPC 2.0 (stdin/stdout)
↓
MCP Server ProcessStructs§
- Client
Info - Client info sent during initialize
- Initialize
Params - Initialize request params
- Initialize
Result - Initialize response from the server
- Mapped
Resource - Resource reference
- McpBridge
- MCP bridge — connects multiple MCP servers to the oxios tool system.
- McpCapabilities
- MCP server capabilities
- McpClient
- Manages a single MCP server process with stdio JSON-RPC communication.
- McpError
- MCP JSON-RPC error structure
- McpRequest
- MCP JSON-RPC request structure
- McpResponse
- MCP JSON-RPC response structure
- McpServer
- MCP server capability definition
- McpTool
- MCP tool definition from a server
- McpTool
Call Result - MCP tools/call result
- McpTools
Result - MCP tools/list result
- Server
Info - Server info from initialize response
Enums§
- McpContent
Block - Content block in a tool call result
Type Aliases§
- McpServer
Config - Type alias for backwards compatibility — use McpServer directly.