The A2A Client MCP Server acts as a bridge between Large Language Models (LLMs) and Agent-to-Agent (A2A) compatible agents through the Model Context Protocol (MCP). This server enables LLMs to send tasks, receive responses, and manage interactions with A2A agents in a structured way.
You can install the A2A Client MCP Server globally or run it directly using npx:
# Install globally
npm install -g a2a-client-mcp-server
# Or run directly with npx
npx a2a-client-mcp-server
The server can be configured using the following environment variables:
A2A_ENDPOINT_URL
: URL of the A2A agent to connect to (default: "http://localhost:41241")Add this configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"a2a-client": {
"command": "npx",
"args": ["-y", "a2a-client-mcp-server"],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}
First, build the Docker image:
docker build -t a2a-client-mcp-server .
Then configure Claude Desktop:
{
"mcpServers": {
"a2a-client": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"A2A_ENDPOINT_URL",
"a2a-client-mcp-server"
],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}
The server provides several tools for interacting with A2A agents:
Send a task to an A2A agent:
message
(string): Message to send to the agenttaskId
(string, optional): Task ID (generated if not provided)Get the current state of a task:
taskId
(string): ID of the task to retrieveCancel a running task:
taskId
(string): ID of the task to cancelSend a task and subscribe to updates (streaming):
message
(string): Message to send to the agenttaskId
(string, optional): Task ID (generated if not provided)maxUpdates
(number, optional): Maximum updates to receive (default: 10)Get information about the connected A2A agent:
The server provides access to two MCP resources:
a2a://agent-card
: Information about the connected A2A agenta2a://tasks
: List of recent A2A tasksThis example demonstrates how to use the A2A Client MCP Server to interact with a Coder Agent:
First, let me explore what A2A agent we're connected to.
I'll use the a2a_agent_info tool to check the agent details.
The agent provides a coding service that can generate files based on natural language instructions. Let's create a simple Python script.
I'll use the a2a_send_task tool to send a request:
Task: "Create a Python function that calculates the Fibonacci sequence"
Now I can check the task status using a2a_get_task with the task ID from the previous response.
The agent has created the requested Python code. I can now retrieve and use this code in my project.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "a2a-client" '{"command":"npx","args":["-y","a2a-client-mcp-server"],"env":{"A2A_ENDPOINT_URL":"http://localhost:41241"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"a2a-client": {
"command": "npx",
"args": [
"-y",
"a2a-client-mcp-server"
],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"a2a-client": {
"command": "npx",
"args": [
"-y",
"a2a-client-mcp-server"
],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect