mcp_protocol
Model Context Protocol (MCP) Implementation
Section titled “Model Context Protocol (MCP) Implementation”Standards-compliant MCP implementation for PromptFleet agents
- JSON-RPC 2.0 wire format (MCP specification requirement)
- HTTP/HTTPS transport with OAuth 2.1 Bearer token support
- FastMCP compatible - interoperable with Python FastMCP and TypeScript MCP SDKs
- External MCP servers - connect to any MCP server via proxy
Compatibility Verified (June 2025)
Section titled “Compatibility Verified (June 2025)”- MCP Specification 2025-06-18 (latest)
- JSON-RPC 2.0 specification compliant
- FastMCP Python implementation compatible
- Standard OAuth 2.1 Bearer token authentication
- HTTP+SSE and Streamable HTTP transport support
Core Features
Section titled “Core Features”- Tool Discovery:
list_toolsmethod - Tool Execution:
call_toolmethod with proper parameter handling - Memory Operations:
add_memory,search_memorymethods - Health Monitoring:
heartbeatand health endpoints - Authentication: Bearer token and custom auth strategies
- Proxy Support: Connect to external MCP servers outside Kubernetes
Constants
Section titled “Constants”MCP_PROTOCOL_VERSION
Section titled “MCP_PROTOCOL_VERSION”const MCP_PROTOCOL_VERSION: &str = ;MCP Protocol Version - Current specification version
JSONRPC_VERSION
Section titled “JSONRPC_VERSION”const JSONRPC_VERSION: &str = ;JSON-RPC Version - Required by MCP specification
Traits
Section titled “Traits”ToolProvider
Section titled “ToolProvider”Tool Provider Trait - Pure abstraction for tool operations
Required / Provided Methods
fn list_tools(&self) -> Result<Vec<Tool>, ProtocolError>List tools from this provider
fn call_tool<'life0, 'life1, 'async_trait>(&self, name: &''life1 str, arguments: Option<serde_json::Value>) -> pin::Pin<Box<dyn future::Future + marker::Send>>where Self: ?Execute tool via this provider
Structs
Section titled “Structs”McpProtocolHandler
Section titled “McpProtocolHandler”MCP Protocol Handler - Integrates with protocol_transport_core
Methods
fn new() -> SelfCreate new MCP protocol handler
with_capabilities
Section titled “with_capabilities”fn with_capabilities(self, capabilities: ServerCapabilities) -> SelfConfigure server capabilities
with_auth_handler
Section titled “with_auth_handler”fn with_auth_handler<H>(self, handler: H) -> SelfConfigure authentication handler
with_tool_provider
Section titled “with_tool_provider”fn with_tool_provider<P>(self, provider: P) -> SelfConfigure tool provider
with_query_mode
Section titled “with_query_mode”fn with_query_mode(self, query_mode: QueryMode) -> SelfConfigure query mode
QueryMode
Section titled “QueryMode”Query Mode - How to handle tool listing
Variants
| Variant | Description |
|---|---|
Single | List tools from single provider (standard MCP behavior) |
Aggregate | Aggregate tools from all providers (special case) |
Functions
Section titled “Functions”create_mcp_handler
Section titled “create_mcp_handler”fn create_mcp_handler() -> McpProtocolHandlerQuick setup function for MCP protocol handler
create_mcp_handler_with_capabilities
Section titled “create_mcp_handler_with_capabilities”fn create_mcp_handler_with_capabilities(capabilities: ServerCapabilities) -> McpProtocolHandlerQuick setup function for MCP protocol handler with custom capabilities