What is MCP?
MCP servers expose tools that agents can use. Examples include:- Filesystem server: Read/write files
- Database server: Query SQL databases
- GitHub server: Manage repositories
- Slack server: Send messages
- Custom servers: Any tool you build
Basic Usage
Transport Types
stdio Transport
Runs the MCP server as a subprocess:HTTP Transport
Connect to remote MCP servers over HTTP:Multiple MCP Servers
Use multiple servers together:Tool Naming
MCP tools are automatically prefixed with the server name:Common MCP Servers
Filesystem
Access local files:SQLite
Query SQLite databases:Composio (Third-party Integrations)
Connect to services like Gmail, Slack, etc:Error Handling
MCP errors are handled like regular tool errors:Lifecycle Management
MCP servers are automatically:- Started when the agent begins processing
- Kept alive during execution
- Cleaned up when the agent completes
Example: File Listing Agent
Best Practices
- Limit permissions: Only grant access to necessary directories/resources
- Use Docker for isolation: Run untrusted servers in containers
- Handle timeouts: MCP operations can be slow; set appropriate timeouts
- Monitor usage: Track which MCP tools are being called
- Secure credentials: Use environment variables for API keys
Next Steps
Tools
Combine MCP with custom tools
Examples
See MCP in action