MCP Tool
The MCP Tool block enables seamless integration with Model Context Protocol (MCP) compatible servers, allowing you to call external tools within your workflows. Leveraging the standardized MCP protocol, this block provides extensible, dynamic tool access for AI-driven applications.
Overview
The Model Context Protocol (MCP) is a standardized framework for connecting AI models to external tools and services. The MCP Tool Block acts as a client, communicating with MCP-compatible servers to discover and execute tools dynamically.
Key Features
- MCP Server Integration: Connect to any MCP-compatible server.
- Dynamic Tool Discovery: Automatically fetch available tools from the server.
- Tool Filtering: Include or exclude specific tools for targeted workflows.
- Custom Headers: Support authentication and custom headers for secure requests.
- Real-Time Tool Loading: Dynamically retrieve tool lists from configured servers.
The MCP Tool Block simplifies integration with external tools, offering dynamic discovery and robust configuration for flexible, AI-enhanced workflows.
Configuration
Basic Settings
- Server URL: The endpoint of your MCP server (e.g.,
http://localhost:3000/mcp). - Server Name: A unique identifier for the server (spaces replaced with underscores).
Tool Selection
After configuring server details, you can:
- Fetch Tool List: Retrieve available tools from the MCP server.
- Include Tools: Select specific tools to make available (mutually exclusive with exclude mode).
- Exclude Tools: Hide specific tools from the available set.
Headers Configuration
Add custom headers for server authentication:
- Authorization: Supports Bearer tokens or API keys.
- Custom Headers: Include additional headers required by the MCP server.
Setup Process
1. Configure Server Connection
Server URL: http://localhost:3000/mcp
Server Name: my_mcp_server2. Add Authentication (if required)
Headers:
Authorization: Bearer your-token
X-API-Key: your-api-key3. Fetch Tool List
Click “Get Tool List” to retrieve available tools from the server.
4. Filter Tools (Optional)
- Include Mode: Only selected tools are available.
Selected Tools: file_read, database_query, image_process - Exclude Mode: All tools except selected ones are available.
Excluded Tools: dangerous_operation, deprecated_tool
Usage Examples
File Processing MCP Server
Server URL: http://files.mcp.local:8080
Server Name: file_processor
Include Tools: read_file, write_file, list_directoryDatabase MCP Server
Server URL: https://db-mcp.company.com/api
Server Name: database_tools
Headers:
Authorization: Bearer db-access-token
Include Tools: execute_query, get_schema, backup_tableAI Tools MCP Server
Server URL: http://ai-tools:3000/mcp
Server Name: ai_utilities
Exclude Tools: experimental_tool, beta_featureMCP Server Requirements
Your MCP server must:
- Adhere to the MCP protocol specification.
- Expose a tool discovery endpoint.
- Return tool definitions in standard MCP format.
- Handle tool execution requests correctly.
Tool Discovery Response
The MCP server should return tools in the following format:
{
"tools": [
{
"name": "file_read",
"description": "Read contents of a file",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File path to read"
}
}
}
}
]
}Node Display
- Configured: Displays server name, hostname/port, and connection status.
- Unconfigured: Shows a “Configure MCP Server...” prompt.
Error Handling
The MCP Tool Block manages:
- Connection Errors: Server timeouts or unreachable endpoints.
- Authentication Errors: Invalid credentials or unauthorized access.
- Protocol Errors: Malformed MCP responses or invalid data.
- Tool Errors: Failures during tool execution or parameter mismatches.
Best Practices
- Test Server Connections: Verify MCP server accessibility before deployment.
- Use Descriptive Names: Choose clear server names for easy identification.
- Filter Tools Wisely: Expose only relevant tools to streamline workflows.
- Secure Authentication: Use appropriate headers for secure server access.
- Monitor Server Health: Ensure the MCP server is stable and responsive.
- Handle Errors Gracefully: Design workflows to manage tool failures effectively.
Troubleshooting
Common Issues
- “No Tools Found”:
- Verify the server URL is correct and accessible.
- Ensure the server is running and responding to requests.
- Check authentication headers for proper configuration.
- “Unable to Connect to MCP Server”:
- Confirm network connectivity and correct server URL/port.
- Check firewall rules to allow the connection.
- Tool Execution Failures:
- Ensure tool parameters match the expected schema.
- Review server logs for detailed error information.
- Verify the MCP server implements tools correctly.
Integration with Workflows
- Incorporate MCP tools into agent-driven workflows.
- Chain multiple MCP tool calls for complex operations.
- Pass results between MCP tools and other workflow blocks.
- Map tool responses to workflow variables for downstream use.
Advanced Configuration
- Load Balancing: Distribute requests across multiple MCP servers.
- Fallback Servers: Configure backup servers for high availability.
- Caching: Cache tool definitions to enhance performance.
- Rate Limiting: Implement backoff strategies to respect server limits.