This project demonstrates how to build a multi-agent system using Agent-to-Agent (A2A) communication with the Model Context Protocol (MCP).
This workshop demonstrates a multi-agent system with:
The repository contains:
The local agents connect to external services via the Model Context Protocol (MCP), while the remote Bench agent is accessed via A2A protocol over HTTP. This demonstrates a hybrid architecture where some agents run in your local environment while others can be accessed as remote services.
┌─────────────┐ ┌───────────────┐
│ │ │ Slack Agent │
│ ├────►│ (Port 41243) │──► Slack Channels
│ Host Agent │ │ [LOCAL] │
│ (Port 41240)│ └───────────────┘
│ │ ┌───────────────┐
│ CLI ├────►│ GitHub Agent │──► GitHub Issues
│ Interface │ │ (Port 41245) │
│ │ │ [LOCAL] │
│ │ └───────────────┘
│ │ ┌───────────────┐
│ ├────►│ Bench Agent │──► Bench API
└─────────────┘ │ (Remote URL) │
│ [REMOTE] │
└───────────────┘
┌───────────────┐
│ Webhook Server│──► Web UI Dashboard
│ (Port 3000) │ Monitoring & Debug
└───────────────┘
graph TD
User[User] -->|Requests| CLI[CLI Interface]
User -->|Monitors| WebUI[Web UI Dashboard]
CLI -->|Tasks| Host[Host Agent]
Host -->|Delegates| SlackAgent[Slack Agent - LOCAL]
Host -->|Delegates| GitHubAgent[GitHub Agent - LOCAL]
Host -->|A2A Protocol| BenchAgent[Bench Agent - REMOTE]
SlackAgent -->|MCP| Zapier[Zapier MCP Server]
GitHubAgent -->|MCP| Zapier
BenchAgent -->|Remote API| BenchAPI[Bench API]
Zapier -->|API| SlackAPI[Slack API]
Zapier -->|API| GitHubAPI[GitHub API]
WebhookServer[Webhook Server] -->|Provides| WebUI
WebhookServer -->|Receives Webhooks| Host
class Host,SlackAgent,GitHubAgent local;
class BenchAgent remote;
class Zapier middleware;
class SlackAPI,GitHubAPI,BenchAPI external;
class WebhookServer,WebUI monitoring;
classDef local fill:#d070d0,stroke:#333,stroke-width:2px,color:#fff;
classDef remote fill:#ff7070,stroke:#333,stroke-width:2px,color:#fff;
classDef middleware fill:#7070d0,stroke:#333,stroke-width:2px,color:#fff;
classDef external fill:#70b070,stroke:#333,stroke-width:2px,color:#fff;
classDef monitoring fill:#ff7070,stroke:#333,stroke-width:2px,color:#fff;
sequenceDiagram
participant User as User
participant Host as Host Agent
participant Slack as Slack Agent
participant MCP as MCP Layer
participant Zapier as Zapier MCP Server
participant SlackAPI as Slack API
User->>Host: "Send a message to #general"
Host->>Slack: Delegate task
Slack->>Slack: Parse channel and message
Slack->>MCP: Format MCP tool call
MCP->>Zapier: Call slack_send_channel_message tool
Zapier->>SlackAPI: Send message
SlackAPI-->>Zapier: Confirm sent
Zapier-->>MCP: Return tool result
MCP-->>Slack: Structure response
Slack-->>Host: Report success
Host-->>User: "Message sent successfully"
This workshop demonstrates a hybrid architecture: - Local Agents (Host, Slack, GitHub): Run on your machine and connect to external services via MCP - Remote Agents (Bench): Run on external infrastructure and are accessed via A2A protocol over HTTP
This approach allows you to: - Keep sensitive operations local while leveraging remote AI capabilities - Scale individual agents independently - Demonstrate both local and distributed agent architectures - Show how A2A protocol enables seamless communication regardless of agent location
graph LR
AI[AI Model] -->|Tool Calls| MCP[MCP Layer]
MCP -->|MCP Protocol| Zapier[Zapier MCP Server]
Zapier -->|API Calls| Services[External Services]
Services -->|Responses| Zapier
Zapier -->|Tool Results| MCP
MCP -->|Structured Data| AI
subgraph "External Services"
Slack[Slack API]
GitHub[GitHub API]
Other[Other APIs]
end
Zapier --> Slack
Zapier --> GitHub
Zapier --> Other
class AI,MCP connector;
class Zapier middleware;
classDef connector fill:#7070d0,stroke:#333,stroke-width:2px,color:#fff;
classDef middleware fill:#9070d0,stroke:#333,stroke-width:2px,color:#fff;
This workshop requires the following Zapier MCP tools to be configured in your Zapier account:
Slack Integration: - Send Channel Message - Enables the Slack Agent to send messages to Slack channels
GitHub Integration:
- Create Issue - Enables the GitHub Agent to create issues in GitHub repositories
Setup Instructions:
1. Log into your free Zapier MCP account
2. Navigate to the Zapier MCP tools section
3. Configure the above tools with your Slack workspace and GitHub account
4. Copy the SSE (not the streamable http) MCP server URL from Zapier for use in your .env file
bash
npm install.env file with:
```
MCP_SERVER_URL=your_zapier_mcp_server_url
BENCH_API_KEY=your_bench_api_key
GEMINI_API_KEY=your_gemini_api_key# Agent URLs (configure as needed) HOST_AGENT_URL=http://localhost:41240 SLACK_AGENT_URL=http://localhost:41243 GITHUB_AGENT_URL=http://localhost:41245 BENCH_AGENT_URL=http://ec2-54-183-197-218.us-west-1.compute.amazonaws.com:41246
# Slack Configuration SLACK_CHANNEL=#test-slack-damien
# GitHub Configuration
GITHUB_REPOSITORY=DamienBench/a2a-mcp-webhook-workshop
```
Note: The Bench agent is configured to run remotely at the specified URL. Local agents (Host, Slack, GitHub) will be started automatically, while the remote Bench agent is accessed over HTTP.
The webhook server provides a web-based interface for monitoring and debugging the multi-agent system. It includes a dashboard for real-time stats, webhook testing tools, and agent log viewing.
The agents and webhook server is automatically started when you run this script
npm run start:all
npm run stop:all
Once the webhook server is running, access the web dashboard at:
http://localhost:3000
Check the startup logs in the logs folder for errors if anything is not working
The dashboard provides several key features:
The server provides REST API endpoints:
POST /webhook/:id - Receive webhook data for a specific webhook IDGET /api/webhooks - List all webhook configurationsPOST /api/test/webhook/:id - Test a webhook configurationGET /api/logs/:agent - Get logs for a specific agentGET /api/stats - Get webhook processing statisticsNote: The Bench agent runs remotely and does not need to be started locally. The system will automatically connect to the remote Bench agent at the configured URL.
All local agents run in the background, with logs stored in the logs/ directory. The web UI will show different indicators for local vs remote agents.
Solution: Verify webhook URL in .env
Missing or misconfigured Zapier MCP tools
Solution:
.env is correct and activeGemini API key problems
Solution: Regenerate key and update .env
Local agent communication failures
Solution: Check all local agents are running on correct ports
Remote Bench agent connectivity issues
BENCH_AGENT_URL in .env filenpm run test:benchThis system implements a fully decoupled architecture where:
This architectural approach provides: - Flexibility: New agents can be added without modifying existing ones - Scalability: The system can grow to include more specialized agents - Maintainability: Each agent can be developed and updated independently - Resilience: The system can function even if some agents are unavailable
The system includes a webhook handler server with a web UI for debugging agent interactions: - Real-time monitoring of agent communication - Inspection of messages sent between agents - Testing webhook configurations - Viewing agent logs
Each component has its own detailed documentation: - Host Agent - Slack Agent - GitHub Agent - Bench Agent - Webhook Handler & Web UI
$ claude mcp add a2a-mcp-webhook-workshop \
-- python -m otcore.mcp_server <graph>