What is MCP?
MCP (Model Context Protocol) is an open protocol for connecting AI agents to external tools and data sources. It provides a standardized way to:- Expose tools that agents can call
- Provide context and data to agents
- Enable custom integrations with any service
Setup
Prepare MCP Server
Ensure your MCP server is running and accessible:
- Supports Server-Sent Events (SSE) transport
- Has a publicly accessible endpoint (or VPN access)
- Returns proper MCP protocol responses
Configure Basic Info
Enter connection details:
- Name: Descriptive name for the connection
- Prefix: Tool prefix (e.g.,
mytools→mytools_function_name)
Configure Transport
Set up the connection transport:
- Transport Type: Server-Sent Events
- URL: Your MCP server endpoint
- Timeout: Connection timeout (default: 5 seconds)
- SSE Read Timeout: Event stream timeout (default: 30 seconds)
Add Environment Variables
Configure any required environment variables:
- API keys
- Authentication tokens
- Custom configuration
Configuration Options
| Field | Description | Required |
|---|---|---|
| Name | Connection display name | Yes |
| Prefix | Tool name prefix | Yes |
| URL | MCP server endpoint | Yes |
| Timeout | Connection timeout (seconds) | No (default: 5) |
| SSE Read Timeout | Event stream timeout (seconds) | No (default: 30) |
| Environment Variables | Key-value pairs for configuration | No |
Example MCP Server
A simple MCP server that provides a weather lookup tool:weather, agents can call:
Use Cases
Custom Data Sources
Connect proprietary databases or APIs:- Internal metrics systems
- Custom monitoring tools
- Business intelligence platforms
Specialized Tools
Add domain-specific capabilities:- Custom compliance checks
- Internal automation scripts
- Legacy system integrations
External Services
Integrate third-party services:- Communication platforms
- Ticketing systems
- Cloud services not built-in
Best Practices
Security
- Use HTTPS endpoints
- Rotate API keys regularly
- Implement proper authentication
- Limit tool permissions
Reliability
- Set appropriate timeouts
- Implement retry logic
- Monitor server health
- Handle errors gracefully
Troubleshooting
Connection timeout
Connection timeout
- Verify MCP server is running
- Check network connectivity
- Increase timeout values
- Confirm firewall allows traffic
Tool not appearing
Tool not appearing
- Verify prefix is set correctly
- Check MCP server returns tool definitions
- Ensure protocol version is compatible
- Review server logs for errors
Authentication errors
Authentication errors
- Verify environment variables are set
- Check API keys are valid
- Ensure server validates credentials correctly
SSE connection drops
SSE connection drops
- Increase SSE read timeout
- Check for proxy interference
- Verify server sends keepalive events
- Review network stability
Related
Overview
All connection types
Agents
How agents use connections