Overview
MCP (Model Context Protocol) tools allow agents to connect to external services through standardized protocols. Kortix supports multiple MCP server types:- Composio: Pre-built integrations (Gmail, Slack, GitHub, etc.)
- Custom HTTP: Custom MCP servers over HTTP
- Custom SSE: Custom MCP servers using Server-Sent Events
- Custom JSON/stdio: Local MCP servers via stdin/stdout
Get Agent Custom MCP Tools
Authentication
Requires JWT authentication via theAuthorization header.
Path Parameters
string
required
The unique identifier of the agent
Headers
string
required
The URL of the MCP server (for HTTP/SSE) or Composio profile ID
string
default:"sse"
The MCP server type:
http, sse, or composiostring
Optional JSON string of custom headers for the MCP server
Response
array
Array of discovered tools from the MCP server
boolean
Whether this MCP server is already configured for the agent
string
The type of MCP server (http, sse, composio)
string
The MCP server URL or identifier
Example Request
Example Response
Update Agent Custom MCP Tools
Authentication
Requires JWT authentication.Path Parameters
string
required
The unique identifier of the agent
Request Body
string
required
The MCP server URL or Composio profile ID
string
default:"sse"
The MCP server type:
http, sse, or composioarray
required
Array of tool names to enable
Response
boolean
Whether the operation succeeded
array
Array of tool names that are now enabled
integer
Total number of enabled tools
Example Request
Example Response
Update Agent Custom MCPs
Authentication
Requires JWT authentication.Path Parameters
string
required
The unique identifier of the agent
Request Body
array
required
Array of MCP configuration objects
Response
boolean
Whether the operation succeeded
object
Example Request
Example Response
MCP Server Types
HTTP MCP Servers
HTTP-based MCP servers use streamable HTTP for communication:SSE MCP Servers
Server-Sent Events based MCP servers:Composio Integrations
Pre-built integrations via Composio:JSON/stdio MCP Servers
Local MCP servers via stdin/stdout:Error Responses
error
MCP integrations not enabled
error
Worker not found
error
Invalid request (missing URL, invalid config, etc.)
error
Custom worker limit exceeded
error
Internal server error
MCP Tool Execution
MCP tools are executed using ephemeral connections:- Discovery: Tool schemas are cached in Redis (24-hour TTL)
- Activation: Tools are activated on first use (JIT loading)
- Execution: Each call creates a fresh connection to the MCP server
- Result: Connection is closed immediately after execution
Schema Caching
MCP tool schemas are cached for performance:- Cache Key:
mcp_schema:{toolkit_slug} - TTL: 24 hours
- Storage: Redis
- Invalidation: Automatic on TTL expiry or manual via registry methods
Security Considerations
URL Validation
In production environments, private/local URLs are blocked:- Localhost addresses (127.0.0.1, ::1)
- Private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
- Link-local addresses (169.254.0.0/16)
Authentication
- Composio: Authentication handled via profile configuration
- Custom MCPs: Use custom headers for API keys/tokens
- Private MCPs: Deploy behind authentication gateway
Best Practices
- Test MCP servers: Use the discovery endpoint before enabling tools
- Enable selectively: Only enable tools your agent needs
- Monitor usage: Track which tools are being called
- Update regularly: Keep MCP configurations in sync with server changes
- Handle failures: MCP servers may be temporarily unavailable
- Cache schemas: Let the system cache schemas for performance
- Version agents: Use agent versions when changing MCP configurations
Rate Limits
MCP tool endpoints respect the following limits:- Discovery: Max 30 seconds timeout per server
- Execution: Max 30 seconds timeout per tool call
- Custom MCPs: Limited by subscription tier (check plan limits)
- Connection pool: Ephemeral connections prevent pool exhaustion