feat(cli,mcp): one operations catalogue renders both the CLI and the MCP tools - #45
Merged
Merged
Conversation
Add client.goLive.get() and client.accountReview.get/submit/resubmit/ requestAudit() so the CLI and the MCP tools can share one client for merchant onboarding. Types mirror the server's GoLiveReadiness and AccountReviewResponse; request bodies mirror SubmitAccountReviewDto and RequestAuditDto. BaseResource's protected get/post helpers become getJson/postJson so a resource can expose a public get() without an incompatible override. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
A session token (agenta login) can belong to several organizations, and the server resolves the one to act for from ?orgId=. The client option stamps it on every request so the CLI can use the SDK for go-live and account-review calls instead of its own fetch helper. API keys are org-bound and ignore it. Also exports the plan-change types the subscriptions resource already returns. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
…MCP tools
Whatever `agenta` can do, the MCP server can do, with the same names,
inputs and outputs, and neither can change without the other.
- ops/: one Operation per merchant action {name, description, zod input,
run(sdk, input), describe(result)}. Exactly today's CLI surface: status,
audit, verify, products, pay, subscriptions, customers, invoices. Every
operation calls the SDK only (no fetch, env or console); `describe` is
the merchant-facing text, money as "€29.00", dates as "22 Sep 2026".
- cli/from-operation.ts renders commander commands off the zod input:
positional id, --kebab flags, today's short flags kept (-n -a -c -d -o),
--no-download, enum values and defaults in --help. The go-live fetch
helper is gone: the CLI uses the SDK with the new orgId option. The
audit report and receipt downloads stay CLI-only side effects.
- mcp/tools/index.ts registers every operation as agenta_<group>_<op>
(registerAgentaTools; registerPayTools kept as an alias for one release)
returning describe() as text and the JSON as structuredContent. The
seven hand-written pay-*.ts tools are deleted. The Worker uses the new name.
- __tests__/parity.test.ts: for every operation the CLI resolves
`agenta <group> <op>`, the MCP server lists the tool, and both take
exactly the catalogue's input keys.
- Fixes a latent bug: `audit request --delivery` offered seven values,
the server accepts four.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
A key is bound to one org server-side and the guard ignores the query for keys; not sending it keeps the two credential modes distinct on the wire. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
…text Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
- cli/flags.ts: the flag spellings agentaos@3.0.0 published, keyed by input key (`-a, --amount <amount>`, `--to <linkId>`, `--limit <n>` with its printed default, `--description <text>` on the onboarding commands, `--no-download` with its own help line). The renderer uses them and generates `--kebab-case <value>` only for a flag no release promised. - Option help texts, command descriptions and subcommand order match 3.0.0 verbatim; `agenta status` keeps its usage line. The one remaining help difference is deliberate: `audit request --delivery` lists the four values the server accepts, not seven. - The session's org is resolved once (GET /orgs on first use) and stored in session.json next to the token; ensureSession returns it, connect() hands it to the SDK, and no command looks it up again. The change-plan test is back to exactly its 3.0.0 mocks. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
… for both surfaces Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
Merged
PancheI
pushed a commit
that referenced
this pull request
Sep 9, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @agentaos/pay@2.3.0 ### Minor Changes - [#45](#45) [`967b34f`](967b34f) Thanks [@PancheI](https://github.com/PancheI)! - Add `goLive.get()` and `accountReview.get/submit/resubmit/requestAudit()` so the CLI and the MCP tools share one client for onboarding. Add the `orgId` client option: a session-token user who belongs to several organizations names the one to act for, and it goes on every request as `?orgId=`. Export the plan-change types (`PlanChangePreview`, `ChangePlanParams`, `ChangePlanResult`, `PlanChangeDirection`, `PendingPlanChange`) that `subscriptions.previewPlanChange/changePlan` already return. ## agentaos@3.1.0 ### Minor Changes - [#45](#45) [`967b34f`](967b34f) Thanks [@PancheI](https://github.com/PancheI)! - The CLI and the MCP server are one operations catalogue: every command is a tool (19), with merchant-readable output on both. New tools: status, audit, verify, products, invoices; `registerAgentaTools` (alias `registerPayTools`). ### Patch Changes - Updated dependencies [[`967b34f`](967b34f)]: - @agentaos/pay@2.3.0 ## @agentaos/chains@3.1.0 ### Patch Changes - Updated dependencies []: - @agentaos/core@3.1.0 ## @agentaos/engine@3.1.0 ### Patch Changes - Updated dependencies []: - @agentaos/core@3.1.0 - @agentaos/crypto@3.1.0 ## @agentaos/sdk@3.1.0 ### Patch Changes - Updated dependencies []: - @agentaos/core@3.1.0 - @agentaos/engine@3.1.0 ## @agentaos/core@3.1.0 ## @agentaos/crypto@3.1.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The CLI and the MCP server had drifted: seven hand-written MCP tools against a CLI with status, audit, verification, products, checkouts, subscriptions, customers and invoices. Panche's rule: whatever the CLI can do, the MCP can do, managed as one thing so they cannot diverge again.
What
One operations catalogue (
packages/wallet/src/ops/, 19 operations) rendered into both surfaces:audit request --deliverynow lists the four values the server accepts, and the root banner gained example lines).agenta_<group>_<op>with the same schema; each returns a merchant-readable sentence ascontent(money as €29.00, dates, states as plain sentences) and the API JSON asstructuredContent.registerAgentaTools(aliasregisterPayToolsfor the Worker).@agentaos/pay, minor):goLive.get(),accountReview.get/submit/resubmit/requestAudit(), anorgIdoption for session users (sent for a session token only; a key never carries it, the server binds a key to its org), plan-change types exported.Verified
Unit: pay 121, wallet 153 (77 parity), Worker 9; typecheck and lint clean. Live against the local API: every CLI command with a session; eight operations through the stdio MCP server with a key (plain-language text confirmed). Changesets:
agentaosminor,@agentaos/payminor.After merge
Release workflow →
agentaos3.1.0 +@agentaos/pay2.3.0 →wrangler deployso mcp.agentaos.ai serves the 19 tools.🤖 Generated with Claude Code
https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1