Examples: serving and protocols¶
MCP, A2A, AG-UI, HTTP and OpenAPI. Back to the Examples gallery. Files here: 14.
| File | Shows | Install | Run | Docs |
|---|---|---|---|---|
examples/a2a_import.py |
Import a remote A2A agent's skills as tools; a remote approval is a ToolError, never a yes. | pip install "agent-adapter[a2a]" |
python examples/a2a_import.py |
A2A |
examples/a2a_server.py |
Serve registry tools as an A2A agent: bearer auth, one skill per tool, approvals parked. | pip install "agent-adapter[a2a]" |
python examples/a2a_server.py |
A2A |
examples/ag_ui_bridge.py |
AG-UI: a run streams tool calls, pauses on an approval, and resumes through our port. | pip install "agent-adapter[ag-ui]" |
python examples/ag_ui_bridge.py |
AG-UI |
examples/ag_ui_starlette.py |
AG-UI over HTTP: one POST /agui route on Starlette or FastAPI, behind bearer auth. |
pip install "agent-adapter[ag-ui,server]" fastapi |
python examples/ag_ui_starlette.py (starts a server on :8000) |
AG-UI |
examples/connect_server.py |
Our side of every "Connect anywhere" recipe: one tool server, local or public. | pip install "agent-adapter[server]" |
python examples/connect_server.py |
Connect anywhere |
examples/mcp_http.py |
The universal export: tools as a stateless Streamable HTTP MCP app (--serve runs it). |
pip install "agent-adapter[server]" |
python examples/mcp_http.py |
Cross-language: MCP |
examples/mcp_import.py |
Import an MCP server's tools, and resume a remote approval with the same run and call ids. | pip install "agent-adapter[mcp]" |
python examples/mcp_import.py |
MCP |
examples/mcp_oauth.py |
Import tools from an MCP server that wants OAuth: code flow, PKCE and a CIMD client id. | pip install "agent-adapter[mcp]" |
python examples/mcp_oauth.py |
MCP tasks, URL approval and OAuth |
examples/mcp_server.py |
Serve registry tools over MCP: an in-process demo, or --stdio for a real MCP host. |
pip install "agent-adapter[mcp]" |
python examples/mcp_server.py |
MCP |
examples/mcp_tasks.py |
MCP tasks: a confirm tool parks as a task; a host polls it by id until a reviewer decides. | pip install "agent-adapter[mcp]" |
python examples/mcp_tasks.py |
MCP tasks, URL approval and OAuth |
examples/openapi_gateway.py |
Write the OpenAPI 3.0.3 documents: one for Go/Rust generators, one for an API gateway. | pip install agent-adapter |
python examples/openapi_gateway.py |
HTTP tool server |
examples/openapi_import.py |
Import an OpenAPI document as tools; a mock transport stands in for the server. | pip install "agent-adapter[openapi]" |
python examples/openapi_import.py |
OpenAPI |
examples/serve_tools.py |
The HTTP tool server: invoke, approve and decide over REST (--serve runs uvicorn). |
pip install "agent-adapter[server]" |
python examples/serve_tools.py |
HTTP tool server |
examples/template_mcp_server.py |
Starter MCP server: registry tools over stdio for any MCP host. Scaffolded by agent-adapter init. |
pip install "agent-adapter[mcp]" |
python examples/template_mcp_server.py (starts a server over stdio, for an MCP host) |
CLI |