MCP ↔ AAEP Bridge
A bidirectional bridge between the Model Context Protocol (MCP) and the Agent Accessibility Event Protocol (AAEP). Demonstrates that the two protocols address orthogonal concerns and compose cleanly.
If you build agents that use MCP for tool integration and want them to also speak AAEP for accessibility, this bridge shows how.
Why this bridge exists
MCP and AAEP solve different problems:
| Protocol | Addresses | Standardizes |
|---|---|---|
| MCP | Agent ↔ Tool/Resource | Tool discovery, invocation, resources, prompts |
| AAEP | Agent ↔ Assistive Technology | Lifecycle events, safety gating, output streaming for AT |
They are complementary, not competing. An agent using MCP for tool integration can simultaneously use AAEP for accessibility announcements; the two protocols address orthogonal concerns and do not conflict.
This bridge makes their cooperation concrete. It runs between an MCP-aware agent and an AAEP-aware AT, translating relevant signals in both directions.
What the bridge does
The bridge is a small process that:
- Wraps an MCP client that connects to MCP servers exposing tools the agent uses
- Embeds an AAEP producer that emits events to AT subscribers
- Observes MCP traffic as the agent calls tools, and translates the relevant traffic into AAEP events
Specifically:
| MCP event | AAEP event emitted |
|---|---|
tools/list returns server capabilities |
(no emission; metadata only) |
tools/call request (before execution) |
aaep:agent.tool.invoked |
tools/call request, irreversible flagged |
aaep:agent.awaiting.confirmation BEFORE the MCP call |
tools/call response success |
aaep:agent.tool.completed (status=success) |
tools/call response error |
aaep:agent.tool.completed (status=error) |
tools/call request times out |
aaep:agent.tool.completed (status=timeout) |
| MCP server disconnects | aaep:agent.session.errored (error_category=network) |
resources/read |
(optional; emitted as state.changed to reading_resource) |
prompts/get |
(optional; emitted as state.changed to loading_prompt) |
The bridge also supports the reverse direction:
| AAEP signal | MCP action |
|---|---|
confirmation.reply decision=reject |
Cancel pending tools/call request, return error to MCP client |
confirmation.reply decision=accept |
Allow tools/call request to proceed to the MCP server |
clarification.reply response |
Forward as additional context to the MCP server (advisory) |
Installation
cd examples/bridges/mcp-aaep-bridge
pip install -e .
Requires Python 3.10 or newer. The bridge depends on:
aaep-minimal-producer>=1.0.0(reuses the emitter)mcp>=1.0.0(the official MCP Python SDK)aiohttp>=3.9.0(HTTP/SSE transport for AAEP subscribers)
Quick start
1. Configure your MCP server
The bridge connects to an MCP server you've already set up. For example, if you have an MCP filesystem server:
# In one terminal: an MCP server
npx -y @modelcontextprotocol/server-filesystem /path/to/workspace
2. Start the bridge
aaep-mcp-bridge \
--mcp-server "npx -y @modelcontextprotocol/server-filesystem /path/to/workspace" \
--aaep-port 8090
This starts a bridge that:
- Connects to the MCP filesystem server via stdio JSON-RPC
- Exposes an AAEP
/eventsSSE endpoint onhttp://localhost:8090 - Translates every MCP tool call into the appropriate AAEP events
3. Connect an AT subscriber
In another terminal:
aaep-listen --endpoint http://localhost:8090
4. Drive the agent through the bridge
In a third terminal, send an MCP request through the bridge (or have your agent connect to the bridge as if it were the MCP server directly):
# Example: list available tools (simple MCP request)
curl -X POST http://localhost:8090/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'
# Example: call a tool
curl -X POST http://localhost:8090/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "read_file",
"arguments": {"path": "/etc/hostname"}
}
}'
The AAEP subscriber (terminal with aaep-listen) will show:
[12:34:56.789] aaep:agent.tool.invoked Calling read_file via MCP.
tool: read_file
risk_level: low
irreversible: false
args_summary: path=/etc/hostname
[12:34:56.823] aaep:agent.tool.completed myhost.local
tool: read_file
status: success
For tools flagged as irreversible (configurable; see §"Risk Configuration" below), the bridge inserts an awaiting.confirmation event before the MCP call and blocks until the AT subscriber replies.
Architecture
AT Subscriber MCP Server
↑ ↑
│ SSE /events │ stdio
│ POST /messages │ JSON-RPC
│ │
▼ ▼
┌────────────────────────────────────────────────────────────────┐
│ aaep-mcp-bridge process │
│ │
│ ┌──────────────┐ translation ┌──────────────┐ │
│ │ AAEP │ ───────────────▶│ MCP Client │ │
│ │ Producer │ │ (stdio) │ │
│ └──────────────┘ └──────────────┘ │
│ ▲ │ │
│ │ │ │
│ │ confirmation reply │ tool/call │
│ │ (accept/reject) │ response │
│ │ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ HTTP server: /mcp /events /messages │ │
│ └──────────────────────────────────────────┘ │
│ ▲ │
│ │ JSON-RPC │
│ │ HTTP │
└──────┼─────────────────────────────────────────────────────────┘
│
│
Agent (any LLM with MCP support)
The agent talks to the bridge as if it were the MCP server. The MCP server is unchanged. The AT is unchanged. The bridge is the glue.
Risk configuration
By default, the bridge uses heuristics matching the python-minimal example to classify tool risk:
- Tool names containing
send_,delete_,transfer_,write_,execute_,publish_,make_payment→ high-risk irreversible - All other tools → low-risk
To override, provide a --risk-config JSON file:
{
"tool_overrides": {
"read_file": {"risk_level": "low", "irreversible": false},
"write_file": {"risk_level": "high", "irreversible": true},
"execute_command": {"risk_level": "high", "irreversible": true}
},
"default": {"risk_level": "low", "irreversible": false}
}
The bridge consults this map for every tools/call before deciding whether to emit awaiting.confirmation.
Project layout
mcp-aaep-bridge/
├── README.md
├── pyproject.toml
├── aaep_mcp_bridge/
│ ├── __init__.py
│ ├── bridge.py # MCPToAAEPBridge — the core translator
│ ├── risk.py # Risk classification + override config
│ └── server.py # HTTP server combining /mcp + AAEP /events
└── tests/
└── test_bridge.py
Limitations and known issues
This is a reference bridge, not production code. Specifically:
- stdio transport only. The bridge speaks JSON-RPC over stdio to the MCP server. HTTP/SSE-transported MCP servers will need adaptation. The MCP SDK supports both.
- One MCP server per bridge instance. Multi-server MCP setups need to run one bridge per server (or extend this code).
- No streaming response support yet. MCP doesn't currently stream
tools/callresponses; if/when it does, this bridge will need updating. - Resources and prompts are minimal. This bridge focuses on
tools/*. Resources and prompts emitstate.changedonly. - No authentication relay. If your MCP server requires authentication, you'll need to configure it before the bridge starts; this code doesn't proxy credentials.
For production deployments, consider these as starting points to extend, not finished features to rely on.
See also
- Model Context Protocol specification — the upstream MCP standard
../opentelemetry-aaep-bridge/— sister bridge for OpenTelemetry- Specification Chapter 11 — bridge patterns
- Implementer's Guide §5 — bridge integration patterns
../../subscribers/cli-debug/— subscriber to test this bridge with
Metadata
Release files for aaep-mcp-bridge 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aaep_mcp_bridge-1.0.0.tar.gz | 17.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aaep_mcp_bridge-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.4 kB
Release files / aaep_mcp_bridge-1.0.0.tar.gz
| Download URL | aaep_mcp_bridge-1.0.0.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f760b8bc89ed6a3830500e5583b05248cc090d0046c1fe8025ff7d20ae8cec46
|
|
BLAKE2b-256 checksum How to use checksums |
a0427bf0cea767794958917e3c4e3973dfc81baa70849b5799b7ef7dba84cdf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aaep_mcp_bridge-1.0.0-py3-none-any.whl
| Download URL | aaep_mcp_bridge-1.0.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b4f7baf92bf9a1afdf3b0d6da234945cbe94b90ff7dc1d44490abc95a364460
|
|
BLAKE2b-256 checksum How to use checksums |
dc72cbaf45ec2386dcc1cb87f12d5534cb92423d00e9adff3df8cfb5ca1aaf37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for aaep-mcp-bridge 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.