MCP (Model Control Protocol) & Experimental ToolRouter
Composio now introduces comprehensive MCP (Model Control Protocol) support and an experimental ToolRouter for creating isolated, scoped sessions with advanced toolkit management. These features enable seamless integration with modern AI frameworks and provide powerful session-based tool routing capabilities.
Why Use MCP & ToolRouter?
- Framework Integration: Native MCP support for Vercel AI, Mastra, OpenAI Agents, and LangChain
- Session Isolation: Create isolated sessions with specific toolkit configurations
- Advanced Authentication: Flexible auth config management per toolkit
- Scoped Access: Control which tools are available within each session
- Multi-Service Workflows: Route tool calls efficiently across different services
- Development & Testing: Perfect for testing and development with scoped MCP server access
TypeScript SDK (v0.1.53)
Added: MCP API
Core MCP Features:
- MCP Server Creation: Create and manage MCP server configurations
- User-Specific URLs: Generate unique MCP server URLs for individual users
- Toolkit Configuration: Support for multiple toolkits with custom auth configs
- Tool Filtering: Specify allowed tools per configuration
- Connection Management: Choose between manual and automatic account management
Basic Usage:
Framework Integration Examples:
Added: Experimental ToolRouter
Core ToolRouter Features:
- Session-Based Routing: Create isolated sessions for specific users and toolkit combinations
- Dynamic Configuration: Configure toolkits and auth configs per session
- MCP Server URLs: Each session gets a unique MCP server endpoint
- Flexible Toolkit Management: Support for string names or detailed toolkit configurations
- Connection Control: Manual or automatic connection management per session
Basic Usage:
Advanced Multi-Service Integration:
Framework-Specific Examples:
Python SDK (v0.8.12)
Added: MCP Support
Core MCP Features:
- Server Configuration: Create and manage MCP server configurations
- Toolkit Management: Support for both simple toolkit names and detailed configurations
- Authentication Control: Per-toolkit auth config specification
- Tool Filtering: Specify allowed tools across all toolkits
- User Instance Generation: Generate user-specific MCP server instances
Basic Usage:
Simple Toolkit Usage:
LangChain Integration:
Migration Guide
TypeScript SDK: Migrating to New MCP API
The new MCP API provides enhanced functionality and better integration patterns. Here’s how to migrate from the previous MCP implementation:
Before (Legacy MCP)
After (New MCP API)
Key Migration Changes
-
Two-Step Process:
- Before: Single step server creation
- After: Create configuration, then generate user instances
-
Enhanced Configuration:
- Before: Simple toolkit names only
- After: Detailed toolkit configs with auth, tool filtering, connection management
-
User-Specific URLs:
- Before: Single server URL for all users
- After: Unique URLs per user for better isolation
-
Backward Compatibility:
- Legacy Access: Old MCP functionality remains available via
composio.deprecated.mcp
- Gradual Migration: Migrate at your own pace without breaking existing implementations
- Legacy Access: Old MCP functionality remains available via
Migration Benefits
- Better Security: User-specific sessions with isolated access
- Enhanced Control: Fine-grained toolkit and tool management
- Framework Integration: Native support for modern AI frameworks
- Scalability: Better resource management and user isolation
Migration Timeline
- Phase 1: New MCP API available alongside legacy implementation
- Phase 2: Legacy MCP accessible via
deprecated.mcp
namespace - Phase 3: Full deprecation (timeline to be announced)
Recommendation: Start new projects with the new MCP API and gradually migrate existing implementations to benefit from enhanced features and better framework integration.
Key Benefits & Use Cases
Development & Testing
- Isolated Environments: Test different toolkit combinations without affecting production
- Scoped Access: Limit tool access for security and testing purposes
- Framework Flexibility: Works with any MCP-compatible client or framework
Production Workflows
- Multi-Service Integration: Seamlessly combine tools from different services
- User-Specific Sessions: Each user gets their own isolated session with appropriate permissions
- Authentication Management: Fine-grained control over authentication per toolkit
Framework Compatibility
- Vercel AI: Native integration with Vercel AI SDK
- Mastra: Full support for Mastra agents and workflows
- OpenAI Agents: Direct integration with OpenAI’s agent framework
- LangChain: Complete LangGraph and LangChain compatibility
- Custom Clients: Works with any MCP-compatible client
Enterprise Features
- Session Management: Track and manage multiple user sessions
- Resource Control: Limit concurrent sessions and resource usage
- Audit Trail: Full logging and monitoring of tool usage
- Security: Isolated sessions prevent cross-user data access
Migration & Compatibility
Both MCP and ToolRouter features are designed to complement existing Composio functionality:
The experimental ToolRouter API provides a preview of advanced session management capabilities, while the MCP API offers production-ready Model Control Protocol support for modern AI frameworks.
Bug Fixes
Fixed: Missing Descriptions in Auth Config Fields
Python SDK (v0.8.12) & TypeScript SDK (v0.1.53)
Issue Fixed:
- Auth Config Connection Fields: Added missing descriptions to toolkit auth configuration connection fields
- Auth Config Creation Fields: Added missing descriptions to toolkit auth configuration creation fields
- Field Documentation: Improved field documentation and help text for better developer experience
Details: Previously, when developers were setting up auth configurations for toolkits, many fields lacked proper descriptions, making it difficult to understand what information was required. This fix ensures all auth config fields now include:
- Clear, descriptive field labels
- Helpful placeholder text where appropriate
- Detailed explanations of field requirements
This improvement affects all toolkits and makes the authentication setup process more intuitive and error-free.