Skip to content

feat(transports): an app declares how agents reach it (CLI, MCP, HTTP) - #45

Closed
ahmad-ajmal wants to merge 1 commit into
mainfrom
feat/transports
Closed

ahmad-ajmal wants to merge 1 commit into
mainfrom
feat/transports

Conversation

@ahmad-ajmal

Copy link
Copy Markdown
Collaborator

An app can now say how agents should reach it: CLI, MCP or HTTP, in order. CLI stays first unless someone asks otherwise. This is the first of a series. It adds the declaration and the rule for choosing; the MCP endpoint itself is the next PR.

What changes

  • Declaration. manifest.json may carry "transports": ["cli", "mcp", "http"]. The first is the app's primary channel and the rest are fallbacks. Absent means that order. Entries are kinds only, never addresses, so a declaration can't send a credential to another host.
  • Choosing. Agents use the first transport they can reach: CLI if a2app runs, MCP if the harness already has the app's server connected, HTTP if they can send requests. With no CLI and both others available, MCP wins, because the harness then holds the token. A refusal (401, 403, 428, guard error) is the app's answer on every transport.
  • Discovery. The identity schema gains optional transports and mcpUrl. mcpUrl is used only as a path on the origin already reached.
  • Framework. agent-app validate checks the key. It is app-owned and the builder may edit it, so toolkit-sync keeps it and it isn't hash drift. scaffold --transport cli|mcp|http puts one first (default cli). agent-app inspect reports the order.
  • CLI. Arriving at an app that asks for another transport first says so on stderr. Nothing else changes.
  • Agents. The operator skill gains "Choosing the transport" and a recipe for plain HTTP. The connect and creator skills, the scaffolded AGENTS.md, /agent-app and the README follow.

Spec: spec/v0_2/transports.md. The schema changes are optional fields, so a 0.2 app without them still conforms.

Existing apps

Nothing changes for an app with no transports, or with an adapter that predates it: agents use the CLI, then HTTP. No adapter publishes the new identity fields until the next PR.

Tests

  • New framework/cli/test/transports.test.mjs: good and bad declarations (addresses included), the order, mcpUrl values that point elsewhere, scaffold, gate, drift, toolkit-sync, and arriving by CLI end to end.
  • manifest-merge and install tests updated for the new key.
  • pnpm -r build, typecheck and test pass on Windows, Node 24. Conformance 87/87. The PocketBase e2e is skipped without POCKETBASE_BIN, and is not touched here.

…ose by that order

manifest.json may carry `transports`, an ordered list of cli, mcp and http. The
first is the app's primary channel and the rest are fallbacks; without it the
order is cli, mcp, http. Entries are kinds, never addresses. The gate checks it,
the builder may edit it, toolkit-sync keeps it, `scaffold --transport` puts one
first, and inspect reports it.

Identity gains optional `transports` and `mcpUrl` (published by adapters in a
later change). Arriving by CLI at an app that asks for another transport first
says so. Skills, AGENTS.md and the README say how to choose, and how to operate
over plain HTTP when there is no CLI.

Spec: spec/v0_2/transports.md.
@ahmad-ajmal

Copy link
Copy Markdown
Collaborator Author

Replaced by #56, with the same code. The branch is kept.

@ahmad-ajmal
ahmad-ajmal deleted the feat/transports branch December 2, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant