A2A Bridge for MCP Clients
# A2A Bridge for MCP Clients
`a2a-bridge-for-mcp-clients` is a local stdio [MCP](https://modelcontextprotocol.io) server that lets MCP clients (Claude Code, Claude Desktop,
Codex, Cursor, VS Code, Windsurf and others) talk to [A2A](https://a2a-protocol.org) agents through one tool.
[Atlassian Rovo](https://a2a.atlassian.com/.well-known/agent.json) works out of the box. You can add any other A2A agent in a
profile file.
Runtime dependencies: `@modelcontextprotocol/sdk` and `zod`. Everything else is hand-written on Node built-ins:
- the A2A client: v0.3, v1.0 and the v1.1 release candidate, JSON-RPC, SSE streaming;
- OAuth: RFC 9728/8414 discovery, dynamic client registration, PKCE, refresh.
## Setup
Requires Node.js 22 or later. Sign in once (this opens your browser):
```bash
npx -y a2a-bridge-for-mcp-clients login
```
Without a profile file the only agent is Rovo. Before it works, an Atlassian org admin must enable A2A under **Atlassian Administration → Agent2Agent connections**. Without that, calls fail with 403.
Sign in before you register the server with a client. Otherwise the first tool call waits for the browser sign-in, which can take longer than some clients' tool-call timeouts.
### Registering with a client
Every client needs the same thing: run `npx -y a2a-bridge-for-mcp-clients` over stdio.
GUI apps often don't inherit your shell's `PATH` (nvm, for example). If `npx` isn't found, give its full path (`which npx`).
**Claude Code**
```bash
claude mcp add a2a -- npx -y a2a-bridge-for-mcp-clients
```
**Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json`.
**Cursor**: `~/.cursor/mcp.json`. **Windsurf**: `~/.codeium/windsurf/mcp_config.json`.
```json
{
"mcpServers": {
"a2a": { "command": "npx", "args": ["-y", "a2a-bridge-for-mcp-clients"] }
}
}
```
**VS Code**: `.vscode/mcp.json` or the user-level `mcp.json`.
```json
{
"servers": {
"a2a": { "type": "stdio", "command": "npx", "args": ["-y", "a2a-bridge-for-mcp-clients"] }
}
}
```
**Codex**: `~/.codex/config.toml`. Agent answers often take 20–30 s, so raise the tool timeout.
```toml
[mcp_servers.a2a]
command = "npx"
args = ["-y", "a2a-bridge-for-mcp-clients"]
tool_timeout_sec = 300
```
### Installing globally or from source
`npm install -g a2a-bridge-for-mcp-clients` installs two commands, `a2a-bridge-for-mcp-clients` and the shorter `a2a-bridge`. Use either one in place of `npx -y a2a-bridge-for-mcp-clients` above.
From a checkout: `npm install && npm run build`, then use `node /absolute/path/to/dist/index.js`.
## Tools
Each tool except `list_agents` takes an optional `agent` parameter. It lists the configured agents and defaults to the default agent.
| Tool | Purpose |
| --- | --- |
| `ask_agent(agent?, target?, message, contextId?, taskId?, skill?, input?, site?)` | Sends a message and waits until the task finishes, needs input, or `A2A_BRIDGE_ASK_TIMEOUT_MS` elapses. Returns the answer plus `agent`/`target`/`route`/`skill`/`site`/`organization`/`account`/`contextId`/`taskId`/`trace`. |
| `list_agents()` | Lists the configured agents with their skill names, sites and sign-in state (site URL, Atlassian cloud id, organization and account). Reads saved sign-ins and fetches public agent cards; it never signs in or sends credentials. |
| `list_agent_tasks(agent?, site?, unfinished?, refresh?, limit?)` | Lists the conversations this client started, newest first, kept across restarts: agent, site, title, `contextId`, and the last task's state, refreshed from the agent where a sign-in exists. |
| `get_agent_skills(agent?, target?)` | Lists the agent's skills from its card (including an authenticated extended card), with the input schema of skills that take structured input. |
| `get_agent_task(agent?, target?, site?, taskId, wait?)` | Checks a task that was still running. With `wait: true` it waits until the task finishes or needs input (up to the ask timeout), following the agent's stream where it streams, else polling. |
| `cancel_agent_task(agent?, target?, site?, taskId)` | Cancels a running task. |
To continue a conversation, pass the same `agent` and `contextId`. To answer a task in the `input-required` state, also pass `taskId`.
### Conversations and task lifecycle
The agent owns its tasks' lifecycle and is asked for their current state; the bridge only keeps its own side, in a private file next to the credentials (`_sessions.json`, shared by all bridge processes, kept for 30 days, at most 500 conversations):
- **Every conversation it starts is saved**: agent, site, routing (target, tenant, extension), the first 80 characters of the first message as a title, and each task's last known state. Follow-ups, `get_agent_task` and `cancel_agent_task` reuse it after a restart too, on the same site only, and `list_agent_tasks` lists them. Each MCP client lists only the conversations it started.
- **An answer goes to the waiting task**: a message with only the `contextId` of a conversation whose task waits for input (`input-required`, `auth-required`) is sent with that task's `taskId`, after the agent confirms (`GetTask`) that it still waits.
- **Listing never signs in**: `list_agent_tasks` refreshes states with saved or refreshable credentials only; a site whose sign-in has lapsed is shown as not refreshed.
- **An ended task is never resumed**: a message naming a task that completed, failed, was canceled or rejected starts a new task in the same conversation, as A2A requires (Jira's "retry via chat" works the same way).
- **Lost conversations are marked**: when the agent no longer knows a task (A2A `TaskNotFound`, e.g. after an app was reinstalled), the conversation is marked lost instead of being retried.
The answer's metadata explains such adjustments in a `note:` line.
### Sites: which Atlassian site answered
A Rovo sign-in is bound to the Atlassian site you pick on the consent screen. Every answer therefore names its site in the metadata block, for example:
```
agent: rovo
site: https://abc.atlassian.net
organization: 065fd618-…
account: Ada Lovelace (5eaf95b4…)
```
The bridge reads the site's cloud id, the organization id and the account id (`sub`) from the access token itself, and compares the cloud id with the site's public `https://<site>/_edge/tenant_info`. The account's display name comes from Atlassian's `https://api.atlassian.com/me` (the `read:me` scope Rovo sign-ins include); that is the only call besides the agent that carries the token, and only the id and name are kept. The result is stored next to the tokens, so this happens once per sign-in. Without a configured site, `login` asks which site you chose (in a terminal); otherwise answers show `site: cloud id …` until you add `sites` to the profile.
**Several sites.** Sign in to each one; each gets its own sign-in, and a site you've signed in to counts as one of the agent's sites (no profile change needed):
```bash
a2a-bridge login rovo --site abc.atlassian.net
```
```bash
a2a-bridge login rovo --site xyz.atlassian.net
```
Choose that site on Atlassian's consent screen. `login` checks that the site exists before opening the browser, then checks the token against it and drops a sign-in for another site. If a saved sign-in of the agent already belongs to the site (for example one made under a mistyped name), `login` reuses it instead of opening the browser. You can also list sites in the profile (`"sites": ["abc.atlassian.net", "xyz.atlassian.net"]`), for example to have them offered before you sign in; such a site signs in on first use. A sign-in made before sites existed counts as its site once the site is known (configured, or confirmed at `login`).
Sites can be custom domains (`login rovo --site jira.acme.com`); each is checked against its own `tenant_info`. A site is identified by its cloud id, so after a rename (or when switching to its custom domain), `login --site <new name>` moves the existing sign-in to the new name without signing in again, and the old name disappears.
`ask_agent` then picks the site from, in order: the `site` parameter (`abc`, `abc.atlassian.net` or a URL), the conversation's site for follow-ups (`contextId`/`taskId`), the only site, or the one configured site named in the message ("Ask Rovo on abc.atlassian.net …"). Otherwise the user is asked: through an MCP elicitation prompt where the client supports it, else the tool returns the list of sites and the model asks. A `site` that only one agent lists also picks that agent.
If a sign-in turns out to be for another site than the configured one, the bridge refuses to send the message, drops those tokens, and the next call opens the sign-in page again. An earlier single sign-in is moved to the matching site's credentials on first use, so you don't have to sign in again. Sites of non-Atlassian agents work the same way, as labels for separate sign-ins, without the check.
### Skills and structured input
A2A has no core field for choosing a skill yet ([a2aproject/A2A#1989](https://github.com/a2aproject/A2A/issues/1989)). The bridge follows the proposed standard, the data-only [Media Type Schemas extension](https://github.com/a2aproject/A2A/issues/2396) (`https://a2a-protocol.org/extensions/media-type-schemas/v1`). With it, an agent card publishes a schema for each structured media type and, per skill, a canonical input mode.
- `get_agent_skills` shows each skill and, where the card declares one, its structured input (and output) media type and schema. Inline schemas are shown; referenced ones are listed by URL and digest, not fetched.
- `ask_agent` with `skill` (and, for structured skills, `input`, a JSON object) asks for that skill:
- **typed**: if the skill has a canonical input mode and the agent speaks v1.0 or later, `input` is sent as a `data` part with that media type, next to the message text. The bridge activates the extension (so the agent can report non-conforming input) and lists the skill's canonical output mode first in `acceptedOutputModes`;
- **instruction**: otherwise the message starts with `Use your "<name>" skill (id <id>).`, and `input` follows as a JSON block.
- A skill applies to one message only. The answer's metadata says which way was used, for example `skill: quote (typed)`.
- The bridge does not validate `input` against the schema; the extension makes that the agent's job. A skill hint never grants extra permissions.
## Agent profiles
Profiles live in `~/.config/a2a-bridge-for-mcp-clients/agents.json`. Use `A2A_BRIDGE_PROFILES` to point elsewhere.
`a2a-bridge agents` lists what's configured.
```json
{
"default": "rovo",
"agents": {
"rovo": { "preset": "rovo" },
"helper": {
"description": "Internal helpdesk agent",
"cardUrl": "https://helper.example.com/.well-known/agent-card.json"
},
"keyed": {
"cardUrl": "https://agent.example.com/.well-known/agent-card.json",
"auth": { "type": "header", "name": "X-Api-Key", "valueEnv": "A2A_BRIDGE_SECRET_KEYED" }
},
"forge-app": {
"description": "A Forge app's agent exposed through apiRoute",
"endpoint": { "url": "https://api.atlassian.com/svc/jira/{cloudId}/apps/<app-id>_<env-id>/a2a", "version": "1.0" },
"streaming": false,
"sites": ["abc.atlassian.net"],
"auth": {
"type": "oauth",
"clientId": "<3LO client id>",
"clientSecretEnv": "A2A_BRIDGE_SECRET_FORGE_APP",
"authorizationEndpoint": "https://auth.atlassian.com/authorize",
"tokenEndpoint": "https://auth.atlassian.com/oauth/token",
"scopes": ["read:agent:custom", "read:forge-app:jira", "offline_access"],
"authorizeParams": { "audience": "api.atlassian.com", "prompt": "consent" }
}
}
}
}
```
| Field | Meaning |
| --- | --- |
| `preset` | `"rovo"` fills in Rovo's card, auth, quirk and hints. Other fields override it. |
| `cardUrl` | The agent card. It supplies the endpoint, protocol version, streaming support and OAuth hints. |
| `endpoint` | `{ url, version }` for agents without a public card. Overrides the card. The URL may contain `{site}` and `{cloudId}`, filled per site (see the `forge-app` example). |
| `streaming` | Overrides the card's streaming capability. |
| `auth` | Defaults to `{ "type": "oauth" }` (discovery + dynamic client registration). Options: `oauth` with optional `clientId`/`clientSecretEnv` (pre-registered client), `authorizationEndpoint` + `tokenEndpoint` (skips discovery), `scopes`, `issuer`, `resource`, `authorizeParams`, `redirectUri` (see [Callback URLs](#callback-urls)); `header` (`name` + `valueEnv`); `none`. |
| `quirks.streamDeltasWithoutAppend` | For agents that stream text deltas with `append: false` while the artifact is still open. The A2A spec says such chunks replace the text, so without this flag only the last chunk would remain. It's on for Rovo (its preset, or any profile whose endpoint host is `a2a.atlassian.com`) and off for everyone else. When a stream looks like this but the flag is off, the bridge logs a hint and keeps following the spec. |
| `forbiddenHint` | Advice appended to 403 errors. |
| `description` | Shown to the model in the tool description. |
| `targets` | Agents or sub-agents behind this endpoint, each with optional `agent`, `tenant`, `extension`, `instruction`, `metadata`, `aliases`, `keepAlias` and `description`. See [Addressing agents behind an endpoint](#addressing-agents-behind-an-endpoint). |
| `metadata` | Raw `message.metadata` added to every message to this agent (non-standard; see [Raw metadata](#raw-metadata)). |
| `sites` | Optional: sites (e.g. `abc.atlassian.net`) to sign in to separately; sites signed in to with `login --site` are added automatically. See [Sites](#sites-which-atlassian-site-answered). |
Secrets never go in the profile file. `clientSecretEnv` and `valueEnv` name environment variables, and those names must start with `A2A_BRIDGE_SECRET_`. That way a hostile profile can't send arbitrary environment secrets to its endpoint.
The `forge-app` entry illustrates a Forge app that exposes A2A JSON-RPC through `apiRoute` (a Forge Preview feature), a design that hasn't been tested end to end against Forge yet:
- **Per site.** An `apiRoute` URL belongs to one site, so the endpoint is a template: `{cloudId}` is filled from each site's public `tenant_info`, or use `https://{site}/gateway/api/svc/jira/apps/<app-id>_<env-id>/a2a` with `{site}`. Each site has its own sign-in (`login forge-app --site abc.atlassian.net`), and a site admin must enable the app's REST APIs in Connected apps first.
- **No public card.** Every `apiRoute` call needs a token, including a GET, so the card comes after sign-in. The bridge resolves it along a fallback chain, once per connection:
1. the profile's `cardUrl`, fetched publicly (only if the app publishes a card elsewhere, e.g. on the vendor's site);
2. `<endpoint>/.well-known/agent-card.json`, fetched with the agent's credentials, on the endpoint's origin only and without redirects (an app can serve it with a `GET` `apiRoute` next to `POST /a2a`). A2A's standard location is the domain root, which an `apiRoute` app cannot own, so this is a convention;
3. the authenticated extended card (A2A `GetExtendedAgentCard`, one more JSON-RPC method on the same `POST` route), when the card so far advertises it (`capabilities.extendedAgentCard`) or there is no card at all.
Cards from steps 2 and 3 supply skills, capabilities (including streaming) and descriptions; the endpoint and security schemes always come from the profile.
- **Polling.** Forge functions return a single response, so `streaming` is off; the agent should accept the message, return the task at once, and do the work asynchronously. Long tasks are followed with `get_agent_task` and `wait: true`, and survive restarts (see [Conversations](#conversations-and-task-lifecycle)).
#### Setting up OAuth 2.0 (3LO) for a Forge app's REST APIs
Forge app REST APIs are called with a pre-registered 3LO client (there is no dynamic client registration), following Atlassian's [Access REST APIs exposed by a Forge app](https://developer.atlassian.com/platform/forge/access-rest-apis-exposed-by-a-forge-app/):
1. **Enable the app's REST APIs** (site or organization admin, once per site): Atlassian Administration → **Apps** → **Sites** → *the site* → **Connected apps** → the Forge app → **View app details** → **App REST APIs**. They are off by default, and turning them off blocks the calls immediately.
2. **Create the 3LO client** (a member of that site) in the [developer console](https://developer.atlassian.com/console/myapps/): **Create** → **OAuth 2.0 integration**, then
- **Permissions** → **Add Marketplace or custom app** → choose the site, then the Forge app and environment, and select the scopes its documentation maps to the A2A routes (e.g. `read:agent:custom`). Add the Forge product scope too: `read:forge-app:jira` for Jira (`read:forge-app:confluence` for Confluence). Repeat for each site;
- **Authorization** → callback URL: the bridge's loopback listener `http://127.0.0.1:33418/callback` by default. If the console wants another form, set the same URL in the profile's `auth.redirectUri` (see [Callback URLs](#callback-urls));
- copy the client ID into `clientId`, and keep the secret for the next step.
3. **Provide the secret** in the environment variable that `clientSecretEnv` names (`A2A_BRIDGE_SECRET_FORGE_APP` above): in your shell for `login`, and in the `env` block of the bridge's entry in your MCP client's configuration. It is never written to disk, and it is only sent to the configured `tokenEndpoint`.
4. **Sign in per site:** `a2a-bridge login forge-app --site abc.atlassian.net`, choosing that site on the consent screen. `offline_access` gives a refresh token; the bridge refreshes (and rotates) it on its own afterwards.
`audience=api.atlassian.com` and `prompt=consent` in `authorizeParams` are required by Atlassian's 3LO. Not yet verified against a live Forge app: which callback forms the developer console accepts, and whether these tokens name their site the way Rovo's do (if not, the configured site is shown as a label but not checked against the token).
#### Callback URLs
The callback URL registered with the provider and the profile's `auth.redirectUri` must match. The bridge supports:
- **Loopback (default)**: `http://127.0.0.1:<port>/<path>`, `http://localhost:<port>/<path>` or `http://[::1]:<port>/<path>` ([RFC 8252](https://www.rfc-editor.org/rfc/rfc8252#section-7.3)). The bridge listens there itself, on loopback only; for `localhost` on both IPv4 and IPv6, since browsers may resolve it either way. Without `redirectUri` it is `http://127.0.0.1:<A2A_BRIDGE_CALLBACK_PORT>/callback`.
- **Paste mode**, for providers that only accept https: set `redirectUri` to an https URL the provider accepts, ideally on a domain you control. After consent the browser lands there (the page may show an error, which is fine); `login` then asks you to paste the address from the address bar, checks its `state` and `iss`, and exchanges the code. The code alone is useless without the PKCE verifier (and the client secret). Paste mode only works in the terminal `login`; in a chat the bridge says to run it.
A tunnel (ngrok and the like) is not needed and not recommended: it would expose the local listener to the internet during sign-in and let the tunnel provider see the authorization code.
## Addressing agents behind an endpoint
One A2A endpoint can front several agents or sub-agents. Declare them as `targets` of a profile, then address one by starting the message with **`/name`** or **`@name`** (the default aliases), as in `/billing why was I charged twice?`, or by passing **`target: "billing"`** to `ask_agent`.
```json
{
"agents": {
"hub": {
"cardUrl": "https://agents.example/.well-known/agent-card.json",
"metadata": { "traceSource": "my-laptop" },
"targets": {
"billing": { "description": "Billing agent" },
"memory": {
"extension": { "uri": "https://agents.example/ext/routing/v1", "data": { "agentId": "memory" } }
},
"helpdesk": { "instruction": "Helpdesk, please handle: {message}" },
"search": { "agent": "search-agent" }
}
},
"search-agent": { "cardUrl": "https://search.example/.well-known/agent-card.json" }
}
}
```
### How a target is reached
A2A has no standard metadata field for picking an agent. The bridge uses the standard mechanisms the receiving agent advertises and tries them in this order:
1. **Its own agent card or URL.** `"agent": "<profile>"` sends the message to another profile. This is the A2A recommendation: one card per agent.
2. **A v1.0 tenant.** If the card lists a `supportedInterfaces` entry whose `tenant` equals the target's `tenant` (default: the target's name), the bridge uses that interface's URL and sends `tenant` on every request of the task. Profiles with an explicit v1.0 `endpoint` (no card) trust a configured `tenant` as is. v0.3 has no tenants.
3. **A declared extension.** If the card's `capabilities.extensions` lists the target's `extension.uri`, the bridge activates it (the `A2A-Extensions` header, or `X-A2A-Extensions` for v0.3) and sends `extension.data` in `message.metadata` under `<uri>/<key>` keys.
4. **A text instruction.** Otherwise the message is rewritten with the target's `instruction` template (`{target}` and `{message}` placeholders; default `@{target} {message}`). Every agent reads text, so this is the fallback for agents such as Rovo that ignore metadata.
A configured route that the card does not advertise is skipped (the log says why) and the next one is tried. The answer's metadata block names the route used. Follow-ups that pass the returned `contextId` or `taskId` without a target, as well as `get_agent_task` and `cancel_agent_task`, reuse the same routing.
### Raw metadata
`metadata` on a profile or a target is added to `message.metadata` on every addressed or unaddressed message of that agent, whatever route applies (target values win over profile values). This is a non-standard, last-resort channel for routers that expect fields such as `agentId`; prefer an extension where you control the receiving side.
### Rules
- **Aliases are case-insensitive**, must start the message, and are removed from the text unless the target sets `"keepAlias": true`.
- **Custom aliases** go in `"aliases": ["/mem", "@memory"]`, which replace the defaults.
- **Unknown `/…` or `@…` prefixes** are sent unchanged, since they may be the receiving agent's own commands.
- **Aliases are unique across all profiles**, so an alias also selects its agent when `agent` is omitted.
- **Metadata is sent as-is** (up to 4 KB of JSON per object), so don't put secrets in it; secrets belong in `A2A_BRIDGE_SECRET_*` variables.
## How it works
1. **Endpoint.** Reads the agent card, or the profile's `endpoint`, to pick the JSON-RPC endpoint and the protocol version (v0.3, v1.0 or v1.1; later 1.x minors are spoken as 1.1). For v1.1 it sends `A2A-Version: 1.1`, reads the task `timeline` when there is no `history`, uses `generation` to tell task snapshots apart, records `messageUpdate` events, reports a `StreamError` as a failure, and skips stream payloads it does not know.
2. **OAuth discovery.** For OAuth agents, it reads RFC 9728 protected-resource metadata, then RFC 8414 authorization-server metadata, checking the issuer and resource. If that metadata is missing, it falls back to the card's `securitySchemes` and its DCR extension. A profile can also set the OAuth endpoints directly.
3. **Sign-in.** Registers a public client via dynamic client registration, unless the profile names a pre-registered client. Then it runs authorization code + PKCE (S256), with a loopback redirect to `http://127.0.0.1:33418/callback`.
4. **Streaming.** Uses `message/stream` (SSE) when the agent supports it. Streaming keeps each exchange in one request, which avoids per-conversation limits on asynchronous tasks (Rovo has one) and proxy timeouts. If the stream drops before the task settles, the bridge re-attaches with `SubscribeToTask` (`tasks/resubscribe` in v0.3) up to twice, then follows the task with `GetTask`. Otherwise it sends a non-blocking `message/send` and polls.
5. **Credentials.** Keeps credentials per agent in `~/.config/a2a-bridge-for-mcp-clients/credentials/<agent>[@<site>].json` (mode 0600). They are bound to the agent's issuer, token endpoint and A2A endpoint, refreshed automatically, and retried once after a 401.
6. **Retries.** Reading or cancelling a task and fetching metadata are retried up to 3 times on network errors, 429 and 502–504, with exponential backoff and jitter, honouring `Retry-After`. Sending a message is retried only on 429 (rate limited, normally not processed) with the same `messageId`, so an agent can recognise a duplicate; other failures could repeat an action and are not retried. Token requests are never retried. No retry outlives the request timeout.
7. **Tracing.** Each tool call runs in one [W3C Trace Context](https://www.w3.org/TR/trace-context/) trace: every A2A request carries a `traceparent` with its trace id and a fresh span id, and the answer's metadata shows `trace: <id>`, as do the bridge's log lines. A `traceparent` the MCP client sends in the request's `_meta` is continued.
8. **Card refresh.** Agent cards are re-read in the background after `A2A_BRIDGE_CARD_TTL_MS`, while the current connection keeps serving. A card that now names another endpoint origin or authorization server is not adopted until the MCP client restarts, and a saved sign-in is never replaced without an explicit `login`.
The bridge logs only to stderr; stdout carries the MCP protocol.
## Security
Agents may create, edit and delete content with your permissions, and their answers can quote text written by other people. Don't auto-approve `ask_agent`. Read [SECURITY.md](SECURITY.md) for the threat model, how credentials are protected, and how to report vulnerabilities.
## Configuration (env)
| Variable | Default |
| --- | --- |
| `A2A_BRIDGE_PROFILES` | `$XDG_CONFIG_HOME/a2a-bridge-for-mcp-clients/agents.json` (missing file = Rovo only) |
| `A2A_BRIDGE_CREDENTIALS_DIR` | `$XDG_CONFIG_HOME/a2a-bridge-for-mcp-clients/credentials` |
| `A2A_BRIDGE_CALLBACK_PORT` | `33418` (changing it re-registers dynamically registered clients) |
| `A2A_BRIDGE_ASK_TIMEOUT_MS` | `180000` |
| `A2A_BRIDGE_REQUEST_TIMEOUT_MS` | `120000` |
| `A2A_BRIDGE_LOGIN_TIMEOUT_MS` | `300000` |
| `A2A_BRIDGE_CARD_TTL_MS` | `3600000` (how long an agent card, and the endpoint and OAuth settings from it, is reused) |
| `A2A_BRIDGE_SESSIONS_FILE` | `<credentials dir>/_sessions.json` (saved conversations) |
| `A2A_BRIDGE_SECRET_*` | Secrets referenced by profiles |
Commands: `a2a-bridge [serve]`, `agents`, `login [agent] [--site <host>]`, `logout [agent] [--site <host>]` (without `--site`, `logout` forgets all of the agent's sign-ins), `help` (also `--help`, `-h`: commands, MCP tools, files and environment variables) and `--version`.
## Development
```bash
npm test # tsc --noEmit + node:test (runs the .ts sources directly; needs Node >= 22.18)
```
The integration test (`test/integration.test.ts`) starts a local A2A agent built on the official `@a2a-js/sdk` and drives the bridge through a real MCP client. It covers streaming and polling, v1.0 and v0.3, follow-ups, timeouts, the delta quirk and its hint, agent routing, skills with typed input, and API-key auth.
GitHub Actions (`.github/workflows/ci.yml`) runs the typecheck, the unit tests, the build and an MCP stdio smoke test on Node 22, 24 and 26. It runs on every push to `main` and on every pull request. Renovate (`renovate.json`) keeps dependencies and pinned actions up to date and raises vulnerability fixes immediately.
## Releasing
1. Bump `version` in `package.json` and both versions in `server.json` (a test checks they match). Date the version's heading in `CHANGELOG.md`.
2. Merge that to `main`, then tag and push: `git tag v0.2.0 && git push origin v0.2.0`.
3. The `Release` workflow checks the tag, versions and CHANGELOG, runs the tests, then:
- publishes to npm with provenance through trusted publishing (no npm token is stored);
- publishes `server.json` to the MCP Registry, logging in with GitHub's OIDC token;
- creates the GitHub release from the CHANGELOG section.
It skips any step whose result already exists, so a failed run can be re-run.
One-time setup: on npmjs.com, add a trusted publisher for this package (GitHub Actions, repository `kelemen-marton/a2a-bridge-for-mcp-clients`, workflow `release.yml`, environment `release`), and then disallow token-based publishing. If npm only allows that for an existing package, publish the first version from your machine with `npm publish --access public`. The tag run then skips npm and completes the other steps.
## Trademarks
Atlassian and Rovo are trademarks of Atlassian. This project is independent and isn't affiliated with, sponsored by or endorsed by Atlassian.
## License
[MIT](LICENSE)
TDQS
Scored across 6 tools
Each tool targets a clearly distinct object and action: agents are listed, skills are retrieved, tasks are listed/fetched/cancelled, and ask_agent initiates work. The closest overlap, list_agent_tasks versus get_agent_task, is cleanly separated by listing all contexts versus fetching one specific task. Descriptions explicitly cross-reference each other to prevent misselection.
All six tools use a consistent snake_case verb_noun pattern: list_agents, ask_agent, list_agent_tasks, get_agent_skills, get_agent_task, cancel_agent_task. The verbs are conventional and predictably scoped to agent or task resources.
Six tools are well-scoped for an A2A bridge: listing agents and skills, initiating tasks, and tracking/cancelling tasks. Every tool earns its place without redundancy or obvious missing surface area.
The task lifecycle is well covered: ask_agent creates/continues a task, list_agent_tasks and get_agent_task retrieve state, and cancel_agent_task stops work. Minor gaps exist, such as no explicit way to browse message history within a context or delete/archive completed contexts, but these are rarely blocking.