Overview
MCP enables PicoClaw to:- Connect to external MCP servers
- Use tools provided by MCP servers
- Access external data sources and APIs
- Integrate with third-party services
How MCP Works
Configuration
Add MCP server configuration to~/.picoclaw/config.json:
Server Configuration
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Command to execute MCP server |
args | array | No | Arguments for the command |
env | object | No | Environment variables for the server |
enabled | boolean | No | Enable/disable the server (default: true) |
Available MCP Servers
MCP has a growing ecosystem of official and community servers:Official Servers
Filesystem
Read and manipulate local files.GitHub
Interact with GitHub repositories, issues, and PRs.PostgreSQL
Query and manage PostgreSQL databases.Google Drive
Access Google Drive files.Slack
Interact with Slack workspaces.Finding More Servers
Browse available MCP servers:Using MCP Tools
Once MCP servers are configured, their tools are automatically available to the agent.Tool Discovery
The agent sees MCP tools with themcp_ prefix:
Tool Naming Convention
MCP tools are named:mcp_github_create_issue- GitHub server’s “create_issue” toolmcp_filesystem_read_file- Filesystem server’s “read_file” toolmcp_postgres_query- Postgres server’s “query” tool
Name Sanitization
Tool names are sanitized for compatibility:- Converted to lowercase
- Special characters replaced with underscores
- Limited to 64 characters (OpenAI API limit)
- Hash appended if sanitization is lossy
My-Tool!→my_toolVery Long Tool Name With Spaces→very_long_tool_name_with_spacesTool@#$%Name→tool_name_12ab34cd(hash appended)
Automatic Usage
The agent uses MCP tools automatically: Example 1: GitHub IntegrationImplementation Details
MCPTool Wrapper
Each MCP tool is wrapped to implement PicoClaw’sTool interface:
Tool Execution Flow
- Agent calls MCP tool via name (e.g.,
mcp_github_create_issue) - MCPTool wrapper forwards to MCP Manager
- MCP Manager communicates with external server
- Server executes tool and returns result
- Result wrapped in ToolResult and returned to agent
Error Handling
MCP tool errors are properly handled:- Connection failures
- Server not responding
- Tool execution errors
- Invalid parameters
Content Types
MCP tools can return different content types:- Text: Plain text responses
- Images: Image data with MIME type
- Other: Custom content types
Security Considerations
Server Trust
Only configure MCP servers from trusted sources:- Official MCP servers from Model Context Protocol
- Well-maintained community servers
- Servers you’ve audited yourself
Credential Management
Never commit credentials to config files: ❌ Bad:Workspace Restrictions
MCP tools respect PicoClaw’s workspace restrictions:- If
restrict_to_workspace: true, tools are sandboxed - External servers may have their own access controls
- Review server permissions before enabling
Creating Custom MCP Servers
You can create custom MCP servers for your specific needs.Example: Custom Weather Server
Register Custom Server
Troubleshooting
Server Not Starting
- Check command is available:
- Test server manually:
- Check logs:
Tools Not Appearing
- Verify server is enabled:
-
Check server configuration:
- Command path correct
- Arguments properly formatted
- Environment variables set
- Restart gateway:
Authentication Errors
-
Verify credentials:
- API tokens are valid
- Environment variables are set
- Credentials have necessary permissions
-
Check token format:
- GitHub:
ghp_... - Slack:
xoxb-...
- GitHub:
Tool Execution Fails
-
Check tool parameters:
- Review required parameters
- Verify parameter types
- Check parameter constraints
-
Test tool independently:
- Use MCP inspector/debugger
- Call tool directly from server
MCP Resources
Documentation
Tools & Utilities
- MCP Inspector - Debug MCP servers
- MCP Python SDK
- MCP TypeScript SDK
Related Features
- Skills System - Custom instruction sets
- Web Search - Built-in web search providers
- Tools Reference - All available tools