Release 1.5.0
We’ve introduced a complete MCP Server SDK, enabling you to build production-ready MCP servers with routing, advanced logging, inspector integration, and multiple transport protocols.
Major Changes
Complete MCP Server SDK
Build powerful MCP servers with a comprehensive SDK that rivals FastMCP while providing unique capabilities for production deployments. Key Components:MCPServer - Production-Ready Server Class
Built on top of FastMCP with significant enhancements for production use:- Multiple transport protocols: stdio, streamable-http, SSE
- Integrated development tools and inspector
- Advanced logging with customizable formats
- Production-ready with signal handling
- FastMCP compatibility layer
MCPRouter - Modular Server Organization
Organize your MCP server into reusable modules, similar to FastAPI’s APIRouter:- Clean separation of concerns
- Reusable modules across projects
- Optional prefixing for namespacing
- Conditional router enabling/disabling
- Support for tools, resources, and prompts
Enhanced Context with Advanced Capabilities
Extended context object with powerful server-side features:sample(): Client-side LLM sampling with model preferenceselicit(): Structured user input with Pydantic or dataclass schemassend_tool_list_changed(): Dynamic tool registration notificationssend_resource_list_changed(): Resource update notificationssend_prompt_list_changed(): Prompt update notificationsget_http_request(): Access underlying HTTP request (streamable-http only)
Advanced Logging System
Production-grade logging with beautiful formatting and debugging tools: Features:- Customizable log formats with color-coded output
- JSON-RPC request/response logging
- Session ID tracking across requests
- Request/response size monitoring
- Configurable debug levels (0=production, 1=debug, 2=verbose)
- Middleware-based architecture for extensibility
Built-in Development Tools
Inspector Integration:- Auto-populated inspector at
/inspector - Real-time tool testing
- Request/response inspection
- Session management
- Auto-generated docs at
/docs - Interactive API explorer
- Tool/resource/prompt documentation
- Standard OpenMCP config at
/openmcp.json - Easy integration with MCP clients
- Auto-discovery support
Multiple Transport Protocols
stdio: Best for local CLI tools and desktop appsstreamable-http: Recommended for web services and cloud deploymentssse: Legacy support (deprecated in favor of streamable-http)
FastMCP Migration Path
Seamless migration from FastMCP with compatibility exports:Enhancements
Middleware Parameter Mutation
Middleware can now modify request parameters, with changes properly propagated:- Middleware parameter modifications are now preserved
context.paramscan be mutated and changes propagate- Improved middleware documentation with examples
Enhanced Sampling & Elicitation
Server-side support for advanced MCP protocols: Sampling:Tool Enable/Disable Support
Dynamic tool management during runtime:Code Quality
Type Checking with Ty
Introduced ty as the official type checker for better type safety:- Strict type checking for improved code quality
- Pre-commit integration with prek
- Configured to ignore certain patterns for flexibility
Pre-commit Hooks with Prek
Standardized pre-commit workflow with prek:- Type checking with ty
- Code formatting with ruff
- Import sorting
- Trailing whitespace removal
Refactored Test Suite
Complete test reorganization for better maintainability: Structure:- Tests now use MCPServer instead of external servers
- Removed dependency on FastMCP test servers
- Better test isolation
- Clearer test organization
Ruff Configuration
Moved Ruff configuration from separate file to pyproject.toml:- Single configuration file
- Consistent with Python ecosystem standards
- Easier project setup
Documentation
New Server Documentation
Comprehensive documentation for the new server SDK:- Server Overview - Introduction and architecture
- Router Guide - Modular server organization
- Logging System - Production logging setup
- Running Servers - Deployment guide
- Inspector Integration - Debugging tools
- FastMCP Migration - Migration guide
- Sampling - Client LLM requests
- Elicitation - Structured user input
- Notifications - Dynamic updates
Updated Examples
New example servers showcasing features:context_example.py- Context features demofastmcp_example.py- FastMCP compatibilityfastmcp2_example.py- Advanced FastMCP patternsfmcp_use_server_example.py- Full-featured server
API Reference
Auto-generated API documentation for all new modules:mcp_use.server.server- MCPServer classmcp_use.server.router- MCPRouter classmcp_use.server.context- Enhanced Contextmcp_use.server.logging- Logging componentsmcp_use.server.runner- Server runnermcp_use.server.types- Type definitionsmcp_use.server.utils- Utility functions
Breaking Changes
None - all changes are backward compatible. Existing client code continues to work without modifications.Migration Guide
Starting a New Server
Migrating from FastMCP
Replace imports and enjoy enhanced features:Organizing with Routers
Split large servers into modules:Enabling Advanced Features
Dependencies
Updated Requirements
New Development Tools
Contributors
Thank you to all contributors who made this release possible:Statistics
- Total Commits: 30+ (Python-specific)
- Files Changed: 106
- Lines Added: 5,818+
- Lines Removed: 4,402+
- New Modules: 15+
- New Examples: 4
- New Documentation Pages: 10+
For full changelog and commit history, see the commit log.