Skip to content

Chapter 5: Protocol Integration

Learning Objectives

By the end of this chapter you will be able to:

  1. Describe the three communication protocols FCC supports and when to use each.
  2. Build A2A agent cards for FCC personas and handle A2A task requests.
  3. Expose FCC capabilities as MCP tools and resources.
  4. Publish AGENTS.md files that describe FCC deployments for external discovery.
  5. Design multi-protocol deployments that combine A2A, MCP, and AGENTS.md.

The sequence diagram below shows FCC acting as both an MCP server for LLM hosts and an A2A peer for external agents, with AGENTS.md providing the discovery surface for both.

sequenceDiagram
    participant LLM as LLM Host
    participant MCP as MCP Server
    participant FCC as FCC Framework
    participant A2A as A2A Protocol
    participant EXT as External Agent

    LLM->>MCP: call tool(list_personas)
    MCP->>FCC: PersonaRegistry.all()
    FCC-->>MCP: persona list
    MCP-->>LLM: tool result

    EXT->>A2A: send task(research_query)
    A2A->>FCC: activate persona RC
    FCC-->>A2A: task result
    A2A-->>EXT: response

    Note over FCC: AGENTS.md published<br/>for external discovery

The three protocols compose cleanly: a single FCC deployment can expose MCP tools, accept A2A tasks, and publish AGENTS.md simultaneously, with each protocol sharing the same PersonaRegistry and workflow engine underneath.

Why Protocol Integration?

FCC's internal workflow engine orchestrates personas within a single process. But production deployments often require FCC to communicate with external systems: other AI agent frameworks, tool servers, human interfaces, and ecosystem projects like AOME and CONSTEL.

Protocol integration provides standardized communication patterns for these interactions. FCC supports three protocols, each serving a different purpose:

Protocol Purpose Direction
A2A (Agent-to-Agent) Agent-to-agent task delegation Bidirectional
MCP (Model Context Protocol) Tool and resource exposure Server (FCC) to Client (LLM)
AGENTS.md Discovery and capability advertisement Publication

These protocols are complementary, not competing. A typical production deployment uses all three.

A2A: Agent-to-Agent Protocol

A2A enables FCC personas to communicate with external agents as peers. The protocol defines a standard for task delegation, status reporting, and result delivery.

Agent Cards

Every FCC persona can be represented as an A2A agent card -- a JSON document that describes the persona's capabilities, input requirements, and communication endpoints:

from fcc.protocols.a2a.card_builder import A2ACardBuilder
from fcc.personas.registry import PersonaRegistry

registry = PersonaRegistry()
registry.load_all()

builder = A2ACardBuilder(base_url="https://fcc.example.org/agents")

card = builder.build_card(
    persona=registry.get("research_analyst"),
    capabilities=["market_research", "competitive_analysis"],
)

print(card.to_json())

The generated card includes:

{
  "name": "Research Analyst",
  "description": "Analyzes market data to identify trends and competitive positioning.",
  "url": "https://fcc.example.org/agents/research_analyst",
  "capabilities": [
    {"name": "market_research", "description": "Conduct market research"},
    {"name": "competitive_analysis", "description": "Analyze competitors"}
  ],
  "input_schema": {
    "type": "object",
    "properties": {
      "topic": {"type": "string"},
      "constraints": {"type": "array", "items": {"type": "string"}}
    }
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "findings": {"type": "string"},
      "confidence": {"type": "number"}
    }
  }
}

Handling A2A Tasks

The A2A handler processes incoming task requests and routes them to the appropriate persona:

from fcc.protocols.a2a.handler import A2AHandler

handler = A2AHandler(
    persona_registry=registry,
    simulation_engine=engine,
)

# Handle an incoming task request
result = handler.handle_task({
    "task_id": "ext_001",
    "agent": "research_analyst",
    "capability": "market_research",
    "input": {
        "topic": "Enterprise SaaS market in APAC",
        "constraints": ["Focus on mid-market segment", "2024 data only"],
    },
})

print(result.status)  # "completed"
print(result.output)  # The persona's findings

A2A Transport

The A2A protocol supports multiple transports:

  • HTTP/JSON: Standard REST endpoints for synchronous communication.
  • WebSocket: For long-running tasks with streaming status updates.
  • In-process: For local testing and single-machine deployments.
from fcc.protocols.a2a.transport import HTTPTransport

transport = HTTPTransport(handler=handler, port=8080)
transport.start()
# Now accepting A2A requests at http://localhost:8080/a2a/

MCP: Model Context Protocol

