a2a-server-config
Agent-to-Agent (A2A) server configuration patterns for HTTP, STDIO, SSE, and WebSocket transports. Use when building A2A servers, configuring MCP transports, setting up server endpoints, or when user mentions A2A configuration, server transport, MCP server setup, or agent communication protocols.
Best use case
a2a-server-config is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Agent-to-Agent (A2A) server configuration patterns for HTTP, STDIO, SSE, and WebSocket transports. Use when building A2A servers, configuring MCP transports, setting up server endpoints, or when user mentions A2A configuration, server transport, MCP server setup, or agent communication protocols.
Teams using a2a-server-config should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/a2a-server-config/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How a2a-server-config Compares
| Feature / Agent | a2a-server-config | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Agent-to-Agent (A2A) server configuration patterns for HTTP, STDIO, SSE, and WebSocket transports. Use when building A2A servers, configuring MCP transports, setting up server endpoints, or when user mentions A2A configuration, server transport, MCP server setup, or agent communication protocols.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# A2A Server Configuration
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.
## Security: API Key Handling
**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`
## Instructions
### Phase 1: Analyze Requirements
Determine server configuration needs:
1. **Transport Type**
- HTTP: Remote access, REST-like communication, CORS support
- STDIO: Local process communication, pipe-based I/O
- SSE (Server-Sent Events): Real-time streaming, one-way server push
- WebSocket: Bidirectional real-time communication
2. **Framework Detection**
- Python: FastAPI, Flask, Starlette
- TypeScript: Express, Fastify, Node.js native http
- Detect from package.json or requirements.txt
3. **Configuration Needs**
- Port and host settings
- CORS configuration
- Authentication requirements
- Environment variables
### Phase 2: Select and Load Templates
Based on requirements, use templates from `templates/`:
**Python Templates:**
- `templates/python-http-server.py` - FastAPI HTTP server
- `templates/python-stdio-server.py` - STDIO transport
- `templates/python-sse-server.py` - SSE streaming
- `templates/python-websocket-server.py` - WebSocket bidirectional
**TypeScript Templates:**
- `templates/typescript-http-server.ts` - Express HTTP server
- `templates/typescript-stdio-server.ts` - STDIO transport
- `templates/typescript-sse-server.ts` - SSE streaming
- `templates/typescript-websocket-server.ts` - WebSocket bidirectional
### Phase 3: Configure Transport
Apply configuration based on transport type:
**HTTP Configuration:**
```python
# Python (FastAPI)
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"main:app",
host="0.0.0.0",
port=8000,
reload=True
)
```
```typescript
// TypeScript (Express)
const PORT = process.env.PORT || 8000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
```
**STDIO Configuration:**
```python
# Python
mcp.run(transport="stdio")
```
```typescript
// TypeScript
server.connect(new StdioServerTransport());
```
**SSE Configuration:**
```python
# Python
@app.get("/events")
async def events():
return EventSourceResponse(event_generator())
```
**WebSocket Configuration:**
```python
# Python
@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket):
await websocket.accept()
```
### Phase 4: Add CORS and Security
For HTTP/SSE/WebSocket servers:
```python
# Python
from fastapi.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Configure appropriately
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
```
```typescript
// TypeScript
import cors from 'cors';
app.use(cors({
origin: process.env.ALLOWED_ORIGINS?.split(',') || '*',
credentials: true
}));
```
### Phase 5: Environment Configuration
Create `.env.example` with placeholders:
```bash
# 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
```
### Phase 6: Validation
Run validation script:
```bash
bash scripts/validate-config.sh <server-file>
```
Checks:
- No hardcoded API keys
- Environment variable usage
- CORS configuration
- Transport setup validity
- .gitignore includes .env files
## Scripts
- `scripts/validate-config.sh` - Validate server configuration
- `scripts/generate-server.sh` - Generate server from template
- `scripts/test-transport.sh` - Test transport connectivity
## Templates
**Python:**
- `templates/python-http-server.py` - HTTP server with FastAPI
- `templates/python-stdio-server.py` - STDIO transport
- `templates/python-sse-server.py` - SSE streaming server
- `templates/python-websocket-server.py` - WebSocket server
**TypeScript:**
- `templates/typescript-http-server.ts` - HTTP server with Express
- `templates/typescript-stdio-server.ts` - STDIO transport
- `templates/typescript-sse-server.ts` - SSE streaming server
- `templates/typescript-websocket-server.ts` - WebSocket server
## Examples
- `examples/http-fastapi-example.md` - Complete HTTP server with FastAPI
- `examples/stdio-simple-example.md` - Basic STDIO server
- `examples/sse-streaming-example.md` - SSE streaming configuration
- `examples/websocket-bidirectional-example.md` - WebSocket bidirectional communication
## Requirements
- Framework-specific dependencies (FastAPI/Express/etc.)
- CORS middleware for HTTP/SSE/WebSocket
- Environment variable management (python-dotenv/dotenv)
- No hardcoded API keys or secrets
- .gitignore protection for sensitive files
## Use Cases
1. **Setting up HTTP server for remote A2A communication**
- Load http template
- Configure CORS
- Set environment variables
- Validate configuration
2. **Configuring STDIO for local agent communication**
- Load stdio template
- Configure process pipes
- Test connectivity
3. **Implementing SSE for real-time agent updates**
- Load sse template
- Configure event streams
- Set up CORS
- Test streaming
4. **Setting up WebSocket for bidirectional agent chat**
- Load websocket template
- Configure connection handling
- Set up authentication
- Test bidirectional flowRelated Skills
ameba-configuration
Use when configuring Ameba rules and settings for Crystal projects including .ameba.yml setup, rule management, severity levels, and code quality enforcement.
akka-net-aspire-configuration
Configure Akka.NET with .NET Aspire for local development and production deployments. Covers actor system setup, clustering, persistence, Akka.Management integration, and Aspire orchestration patterns.
agentstack-server-debugging
Instructions for debugging agentstack-server during development
add-config-field
Guide adding a new config field across types, defaults, config.yaml, and optional state/env wiring.
add-app-config
Use when adding configuration for a new application to the dotfiles, setting up a new tool's config, or when user says "add config for X"
dev-server-sandbox
Run multiple isolated mux dev-server instances (temp MUX_ROOT + free ports)
configure-downstream
Configure Konflux for new Submariner version - creates overlays, tenant config, and RPAs for Y-stream releases.
aerospace-config
Complete AeroSpace tiling window manager configuration assistant for macOS. Use for any AeroSpace configuration task including keybindings, workspace management, window rules, layouts (BSP, columns, rows, accordion), focus behavior, gaps, floating windows, app-specific settings, exec commands, or any window management customization. Also use for debugging and troubleshooting AeroSpace issues including log inspection, window state analysis, and diagnosing layout problems. This skill fetches fresh documentation for each request to ensure accurate, up-to-date guidance.
aceternity-ui-configuration
Specifies that Aceternity UI dependencies should be considered during code generation or modification.
openclaw-config-validator
Validate, analyze, and explain OpenClaw configuration files. Use when users need to check config.json for errors, understand what a config field does, compare configs, or safely modify OpenClaw configuration. Triggers on config validation requests, schema questions, or config editing tasks.
import-existing-ai-config
Import existing AI tool configurations (from Claude, Copilot, or Cursor) into universal-ai-config templates. Converts target-specific files into universal templates.
EchoKit Config Generator
Generate config.toml for EchoKit servers with interactive setup for ASR, TTS, LLM services, MCP servers, API key entry, and server launch