Overview
Model Context Protocol is a standard for connecting AI agents to tools and data sources. MCP servers expose capabilities (tools) that agents can call during execution. Example: An HTTP MCP server lets agents make API requests, a File System MCP server enables file operations, and a Database MCP server allows SQL queries.Available MCP Servers
HTTP Client
Make HTTP requests to external APIs. Capabilities:- GET, POST, PUT, DELETE, PATCH requests
- Custom headers and authentication
- Request body formatting
- Response parsing
- Call REST APIs
- Fetch data from web services
- Send webhooks
- Integrate with third-party services
File System (Coming Soon)
Read and write files. Capabilities:- Read file contents
- Write new files
- List directories
- Check file existence
- Get file metadata
- Process uploaded files
- Generate reports and save to storage
- Read configuration files
- Log data to files
Database (Coming Soon)
Execute SQL queries. Capabilities:- SELECT queries
- INSERT, UPDATE, DELETE statements
- Transaction support
- Multiple database support (PostgreSQL, MySQL, SQLite)
- Query application data
- Generate reports from database
- Update records based on rules
- Data analysis and aggregation
Custom MCP Servers
Deploy your own MCP servers for custom tools.Configuring MCP Servers
Configure Connection
Enter server URL and any required authentication:
- Server URL: The MCP server endpoint
- Auth Headers: Authentication tokens if needed
Using MCP Tools in Agents
Instructing the Agent
Tell the agent about available tools in the system prompt:Tool Call Example
Agent decides to use a tool:Building Custom MCP Servers
Create your own tools by implementing an MCP server:MCP Server Requirements
Your server must:- Accept Tool Call Requests: POST requests with tool name and parameters
- Execute Tool Logic: Perform the requested action
- Return Results: JSON response with output
- Handle Errors: Return error messages when things fail
Example MCP Server (Node.js)
Registering Custom MCP Server
Deploy Your Server
Host your MCP server at a public URL (e.g., https://your-mcp-server.com).
Document Your Tools
Create documentation for each tool describing:
- Tool name
- Required parameters
- Return format
- Example usage
Tool Call Format
MCP servers receive tool calls in this format:Security Considerations
Authentication
Secure your MCP server with API keys or tokens
Input Validation
Validate all parameters before execution
Rate Limiting
Implement rate limits to prevent abuse
Audit Logging
Log all tool calls for security review
Securing Custom MCP Servers
Authentication:Best Practices
Start with built-in MCP servers before building custom ones. Only create custom servers when you need capabilities not available in standard tools.
Tool Design
Do:- Create focused tools (one tool = one capability)
- Use clear, descriptive tool names
- Validate all inputs
- Return structured, parseable output
- Include error messages when things fail
- Create overly complex tools
- Return unstructured text
- Skip input validation
- Expose dangerous operations without auth
- Leave errors unhandled
Agent Instructions
Clear Documentation:Troubleshooting
Tool Not Being Called
Possible Causes:- Agent doesn’t know about the tool (add to system prompt)
- Instructions are unclear about when to use it
- Agent decided tool wasn’t needed
- Explicitly mention tool in system prompt
- Provide examples of tool usage
- Make task require the tool
Tool Call Fails
Check:- MCP server URL is correct
- Server is running and accessible
- Authentication is configured
- Parameters are valid
- Review MCP server logs
Wrong Parameters Sent
Possible Causes:- Agent misunderstood parameter requirements
- System prompt lacks detail
- Clearly document required parameters
- Provide examples in system prompt
- Validate parameters in MCP server
Next Steps
Getting Started
Create your first agent with tools
Callbacks
Receive agent loop results