turbomcp-grpc
High-performance gRPC transport for the Model Context Protocol (MCP).
Features
- Server: Full gRPC server implementation with streaming notifications
- Client: gRPC client with automatic initialization and reconnection
- Tower Integration: Composable middleware via Tower layers
- TLS: Optional TLS 1.3 support via rustls
- Streaming: Server-streaming for real-time notifications
Installation
Add to your Cargo.toml:
[]
= "3.0.0-alpha.1"
Quick Start
Server
use McpGrpcServer;
use Tool;
async
Client
use McpGrpcClient;
async
Protocol Definition
The gRPC service is defined in src/proto/mcp.proto and includes:
Initialize- Session initializationPing- Health checkListTools/CallTool- Tool operationsListResources/ReadResource- Resource operationsListPrompts/GetPrompt- Prompt operationsSubscribe- Streaming notificationsComplete- Autocomplete suggestionsSetLoggingLevel- Logging configuration
Tower Integration
Use with Tower layers for composable middleware:
use McpGrpcLayer;
use ServiceBuilder;
let layer = new
.timeout
.logging
.timing;
let service = new
.layer
.service;
Features
server(default) - Enable server implementationclient(default) - Enable client implementationhealth- Enable gRPC health checking servicereflection- Enable gRPC reflection for debuggingtls- Enable TLS support
License
MIT