mcp command starts a Model Context Protocol (MCP) server that exposes Handler’s A2A functionality as MCP tools and resources. This allows MCP-compatible clients like Claude Desktop, Cursor, and other AI assistants to interact with A2A agents.
Options
Transport protocol to use. Options:
stdio, sse, streamable-http. Default: stdioShort form: -tTransport Types
- stdio: Standard input/output (recommended for most MCP clients)
- sse: Server-Sent Events
- streamable-http: HTTP streaming
Examples
Available Tools
The MCP server exposes the following categories of tools:Card Tools
Validate an agent card from URL or fileParameters:
source(string): URL or file path to validate
Retrieve an agent’s full card detailsParameters:
agent_url(string): Agent URLauthenticated(boolean, optional): Request authenticated card
Message Tools
Send messages to agents with session and auth supportParameters:
agent_url(string): Agent URLtext(string): Message textstream(boolean, optional): Enable streamingcontext_id(string, optional): Context IDtask_id(string, optional): Task IDuse_session(boolean, optional): Continue from saved sessionpush_url(string, optional): Webhook URLpush_token(string, optional): Webhook tokenbearer_token(string, optional): Bearer authapi_key(string, optional): API key auth
Task Tools
Get task status and detailsParameters:
agent_url(string): Agent URLtask_id(string): Task IDhistory_length(integer, optional): Number of history messagesbearer_token(string, optional): Bearer authapi_key(string, optional): API key auth
Cancel a running taskParameters:
agent_url(string): Agent URLtask_id(string): Task IDbearer_token(string, optional): Bearer authapi_key(string, optional): API key auth
Configure push notification webhooksParameters:
agent_url(string): Agent URLtask_id(string): Task IDurl(string): Webhook URLtoken(string, optional): Webhook tokenbearer_token(string, optional): Bearer authapi_key(string, optional): API key auth
Get push notification configParameters:
agent_url(string): Agent URLtask_id(string): Task IDconfig_id(string, optional): Config IDbearer_token(string, optional): Bearer authapi_key(string, optional): API key auth
Session Tools
List all saved sessionsParameters: None
Get session for a specific agentParameters:
agent_url(string): Agent URL
Clear saved session stateParameters:
agent_url(string, optional): Agent URL (omit to clear all)
Auth Tools
Save bearer token or API key for an agentParameters:
agent_url(string): Agent URLbearer_token(string, optional): Bearer tokenapi_key(string, optional): API keyapi_key_header(string, optional): Header name for API key (default: X-API-Key)
Remove saved credentialsParameters:
agent_url(string): Agent URL
MCP Client Configuration
Claude Desktop
Add Handler to your Claude Desktop configuration (claude_desktop_config.json):
claude_desktop_config.json
Configuration File Locations
Custom Transport
To use a different transport:claude_desktop_config.json
Usage in MCP Clients
Once configured, you can interact with A2A agents through your MCP client: Example prompts in Claude Desktop:- “Use the send_message tool to ask the agent at http://localhost:8000 what the weather is like”
- “Get the agent card from http://localhost:8000”
- “List all my saved sessions”
- “Cancel task task_abc123 at http://localhost:8000”
- “Set credentials for http://localhost:8000 with bearer token xyz”
The MCP server uses Handler’s session and credential management, so sessions and credentials set through MCP tools are shared with CLI commands and vice versa.
Debugging
To debug MCP server issues:- Check Claude Desktop logs (Help → Developer Tools)
- Verify Handler is installed and accessible in your PATH
- Test the command manually:
handler mcpshould start without errors - Check permissions on the configuration file