Skip to main content

Module mcp

Module mcp 

Source
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 negotiation
  • tools/list - List available tools from a server
  • tools/call - Execute a tool with arguments
  • resources/list - List available resources
  • resources/read - Read a resource by URI

§Architecture

Agent → McpBridge → McpClient (per server)
                        ↓
             tokio::process::Command (stdio)
                        ↓
             JSON-RPC 2.0 (stdin/stdout)
                        ↓
             MCP Server Process

Structs§

ClientInfo
Client info sent during initialize
InitializeParams
Initialize request params
InitializeResult
Initialize response from the server
MappedResource
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
McpToolCallResult
MCP tools/call result
McpToolsResult
MCP tools/list result
ServerInfo
Server info from initialize response

Enums§

McpContentBlock
Content block in a tool call result

Type Aliases§

McpServerConfig
Type alias for backwards compatibility — use McpServer directly.