A2

a2a-server-config

Templates and configuration patterns for building Agent-to-Agent communication servers.

Install

mkdir -p .claude/skills/a2a-server-config && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17167" && unzip -o skill.zip -d .claude/skills/a2a-server-config && rm skill.zip

Installs to .claude/skills/a2a-server-config

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
297 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Configure A2A servers with HTTP transport
  • Set up STDIO transport for local process communication
  • Implement SSE for real-time streaming
  • Configure WebSocket for bidirectional communication
  • Add CORS and security measures to server configurations
  • Manage environment variables for server settings

How it works

The skill analyzes server requirements, selects appropriate templates for different transport mechanisms (HTTP, STDIO, SSE, WebSocket), and applies configurations. It includes steps for adding CORS, security, and environment variable management.

Inputs & outputs

You give it
Requirements for A2A server transport type, framework, and configuration needs
You get back
Server configuration files (e.g., Python or TypeScript) with placeholders for sensitive data

When to use a2a-server-config

  • Configure MCP server transports
  • Setup WebSocket communication
  • Build A2A infrastructure

About this skill

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 (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()

Phase 4: Add CORS and Security

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
}));

Phase 5: Environment Configuration

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

Phase 6: Validation

Run validation script:

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 flow

When not to use it

  • When hardcoding actual API keys or secrets
  • When including real credentials in examples
  • When committing sensitive values to git

Limitations

  • The skill requires framework-specific dependencies like FastAPI or Express.
  • The skill requires CORS middleware for HTTP, SSE, and WebSocket transports.
  • The skill requires environment variable management tools.

How it compares

This workflow provides structured templates and security guidelines for A2A server configuration, ensuring consistent and secure setup across different transport types, unlike ad-hoc manual configuration.

Compared to similar skills

a2a-server-config side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
a2a-server-config (this skill)05moReviewAdvanced
mcp-builder1364moReviewAdvanced
langchain-architecture83moReviewIntermediate
engineering-skills42moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by diegosouzapw

View all by diegosouzapw

helm-chart-scaffolding-v2

diegosouzapw

Helm Chart Scaffolding workflow skill. Use this skill when the user needs Comprehensive guidance for creating, organizing, and managing Helm charts for packaging and deploying Kubernetes applications and the operator should preserve the upstream workflow, copied support files, and provenance before

00

cc-skill-coding-standards-v2

diegosouzapw

Coding Standards & Best Practices workflow skill. Use this skill when the user needs Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development and the operator should preserve the upstream workflow, copied support files, and provenance before

00

worktree-setup

diegosouzapw

Automatically invoked after `git worktree add` to create data/shared symlink and data/local directory. Required before starting work in any new worktree.

00

parsehub-automation

diegosouzapw

Automate Parsehub tasks via Rube MCP (Composio). Always search tools first for current schemas.

00

signalwire-agents-sdk

diegosouzapw

Expert assistance for building SignalWire AI Agents in Python. Automatically activates when working with AgentBase, SWAIG functions, skills, SWML, voice configuration, DataMap, or any signalwire_agents code. Provides patterns, best practices, and complete working examples.

00

agent-sales-engineer

diegosouzapw

Expert sales engineer specializing in technical pre-sales, solution architecture, and proof of concepts. Masters technical demonstrations, competitive positioning, and translating complex technology into business value for prospects and customers.

00

You might also like

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

langchain-architecture

wshobson

Design LLM applications using the LangChain framework with agents, memory, and tool integration patterns. Use when building LangChain applications, implementing AI agents, or creating complex LLM workflows.

899

engineering-skills

alirezarezvani

23 production-ready engineering skills covering architecture, frontend, backend, fullstack, QA, DevOps, security, AI/ML, data engineering, computer vision, and specialized tools like Playwright Pro, Stripe integration, AWS, and MS365. 30+ Python automation tools (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.

422

backend-architect

sickn33

Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven architectures, service mesh patterns, and modern backend frameworks. Handles service boundary definition, inter-service communication, resilience patterns, and observability. Use PROACTIVELY when creating new backend services or APIs.

1014

moai-domain-backend

modu-ai

Backend development specialist covering API design, database integration, microservices architecture, and modern backend patterns.

10

architecture-patterns

wshobson

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

55214

Search skills

Search the agent skills registry