MCP (Model Context Protocol)
The Model Context Protocol (MCP) is an open standard that enables you to build secure, two-way connections between your data sources and AI-powered tools. Think of MCP as a universal translator that allows AI Agents to seamlessly communicate with any external system such as databases, file systems, web services, and APIs.Overview
MCP servers extend your agent’s capabilities by providing:- External Tool Access - Connect to third-party services and APIs
- Data Source Integration - Access databases, file systems, and cloud storage
- Custom Functionality - Add specialized tools for your specific use cases
- Standardized Interface - Use a consistent protocol for all integrations
- Secure Authentication - Support for OAuth 2.0 and custom headers
How It Works
1. MCP Server Connection
When you add an MCP server to your agent:- Server Registration - The server is registered with your agent configuration
- Tool Discovery - The agent discovers available tools from the MCP server
- Tool Integration - Tools become available to the agent during conversations
- Dynamic Execution - The agent can call these tools as needed
2. Tool Execution Flow
3. Multiple Servers
You can configure multiple MCP servers per agent:- Each server provides its own set of tools
- Tools are prefixed with the server name (e.g.,
sentry_get_errors) - Servers can be enabled or disabled independently
Quick Start
Adding Popular MCP Servers
- Navigate to Agents in the sidebar
- Select or create an agent
- Click Edit to open the agent builder
- Go to the MCP tab
- In the Quick Add Popular Servers section, click on a server tile to add it
Popular Servers
Sentry
Monitor errors and performance issues in your applications.- URL:
https://mcp.sentry.dev/mcp - Transport: HTTP
- Authentication: OAuth 2.0
- Scopes:
org:read project:write team:write event:write
- View error reports
- Monitor performance metrics
- Manage projects and teams
- Track events and issues
Video Tutorial
Watch this video to see how to add and configure MCP servers:Adding Custom MCP Servers
Step 1: Access MCP Configuration
- Navigate to Agents in the sidebar
- Select or create an agent
- Click Edit to open the agent builder
- Go to the MCP tab
- Scroll to the Advanced Configuration section
Step 2: Add New Server
- Click Add Server button
- The server configuration form will appear
Step 3: Configure Server Settings
Server Name
Enter a unique name for your MCP server (e.g.,my-custom-server, weather-api, database-connector).
Best Practices:
- Use lowercase letters and hyphens
- Be descriptive but concise
- Avoid special characters
Transport Type
Select how the agent will communicate with the MCP server: HTTP (streamable_http)- Standard HTTP requests
- Best for REST APIs and web services
- Supports request/response pattern
- Real-time streaming communication
- Best for live data feeds
- Supports one-way server-to-client streaming
Server URL
Enter the endpoint URL for your MCP server: HTTP Examples:https://api.example.com/mcphttp://localhost:8000/mcp/https://mcp.example.com/v1
https://api.example.com/ssehttps://stream.example.com/events
Step 4: Configure Authentication
No Authentication
Select No Authentication if your MCP server doesn’t require authentication.OAuth 2.0
For OAuth-protected servers:- Select OAuth 2.0 as the authentication method
- Enter OAuth Scopes (space-separated)
- Example:
read write admin - Example:
org:read project:write team:write
- Example:
- When a user interacts with the agent, they’ll be prompted to authorize
- Authorization is handled automatically
- Tokens are securely stored and refreshed as needed
Step 5: Custom Headers (Optional)
If your MCP server requires custom HTTP headers:- Click Add Header
- Enter the header name (e.g.,
X-API-Key,Authorization) - Enter the header value
- Add additional headers as needed
X-API-Key:your-api-keyAuthorization:Bearer tokenX-Custom-Header:custom-value
Step 6: Enable/Disable Server
Toggle the Enabled checkbox to control whether the server is active:- Enabled: Server tools are available to the agent
- Disabled: Server tools are hidden but configuration is preserved
Step 7: Test Connection
- Click the Test button to verify the connection
- Wait for the test result:
- Success: Server is reachable and configured correctly
- Error: Check your configuration and network connectivity
Step 8: Save Configuration
- Click Save to store your MCP server configuration
- The server is now available to your agent
Managing MCP Servers
Viewing Configured Servers
In the MCP tab, you can see:- Server Count - Number of configured servers
- Server Status - Enabled/disabled status
- Server Names - List of all configured servers
Editing Server Configuration
- Find the server in the Advanced Configuration section
- Click to expand the server configuration
- Modify any settings
- Click Test to verify changes
- Configuration is saved automatically
Removing Servers
- Find the server you want to remove
- Click the Remove icon (trash can)
- Confirm removal
- The server is removed from your agent configuration
Enabling/Disabling Servers
Toggle the Enabled checkbox for any server:- Enable: Makes server tools available
- Disable: Hides server tools but preserves configuration
- Temporarily disabling problematic servers
- Testing different server configurations
- Managing server availability without removing configuration
Transport Types
HTTP (streamable_http)
Use When:- Connecting to REST APIs
- Standard request/response patterns
- Web services and microservices
- URL should point to the MCP endpoint
- Supports standard HTTP methods
- Works with most web services
SSE (Server-Sent Events)
Use When:- Real-time data streams
- Live updates and notifications
- One-way server-to-client communication
- URL should point to the SSE endpoint
- Server must support SSE protocol
- Automatic reconnection on disconnect
Authentication Methods
No Authentication
Use when your MCP server doesn’t require authentication:- Public APIs
- Internal services
- Development/testing servers
- Select No Authentication
- No additional configuration needed
OAuth 2.0
Use for secure, user-authorized access:- Third-party services (Sentry, Canva, etc.)
- User-specific data access
- Scoped permissions
- Select OAuth 2.0
- Enter OAuth scopes (space-separated)
- Users will authorize on first use
- Sentry:
org:read project:write team:write event:write - Canva:
asset:read asset:write design:read design:write - Custom:
read write admin
- User interacts with agent
- Agent needs MCP tool from OAuth-protected server
- User is prompted to authorize
- Authorization completes automatically
- Token is stored securely
- Future requests use stored token
Custom Headers
Use custom headers for:- API keys
- Custom authentication tokens
- Service-specific headers
- Request metadata
Adding Headers
- In server configuration, find Custom Headers section
- Click Add Header
- Enter header name (e.g.,
X-API-Key) - Enter header value
- Add more headers as needed
Common Header Patterns
API Key:Use Cases
Error Monitoring
Sentry MCP Server Monitor application errors and performance:- “Show me errors from the last 24 hours”
- “What’s the error rate for project X?”
- “List all unresolved issues”
Database Access
Custom Database MCP Server Connect to your database:- “Query the users table”
- “Show me recent orders”
- “Get customer statistics”
File System Access
File System MCP Server Access files and directories:- “List files in the documents folder”
- “Read the config file”
- “Search for files containing ‘error‘“
Real-Time Data Streams
SSE MCP Server Connect to live data feeds:- “Show me live stock prices”
- “Monitor system metrics”
- “Track real-time events”
Best Practices
Server Naming
- Be Descriptive: Use clear, meaningful names
- Use Lowercase: Prefer lowercase with hyphens
- Avoid Special Characters: Stick to letters, numbers, and hyphens
- Be Consistent: Follow a naming convention
sentry-monitoringpostgres-productionweather-api
Server1my_mcp_serverMCP-Server!!!
URL Configuration
- Use HTTPS: Always prefer secure connections
- Include Full Path: Specify the complete endpoint URL
- Test URLs: Verify URLs are accessible before saving
- Document Endpoints: Keep documentation of your endpoints
Authentication
- Use OAuth When Possible: More secure than API keys
- Minimize Scopes: Request only necessary permissions
- Store Securely: Tokens are handled automatically
- Test Authorization: Verify OAuth flow works correctly
Error Handling
- Test Connections: Use the Test button before saving
- Monitor Logs: Check for connection errors
- Handle Failures: Configure fallbacks for critical servers
- Disable Problematic Servers: Temporarily disable if needed
Performance
- Limit Server Count: Too many servers can slow down agents
- Disable Unused Servers: Keep only active servers enabled
- Optimize Headers: Only include necessary custom headers
- Monitor Response Times: Watch for slow MCP server responses
Troubleshooting
Connection Failures
Problem: Test connection fails Possible Causes:- Incorrect URL
- Network connectivity issues
- Server not running
- Firewall blocking connection
- Verify URL is correct and accessible
- Check network connectivity
- Ensure server is running
- Review firewall rules
Authentication Errors
Problem: OAuth authentication fails Possible Causes:- Incorrect OAuth scopes
- Server doesn’t support OAuth
- User hasn’t authorized
- Token expired
- Verify OAuth scopes are correct
- Check server OAuth documentation
- Re-authorize the connection
- Check token expiration settings
Tools Not Available
Problem: MCP server tools don’t appear Possible Causes:- Server is disabled
- Connection not established
- Server not responding
- Tool discovery failed
- Enable the server
- Test the connection
- Verify server is running
- Check server logs
Timeout Errors
Problem: Requests timeout Possible Causes:- Slow server response
- Network latency
- Server overloaded
- Incorrect timeout settings
- Check server performance
- Verify network speed
- Reduce server load
- Adjust timeout settings if configurable
Testing MCP Servers
Test Connection
- Configure your MCP server
- Click the Test button
- Wait for results:
- Success: Green indicator with success message
- Error: Red indicator with error details
Test Results
Success Indicators:- Connection successful message
- Server responding correctly
- Authentication working (if applicable)
- Connection timeout
- Authentication failed
- Invalid URL
- Server not responding
Interpreting Results
Success:Security Considerations
OAuth Security
- Token Storage: Tokens are stored securely
- Token Refresh: Automatic token refresh when expired
- Scope Limitation: Request minimum necessary scopes
- User Authorization: Users must explicitly authorize
Custom Headers
- Sensitive Data: Don’t put sensitive data in headers if avoidable
- API Keys: Use OAuth when possible instead of API keys
- Header Visibility: Headers are stored in configuration
- Access Control: Limit who can view/edit MCP configurations
Network Security
- HTTPS Only: Always use HTTPS for production servers
- Internal Networks: Use internal URLs for private servers
- Firewall Rules: Configure firewalls appropriately
- VPN Access: Use VPN for secure connections when needed
Examples
Example 1: Sentry Integration
Configuration:- Agent can monitor errors
- View performance metrics
- Manage Sentry projects
Example 2: Custom API Integration
Configuration:- Agent can call custom API endpoints
- Access protected resources
- Use custom headers for identification
Example 3: Internal Service
Configuration:- Agent can access internal services
- No OAuth required
- Custom header for internal authentication
Related Features
- Toolkits - Built-in integrations and tools
- Tools - Custom tools and actions
- Agent Configuration - Configure agent behavior
- API Integration - Connect to external APIs
Toolkits
Learn about built-in toolkits and integrations

