Skip to content

Epistates/TurboMCP

v2.1.2 Breaking

This release includes breaking changes for platform teams planning a safe upgrade.

Published 7mo MCP Developer Tools
✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

mcp mcp-client mcp-sdk mcp-server mcp-servers rust

Summary

AI summary

HTTP request headers are now automatically extracted and accessible in both HTTP and WebSocket handlers.

Full changelog

Bug Fixes & Improvements: WebSocket Unification & Proxy Validation

HTTP Header Extraction (NEW)

HTTP headers are now automatically extracted and accessible in request handlers

  • HTTP request headers are extracted and stored in context metadata as http_headers
  • Headers available through ctx.headers() and ctx.header(name) helper methods
  • Supports all HTTP headers including custom headers (e.g., x-request-id, x-custom-header)
  • Headers accessible in both HTTP and WebSocket transports
  • Added comprehensive tests for header extraction and access patterns

Example Usage:

#[handler]
async fn my_handler(ctx: &mut Context) -> Result<()> {
    // Access all headers
    let headers = ctx.headers();
    
    // Access specific header
    if let Some(user_agent) = ctx.header("user-agent") {
        // Use header value
    }
}

Thanks to scrogson for https://github.com/Epistates/turbomcp/issues/5

WebSocket Unification

Eliminated 146 lines of code and unified WebSocket implementation across layers

  • Moved WebSocket implementation from server layer to transport layer (single source of truth)
  • Created WebSocketDispatcher for bidirectional server-to-client requests
  • Implemented WebSocketFactory pattern for per-connection handlers with configuration
  • Maintains 100% API compatibility - zero breaking changes

Files Improved:

  • turbomcp-transport: Added unified WebSocket infrastructure (210 + 237 = 447 new lines)
  • turbomcp-server: Refactored to use transport layer (100 line adapter, removed 822 line duplicate)
  • Net reduction: 146 lines of duplicate code eliminated

Proxy & Transport Improvements

Fixed hanging integration tests and feature gate compilation issues

  • Fixed 3 proxy integration tests hanging indefinitely (60+ seconds → 0.16s)
  • Properly documented ignored tests with clear justification
  • Fixed feature gate compilation errors when building without websocket feature
  • Updated import paths after WebSocket refactoring
  • All 340+ tests passing with zero regressions

Test Results:

  • turbomcp-server: 183 tests passing (175 lib + 8 config)
  • turbomcp-proxy: 73 tests passing (5 properly ignored)
  • Proxy end-to-end validation: Confirmed working with stdio_server backend

Maintenance & Quality

  • Zero compiler warnings
  • Zero clippy warnings
  • Feature gates working correctly for all feature combinations
  • Production build validated and ready for deployment

Performance Impact

  • Build time: Neutral (8.72s clean workspace build)
  • Test execution: 99%+ faster (hanging tests now properly ignored)
  • Runtime: Neutral to slight improvement (same Axum patterns, fewer allocations)
  • Code quality: -146 lines, improved maintainability

Breaking Changes

None - All public APIs remain 100% compatible


Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track Epistates/TurboMCP

Get notified when new releases ship.

Sign up free

About Epistates/TurboMCP

TurboMCP SDK: Enterprise MCP SDK in Rust

All releases →

Beta — feedback welcome: [email protected]