MCP enables FCC to expose its capabilities as tools and resources that LLM clients can invoke. Where A2A is peer-to-peer between agents, MCP is server-to-client -- FCC is the server providing capabilities, and the LLM (or LLM-hosting application) is the client consuming them.

Exposing FCC as MCP Tools

Each FCC capability (persona activation, workflow execution, knowledge query) can be exposed as an MCP tool:

from fcc.protocols.mcp.server import MCPServer

server = MCPServer(
    persona_registry=registry,
    simulation_engine=engine,
    search_index=search_index,
)

# Register tools
server.register_tool(
    name="activate_persona",
    description="Activate an FCC persona with a specific action type",
    input_schema={
        "persona_id": {"type": "string"},
        "action_type": {"type": "string"},
        "input_context": {"type": "object"},
    },
)

server.register_tool(
    name="search_artifacts",
    description="Search FCC artifacts by semantic similarity",
    input_schema={
        "query": {"type": "string"},
        "top_k": {"type": "integer", "default": 5},
    },
)

Exposing FCC as MCP Resources

MCP resources provide read-only access to FCC data:

server.register_resource(
    name="persona_catalog",
    description="The complete FCC persona catalog",
    uri="fcc://personas/catalog",
)

server.register_resource(
    name="workflow_graph",
    description="A specific workflow graph definition",
    uri_template="fcc://workflows/{workflow_id}",
)

LLM clients can discover these resources and include them in their context windows.

AGENTS.md: Discovery

AGENTS.md is a convention for publishing machine-readable descriptions of agent deployments. It is the simplest of the three protocols -- a static file placed at a well-known URL:

from fcc.protocols.agents_md.generator import AgentsMdGenerator

generator = AgentsMdGenerator(
    persona_registry=registry,
    deployment_url="https://fcc.example.org",
)

agents_md = generator.generate()

with open("AGENTS.md", "w") as f:
    f.write(agents_md)

The generated file includes:

# AGENTS.md

## FCC Agent Team

**URL:** https://fcc.example.org
**Protocol:** A2A, MCP
**Version:** 0.7.0

### Available Agents

| Agent | Capabilities | Phase |
|---|---|---|
| Research Analyst | market_research, competitive_analysis | Find |
| Software Architect | system_design, architecture_review | Create |
| Code Reviewer | code_review, security_audit | Critique |
...

### MCP Endpoint

Tool server: https://fcc.example.org/mcp/
Resources: https://fcc.example.org/mcp/resources/

### A2A Endpoint

Agent directory: https://fcc.example.org/a2a/

External systems can discover FCC's capabilities by reading this file.

Multi-Protocol Deployment

A production FCC deployment typically uses all three protocols:

  1. AGENTS.md for discovery. External systems find FCC by reading its AGENTS.md.
  2. A2A for agent-to-agent tasks. AOME delegates privacy classification to FCC personas. CONSTEL requests metadata from FCC sessions.
  3. MCP for tool access. LLM applications use FCC personas as tools within their own workflows.

Architecture

External LLM Client
    |
    | (MCP -- tool invocation)
    v
FCC MCP Server
    |
    | (internal -- persona activation)
    v
FCC Simulation Engine <----> AOME (A2A)
    |                  <----> CONSTEL (A2A)
    |
    v
AGENTS.md (discovery)

Protocol Selection Guide

Scenario Protocol
External agent needs FCC analysis A2A
LLM app needs FCC as a tool MCP
System needs to discover FCC AGENTS.md
FCC needs AOME privacy check A2A
Dashboard needs FCC data MCP Resources
Documentation of deployment AGENTS.md

Security Considerations

Protocol endpoints must be secured in production:

  1. Authentication. A2A and MCP endpoints should require API keys or OAuth tokens.
  2. Rate limiting. Prevent external systems from overwhelming FCC with requests.
  3. Input validation. All incoming task inputs are validated against schemas before processing.
  4. Audit logging. All protocol interactions are logged via the event bus.
  5. TLS. All network communication should use TLS in production.

Key Takeaways

  • FCC supports three communication protocols: A2A (agent-to-agent), MCP (tool/resource exposure), and AGENTS.md (discovery).
  • A2A agent cards describe persona capabilities; the A2A handler routes tasks to personas.
  • MCP exposes FCC capabilities as tools and resources for LLM clients.
  • AGENTS.md is a static discovery file that describes the deployment.
  • Production deployments use all three protocols together.
  • Secure all protocol endpoints with authentication, rate limiting, and TLS.

Cross-References


← Chapter 4: Federated Knowledge | Next: Chapter 6 -- Cross-Project Orchestration →