Expand description
Model Context Protocol server Model Context Protocol (MCP) Server Implementation
This module provides a fully-featured MCP server that integrates with the P2P network, enabling AI agents to discover and call tools across the distributed network.
The implementation includes:
- MCP message routing over P2P transport
- Tool registration and discovery through DHT
- Security and authentication for remote calls
- Service health monitoring and load balancing
Re-exports§
pub use security::*;
Modules§
- security
- MCP Security Module
Structs§
- Function
Tool Handler - Simple function-based tool handler
- MCPAuth
Info - MCP authentication information
- MCPCall
Context - MCP call context
- MCPCapabilities
- MCP capabilities
- MCPClient
Info - MCP client information
- MCPEndpoint
- MCP endpoint information
- MCPLog
Entry - MCP log entry
- MCPLogging
Capability - Logging capability configuration
- MCPPrompt
- MCP prompt definition
- MCPPrompt
Message - MCP prompt message
- MCPPrompts
Capability - Prompts capability configuration
- MCPRequest
- MCP request with routing information
- MCPResource
- MCP resource definition
- MCPResource
Content - MCP resource content
- MCPResource
Reference - MCP resource reference
- MCPResources
Capability - Resources capability configuration
- MCPResponse
- MCP response with metadata
- MCPServer
- Main MCP server implementation
- MCPServer
Config - MCP server configuration
- MCPServer
Info - MCP server information
- MCPServer
Stats - MCP server statistics
- MCPService
- MCP service descriptor for discovery
- MCPService
Metadata - MCP service metadata
- MCPSession
- MCP session information
- MCPTool
- MCP tool definition
- MCPTools
Capability - Tools capability configuration
- P2PMCP
Message - P2P MCP message wrapper for network transmission
- Service
Load Metrics - Service load metrics
- Tool
- MCP tool implementation
- Tool
Builder - Builder for creating tools
- Tool
Metadata - Tool metadata for tracking and optimization
- Tool
Requirements - Tool resource requirements
Enums§
- MCPContent
- MCP content types
- MCPLog
Level - MCP log levels
- MCPMessage
- MCP message types
- MCPRole
- MCP message roles
- MCPSession
State - MCP session state
- P2PMCP
Message Type - P2P MCP message types
- Service
Health Status - Service health status
- Tool
Health Status - Tool health status
Constants§
- DEFAULT_
CALL_ TIMEOUT - Default timeout for MCP calls
- MAX_
MESSAGE_ SIZE - Maximum message size for MCP calls (1MB)
- MCP_
PROTOCOL - MCP protocol identifier for P2P messaging
- MCP_
VERSION - MCP protocol version
- SERVICE_
DISCOVERY_ INTERVAL - Service discovery refresh interval
Traits§
- Tool
Handler - Tool handler trait