A2AMCP is a Redis-backed Model Context Protocol (MCP) server that enables AI agents to communicate and collaborate in real-time while working on the same project. It solves the critical problem of isolated AI agents working on the same codebase without awareness of each other's changes, preventing conflicts and enabling seamless coordination.
# Clone the repository
git clone https://github.com/webdevtodayjason/A2AMCP
cd A2AMCP
# Start the server
docker-compose up -d
# Verify it's running
docker ps | grep splitmind
# Test the connection
python verify_mcp.py
services:
mcp-server:
build: .
container_name: splitmind-mcp-server
ports:
- "5050:5000" # Changed from 5000 to avoid conflicts
environment:
- REDIS_URL=redis://redis:6379
- LOG_LEVEL=INFO
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: splitmind-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
redis-data:
driver: local
pip install a2amcp-sdk
# Add the MCP server using Claude Code CLI
claude mcp add splitmind-a2amcp \
-e REDIS_URL=redis://localhost:6379 \
-- docker exec -i splitmind-mcp-server python /app/mcp-server-redis.py
Add to your configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"splitmind-a2amcp": {
"command": "docker",
"args": ["exec", "-i", "splitmind-mcp-server", "python", "/app/mcp-server-redis.py"],
"env": {
"REDIS_URL": "redis://redis:6379"
}
}
}
}
from a2amcp import A2AMCPClient, Project, Agent
async def run_agent():
client = A2AMCPClient("localhost:5000")
project = Project(client, "my-app")
async with Agent(project, "001", "feature/auth", "Build authentication") as agent:
# Agent automatically registers and maintains heartbeat
# Coordinate file access
async with agent.files.coordinate("src/models/user.ts") as file:
# File is locked, safe to modify
pass
# File automatically released
# Share interfaces
await project.interfaces.register(
agent.session_name,
"User",
"interface User { id: string; email: string; }"
)
# Register agent
register_agent("my-project", "task-001", "001", "feature/auth", "Building authentication")
# Query another agent
query_agent("my-project", "task-001", "task-002", "interface", "What's the User schema?")
# Share interface
register_interface("my-project", "task-001", "User", "interface User {...}")
mcp__splitmind-a2amcp__
toolsdocker ps | grep splitmind
curl http://localhost:5050/health
python verify_mcp.py
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "splitmind-a2amcp" '{"command":"docker","args":["exec","-i","splitmind-mcp-server","python","/app/mcp-server-redis.py"],"env":{"REDIS_URL":"redis://redis:6379"}}'
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": {
"splitmind-a2amcp": {
"command": "docker",
"args": [
"exec",
"-i",
"splitmind-mcp-server",
"python",
"/app/mcp-server-redis.py"
],
"env": {
"REDIS_URL": "redis://redis:6379"
}
}
}
}
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": {
"splitmind-a2amcp": {
"command": "docker",
"args": [
"exec",
"-i",
"splitmind-mcp-server",
"python",
"/app/mcp-server-redis.py"
],
"env": {
"REDIS_URL": "redis://redis:6379"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect