Skip to content

Protocol Integration Case Studies

Advanced Tutorial

Duration: 45-60 minutes | Level: Advanced | Prerequisites: Protocol Integration tutorial

Deep-dive case studies demonstrating A2A and MCP protocol integration patterns in real-world scenarios.

Case Study 1: Multi-Agent Document Review (A2A)

A2A enables agents to discover each other and negotiate tasks. This case study demonstrates a document review workflow where multiple persona agents collaborate.

Setup

from fcc._resources import get_personas_dir
from fcc.personas.registry import PersonaRegistry
from fcc.protocols.a2a.card_builder import CardBuilder

# Build agent cards for review team
registry = PersonaRegistry.from_yaml_directory(get_personas_dir())
builder = CardBuilder()

# Create cards for the review team
rc_card = builder.build_card(registry.get("RC"))
bc_card = builder.build_card(registry.get("BC"))
de_card = builder.build_card(registry.get("DE"))

print(f"RC capabilities: {[s.name for s in rc_card.skills]}")
print(f"BC capabilities: {[s.name for s in bc_card.skills]}")
print(f"DE capabilities: {[s.name for s in de_card.skills]}")

Task Negotiation

# A2A task request from RC to BC
task_request = {
    "jsonrpc": "2.0",
    "method": "tasks/send",
    "params": {
        "id": "review-001",
        "message": {
            "role": "user",
            "parts": [{"text": "Review the API blueprint for completeness"}],
        },
    },
}
print(f"Task request: {task_request['params']['id']}")

Key Patterns

  1. Discovery — Agents expose /.well-known/agent.json cards
  2. Negotiation — Task requests include capability requirements
  3. Streaming — Long-running tasks use SSE for progress updates
  4. Artifacts — Deliverables are returned as structured task artifacts

Case Study 2: Tool Exposure via MCP

MCP exposes FCC capabilities as tools that any MCP-compatible client can invoke.

Exposing Persona Search as MCP Tool

from fcc.protocols.mcp.server import FccMcpServer

server = FccMcpServer()
print(f"Tools: {server.tool_count}")
print(f"Resources: {server.resource_count}")
print(f"Prompts: {server.prompt_count}")

Available MCP Tools

Tool Description Input
search_personas Semantic persona search query, k
search_actions Workflow action search query, k
get_persona Get persona spec by ID persona_id
run_action Execute workflow action persona_id, action_type
build_kg Build knowledge graph registries
assess_compliance Check regulation compliance regulation

Key Patterns

  1. Tool registration — Tools are auto-discovered from registry
  2. Resource exposure — Personas, workflows, and graphs as resources
  3. Prompt templates — Pre-built prompts for common operations
  4. Fallback mode — JSON-RPC fallback when MCP SDK unavailable

Case Study 3: Protocol Bridge — A2A + MCP Together

The protocol bridge connects A2A and MCP, allowing A2A agents to invoke MCP tools and vice versa.

from fcc.protocols.bridge import ProtocolBridge

bridge = ProtocolBridge()
print(f"A2A agents: {bridge.a2a_agent_count}")
print(f"MCP tools: {bridge.mcp_tool_count}")

Bridge Patterns

  1. A2A→MCP — Agent card skills map to MCP tool invocations
  2. MCP→A2A — MCP tool calls trigger A2A task requests
  3. Event forwarding — Protocol events published to EventBus
  4. Namespace isolation — Each protocol maintains its own namespace

Summary

These case studies demonstrate:

  • A2A agent discovery and task negotiation
  • MCP tool exposure and invocation
  • Protocol bridge for cross-protocol communication
  • Event bus integration for protocol monitoring