Skip to content

feat: device-code CLI login, MCP payment tools, CLI restructure#14

Merged
PancheI merged 2 commits intomainfrom
feature/mcp-payment-tools-cli
Mar 25, 2026
Merged

feat: device-code CLI login, MCP payment tools, CLI restructure#14
PancheI merged 2 commits intomainfrom
feature/mcp-payment-tools-cli

Conversation

@PancheI
Copy link
Contributor

@PancheI PancheI commented Mar 25, 2026

Summary

  • Device-code login: agenta login opens browser for auth + wallet activation, CLI polls and receives JWT
  • MCP payment tools: 3 new tools registered (create_checkout, get_checkout, list_checkouts)
  • CLI restructure: Sub-account commands grouped under agenta sub, help text reorganized
  • Auto-refresh: ensureSession() handles JWT expiry + scope upgrades transparently
  • SDK dual auth: @agentaos/pay auto-detects JWT vs API key

Changes

CLI (packages/wallet)

  • login.command.ts — device-code flow with browser approval + immediate token refresh
  • status.command.ts — full account overview (email, org, wallet, JWT, readiness, next steps)
  • pay.command.ts — new: checkout, get, list commands
  • init.command.ts — uses ensureSession() + session server URL
  • index.tsagenta sub namespace for sub-account commands
  • ensure-session.ts — new: auto-refresh, scope upgrade detection

MCP (packages/wallet/src/mcp)

  • pay-create-checkout.ts, pay-get-checkout.ts, pay-list-checkouts.ts — new tools
  • pay-utils.ts — shared SDK client factory
  • index.ts — all 3 tools registered (21 total)

SDK (packages/pay)

  • types.tssupportedNetworks on CreateCheckoutParams
  • client.ts — JWT auto-detection
  • fetch.ts — dual auth header support

Test plan

  • agenta login --server http://localhost:8080 works end-to-end
  • agenta status shows account info (logged in + not logged in)
  • agenta pay checkout -a 50 creates checkout
  • agenta sub init works with ensureSession
  • MCP server lists 21 tools (test updated)
  • No sensitive info committed (verified)

Aligns SDK types with server change - x402Url is now returned
on checkout sessions (the payable resource), not payment links
(templates).

- Remove x402Url from PaymentLink interface
- Add x402Url to Checkout interface
- Update README to document x402Url on checkouts
@PancheI PancheI force-pushed the feature/mcp-payment-tools-cli branch 6 times, most recently from 2a46173 to 84d19fe Compare March 25, 2026 22:45
CLI:
- Device-code login: agenta login opens browser, polls for approval
- Auto-refresh JWT on expiry or setup scope upgrade
- agenta status: full account overview (email, org, wallet, JWT, readiness)
- agenta sub: all sub-account commands grouped (init, send, balance, etc)
- agenta pay: checkout/get/list commands with JWT auth
- Legacy OTP login kept as --legacy flag

MCP:
- agenta_pay_create_checkout registered
- agenta_pay_get_checkout registered
- agenta_pay_list_checkouts registered

SDK (@agentaos/pay):
- Dual auth: auto-detect JWT vs API key
- supportedNetworks field on CreateCheckoutParams
@PancheI PancheI force-pushed the feature/mcp-payment-tools-cli branch from 84d19fe to a2c0a56 Compare March 25, 2026 22:59
@PancheI PancheI merged commit bc863ef into main Mar 25, 2026
1 check passed
@PancheI PancheI deleted the feature/mcp-payment-tools-cli branch March 25, 2026 23:03
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