17 releases
Uses new Rust 2024
| new 0.1.18 | Feb 16, 2026 |
|---|---|
| 0.1.17 | Feb 9, 2026 |
| 0.1.14 | Jan 11, 2026 |
| 0.1.3 | Dec 30, 2025 |
#5 in #proxy-protocols
185 downloads per month
Used in 3 crates
38KB
686 lines
MCP Common
MCP Common
Shared types and utilities for MCP proxy components.
Overview
mcp-common provides common functionality shared across mcp-sse-proxy and mcp-streamable-proxy to avoid code duplication.
Features
- Configuration Types:
McpServiceConfig,McpClientConfigfor unified configuration management - Tool Filtering:
ToolFilterfor filtering MCP tools by name or pattern - OpenTelemetry Support: Optional telemetry features for distributed tracing
Feature Flags
telemetry: Basic OpenTelemetry supportotlp: OTLP exporter support (for Jaeger, etc.)
Installation
Add to Cargo.toml:
[dependencies]
mcp-common = { version = "0.1.5", path = "../mcp-common" }
Usage
use mcp_common::{McpServiceConfig, McpClientConfig, ToolFilter};
// Create client configuration
let client_config = McpClientConfig::new("http://localhost:8080/mcp")
.with_headers(vec![("Authorization".to_string(), "Bearer token".to_string())]);
// Create service configuration
let service_config = McpServiceConfig::new("my-service".to_string())
.with_persistent_type();
// Use tool filter
let filter = ToolFilter::new(vec!["tool1".to_string(), "tool2".to_string()]);
Development
# Build
cargo build -p mcp-common
# Test
cargo test -p mcp-common
# With features
cargo build -p mcp-common --features telemetry,otlp
License
MIT OR Apache-2.0
Dependencies
~7–22MB
~196K SLoC