⚒️ MCP + A2A Agentic — Protocol Integration
DITEMPA BUKAN DIBERI — Forged, Not Given.
Purpose
Implement MCP server/client patterns and A2A agent-to-agent protocol integration across the federation. Handle tool surface discovery, capability drift detection, transport selection (stdio/HTTP), and agent card registration.
When to Use
- Creating or modifying an MCP server for any federation organ (FastMCP, Express)
- Implementing A2A agent cards and task lifecycle
- Tool discovery —
tools/list patterns, capability enumeration
- Transport decisions — stdio vs HTTP SSE vs streamable HTTP
- Drift detection between registered manifest and live tool surface
When NOT to Use
- Frontend UI components — use
nextjs-mastery or react-spa-discipline
- Database or cache layers — use
postgres-schema-design or redis-qdrant-integration
- Deployment — use
cicd-docker-deploy
Constitutional Floor Alignment
| Floor |
Application |
| F1 AMANAH |
Tool renames are breaking changes; deprecate before removal across one cycle |
| F2 TRUTH |
Tool descriptions must match actual behavior — vague descriptions = silent misfires |
| F3 WITNESS |
A2A agent cards published with verifiable identity (did:web ref) |
| F4 CLARITY |
One tool = one responsibility; no mega-tools with action-switch parameters |
| F11 AUDIT |
Every tool call logged with actor, intent, timestamp, result |
| F12 INJECTION |
Tool arguments sanitized; no eval or raw shell from untrusted input |
Commands & Patterns
// FastMCP tool registration — FastMCP convention
server.tool(
'forge_health_check',
'Return A-FORGE server health and constitutional genome status',
{
include_latency: z.boolean().optional(),
},
async (args) => {
// implementation
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
},
);
// A2A agent card — minimal structure
{
"@context": "https://a2a.arif-fazil.com/schema/agent-card/v1",
"id": "did:web:arif-fazil.com#333-agi",
"name": "333-AGI",
"capabilities": ["reason", "plan", "execute"],
"services": [{
"id": "#a2a-endpoint",
"type": "A2AServer",
"serviceEndpoint": "https://aaa.arif-fazil.com/a2a"
}]
}
// Surface drift detection — compare manifest vs tools/list
// 1. Fetch manifest from federation-manifest
// 2. Call tools/list on each organ
// 3. Diff: missing tools, extra tools, description drift, schema drift
// 4. Report to forge_surface_guard
Refusal Surface
- ❌ Tool names that change semantics without deprecation cycle
- ❌ A2A cards without verifiable identity references
- ❌ Registering tools that haven't passed HARAM scan + forge_evaluate
- ❌ Exposing internal organ ports/db details in tool descriptions
- ❌ Mixing transport auth models — stdio for local, HTTP with session for remote
1---2name: forge-mcp-a2a-agentic3description: MCP + A2A protocol integration — agentic inter-agent communication and task delegation.4---5# ⚒️ MCP + A2A Agentic — Protocol Integration67> **DITEMPA BUKAN DIBERI** — Forged, Not Given.89## Purpose10Implement MCP server/client patterns and A2A agent-to-agent protocol integration across the federation. Handle tool surface discovery, capability drift detection, transport selection (stdio/HTTP), and agent card registration.1112## When to Use13- Creating or modifying an MCP server for any federation organ (FastMCP, Express)14- Implementing A2A agent cards and task lifecycle15- Tool discovery — `tools/list` patterns, capability enumeration16- Transport decisions — stdio vs HTTP SSE vs streamable HTTP17- Drift detection between registered manifest and live tool surface1819## When NOT to Use20- Frontend UI components — use `nextjs-mastery` or `react-spa-discipline`21- Database or cache layers — use `postgres-schema-design` or `redis-qdrant-integration`22- Deployment — use `cicd-docker-deploy`2324## Constitutional Floor Alignment2526| Floor | Application |27|-------|-------------|28| F1 AMANAH | Tool renames are breaking changes; deprecate before removal across one cycle |29| F2 TRUTH | Tool descriptions must match actual behavior — vague descriptions = silent misfires |30| F3 WITNESS | A2A agent cards published with verifiable identity (did:web ref) |31| F4 CLARITY | One tool = one responsibility; no mega-tools with action-switch parameters |32| F11 AUDIT | Every tool call logged with actor, intent, timestamp, result |33| F12 INJECTION | Tool arguments sanitized; no eval or raw shell from untrusted input |3435## Commands & Patterns3637```typescript38// FastMCP tool registration — FastMCP convention39server.tool(40 'forge_health_check',41 'Return A-FORGE server health and constitutional genome status',42 {43 include_latency: z.boolean().optional(),44 },45 async (args) => {46 // implementation47 return { content: [{ type: 'text', text: JSON.stringify(result) }] };48 },49);5051// A2A agent card — minimal structure52{53 "@context": "https://a2a.arif-fazil.com/schema/agent-card/v1",54 "id": "did:web:arif-fazil.com#333-agi",55 "name": "333-AGI",56 "capabilities": ["reason", "plan", "execute"],57 "services": [{58 "id": "#a2a-endpoint",59 "type": "A2AServer",60 "serviceEndpoint": "https://aaa.arif-fazil.com/a2a"61 }]62}6364// Surface drift detection — compare manifest vs tools/list65// 1. Fetch manifest from federation-manifest66// 2. Call tools/list on each organ67// 3. Diff: missing tools, extra tools, description drift, schema drift68// 4. Report to forge_surface_guard69```7071## Refusal Surface72- ❌ Tool names that change semantics without deprecation cycle73- ❌ A2A cards without verifiable identity references74- ❌ Registering tools that haven't passed HARAM scan + forge_evaluate75- ❌ Exposing internal organ ports/db details in tool descriptions76- ❌ Mixing transport auth models — stdio for local, HTTP with session for remote