# Agents: MCP and A2A

> MCP: a declared operation becomes an agent tool without writing an MCP server; existing MCP servers go behind the same authorization, quota and metrics…

Concept - Since version 0.1.0 - Flexway v1.6.3 - https://flexway.io/en/docs/product-agents/

> Product guide: what the capability brings, for whom, its limits and the version that delivered it - no configuration syntax.

```mermaid
%%{init: {'theme':'base','themeVariables':{'fontSize':'14px','lineColor':'#94a3b8'}}}%%
graph LR
  AG["AI agent"]:::ext
  subgraph FW["Flexway"]
    MCP["MCP surface<br/>tools filtered by scope"]:::hub
    A2A["A2A relay<br/>governed, never terminated"]:::hub
  end
  API["Contract operations<br/>projected as tools"]:::spoke
  SRV["Existing MCP servers"]:::spoke
  AG2["Another agent"]:::spoke

  AG -->|"MCP"| MCP
  MCP --> API
  MCP --> SRV
  AG -->|"A2A"| A2A
  A2A --> AG2

  classDef hub   fill:#4f46e5,stroke:#3730a3,color:#fff,font-weight:bold
  classDef spoke fill:#0891b2,stroke:#155e75,color:#fff,font-weight:bold
  classDef ext   fill:#64748b,stroke:#334155,color:#fff,font-weight:bold
```

| | |
| --- | --- |
| **What it does** | **MCP**: a declared operation becomes an agent tool without writing an MCP server; existing MCP servers go behind the same authorization, quota and metrics (federation); both on one surface. **A2A**: the traffic **between** agents (A2A v1.0) goes through the gateway, under a quota, a verified identity and an audit, without the gateway keeping any task |
| **Why it matters** | The agent's token is **never** relayed upstream: the upstream receives a token exchanged for it. A chain of agents acting for a person is bounded in depth and age, and revocable. Tools can be kept from unattended agents. The console shows what each agent calls and what it costs |
| **Use cases** | Make an internal API usable by an assistant with no new code; govern a third-party MCP server; let two agents of different teams talk under a shared quota |
| **Limits** | Signed A2A agent cards, agent-to-agent delegation and the registry come in `1.9.0`; verified human approval of a sensitive tool, task-scoped rights, argument checks by identity and a budget per agent run in `1.10.0` (not built yet); a federated MCP server's resources and prompts are not relayed; the MCP `stdio` transport is not planned |
| **Since** | `0.1.0` (MCP: projected tools, federation, token exchange, bounded chain), `1.0.0` (declared agents, unattended agents), `1.2.0` (A2A, first two lots) |
| **Configure** | [Agents and MCP](https://flexway.io/en/docs/operations-agents-mcp/), [A2A agents](https://flexway.io/en/docs/operations-a2a/) |
