/a2a-protocol:a2a-server-configfrom a2a-protocol
Provides templates and patterns for configuring Agent-to-Agent (A2A) servers with HTTP, STDIO, SSE, and WebSocket transports following MCP standards. Includes Python and TypeScript implementations.
Ships in a2a-protocol. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Provides complete patterns and templates for configuring Agent-to-Agent (A2A) servers with different transport mechanisms (HTTP, STDIO, SSE, WebSocket) following MCP (Model Context Protocol) standards.
CRITICAL: When generating any configuration files or code:
NEVER hardcode actual API keys or secrets
NEVER include real credentials in examples
NEVER commit sensitive values to git
ALWAYS use placeholders: your_service_key_here
ALWAYS create .env.example with placeholders only
ALWAYS add .env* to .gitignore (except .env.example)
ALWAYS read from environment variables in code
ALWAYS document where to obtain keys
Placeholder format: {service}_{env}_your_key_here
Determine server configuration needs:
Transport Type
Framework Detection
Configuration Needs
Based on requirements, use templates from templates/:
Python Templates:
templates/python-http-server.py - FastAPI HTTP servertemplates/python-stdio-server.py - STDIO transporttemplates/python-sse-server.py - SSE streamingtemplates/python-websocket-server.py - WebSocket bidirectionalTypeScript Templates:
templates/typescript-http-server.ts - Express HTTP servertemplates/typescript-stdio-server.ts - STDIO transporttemplates/typescript-sse-server.ts - SSE streamingtemplates/typescript-websocket-server.ts - WebSocket bidirectionalApply configuration based on transport type:
HTTP Configuration:
# Python (FastAPI)
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"main:app",
host="0.0.0.0",
port=8000,
reload=True
)
// TypeScript (Express)
const PORT = process.env.PORT || 8000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
STDIO Configuration:
# Python
mcp.run(transport="stdio")
// TypeScript
server.connect(new StdioServerTransport());
SSE Configuration:
# Python
@app.get("/events")
async def events():
return EventSourceResponse(event_generator())
WebSocket Configuration:
# Python
@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket):
await websocket.accept()
For HTTP/SSE/WebSocket servers:
# Python
from fastapi.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Configure appropriately
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
// TypeScript
import cors from 'cors';
app.use(cors({
origin: process.env.ALLOWED_ORIGINS?.split(',') || '*',
credentials: true
}));
Create .env.example with placeholders:
# Server Configuration
PORT=8000
HOST=0.0.0.0
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
# API Keys (NEVER commit real values)
ANTHROPIC_API_KEY=your_anthropic_key_here
OPENAI_API_KEY=your_openai_key_here
# Transport Settings
TRANSPORT_TYPE=http
ENABLE_CORS=true
Run validation script:
bash scripts/validate-config.sh <server-file>
Checks:
scripts/validate-config.sh - Validate server configurationscripts/generate-server.sh - Generate server from templatescripts/test-transport.sh - Test transport connectivityPython:
templates/python-http-server.py - HTTP server with FastAPItemplates/python-stdio-server.py - STDIO transporttemplates/python-sse-server.py - SSE streaming servertemplates/python-websocket-server.py - WebSocket serverTypeScript:
templates/typescript-http-server.ts - HTTP server with Expresstemplates/typescript-stdio-server.ts - STDIO transporttemplates/typescript-sse-server.ts - SSE streaming servertemplates/typescript-websocket-server.ts - WebSocket serverexamples/http-fastapi-example.md - Complete HTTP server with FastAPIexamples/stdio-simple-example.md - Basic STDIO serverexamples/sse-streaming-example.md - SSE streaming configurationexamples/websocket-bidirectional-example.md - WebSocket bidirectional communicationSetting up HTTP server for remote A2A communication
Configuring STDIO for local agent communication
Implementing SSE for real-time agent updates
Setting up WebSocket for bidirectional agent chat
examples/http-fastapi-example.md (opens in a new tab)examples/sse-streaming-example.md (opens in a new tab)examples/stdio-simple-example.md (opens in a new tab)examples/websocket-bidirectional-example.md (opens in a new tab)scripts/generate-server.sh (opens in a new tab)scripts/test-transport.sh (opens in a new tab)scripts/validate-config.sh (opens in a new tab)templates/python-http-server.py (opens in a new tab)templates/python-sse-server.py (opens in a new tab)templates/python-stdio-server.py (opens in a new tab)templates/python-websocket-server.py (opens in a new tab)templates/typescript-http-server.ts (opens in a new tab)templates/typescript-sse-server.ts (opens in a new tab)templates/typescript-stdio-server.ts (opens in a new tab)templates/typescript-websocket-server.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks: must be an object mapping event names to matcher arrays — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks: must be an object mapping event names to matcher arrays — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
5 skills in this plugin
/a2a-executor-patternsAgent-to-Agent (A2A) executor implementation patterns for task handling, execution management, and agent coordination. Use when building A2A executors, implementing task handlers, creating agent execution flows, or when user mentions A2A protocol, task execution, agent executors, task handlers, or agent coordination./a2a-mcp-integrationIntegration patterns for combining Agent-to-Agent (A2A) Protocol with Model Context Protocol (MCP) for hybrid agent communication. Use when building systems that need both agent-to-agent communication and agent-to-tool integration, implementing composite architectures, or when user mentions A2A+MCP integration, hybrid protocols, or multi-agent tool access./Other plugins' skills for the same job