Skip to content

Latest commit

 

History

History
94 lines (67 loc) · 3 KB

File metadata and controls

94 lines (67 loc) · 3 KB

Testing the examples locally — one by one

Repo is at ~/example-implementations, branch feat/agentcard-for-companies. Deps are installed and each folder has a .env with your live Agentcard prod token already filled in (.env is gitignored).

The 9 folders:

photon  sendblue  loopmessage  linq  bluebubbles  twilio  respond-io  hermes  vercel-chat-sdk

There are two independent things to test per folder:

  • A — Agentcard for companies (the new work): clientId + OAuth + MCP → issue a card.
  • B — the messaging agent: chat with the Claude brain in your terminal.

A launcher is provided: ./try.sh <folder> [card|test|chat].


A. Agentcard — the feature you asked for

A1. Offline tests (free, no credentials) — run this per folder

cd ~/example-implementations
./try.sh twilio test          # or any folder

Exercises all three parts against mock servers: PKCE (challenge == S256(verifier)), the token exchange, and the MCP create_card flow incl. the approval gate. Expect 9 pass for the agentcard file (and the folder's other suites green).

A2. Live card against PROD (issues a REAL $1 card)

./try.sh twilio card

This runs bun run agentcard:demo:

  1. prints the company client_id step,
  2. uses the AGENTCARD_ACCESS_TOKEN from .env (skips the browser),
  3. connects to https://mcp.agentcard.sh/mcp, lists the tools, and issues one real $1.00 card (auto-approving the account's approval gate).

⚠️ Each run issues a real card funded by your saved payment method. The Agentcard module is byte-identical in all 9 folders, so you only need to run card on one folder to prove it end-to-end — no need to mint 9 cards. (I already verified prod once: card cmqtude7k…, •••• 3013, $1.00, OPEN.)

To browser-test the full OAuth flow instead of using the saved token, first register a client and drop the id in that folder's .env:

agent-cards-admin login        # magic link to your email (one time)
agent-cards-admin oauth-clients create --org <org> --name "Test" \
  --redirect-uri http://localhost:8910/callback
# put the printed Client ID in .env as AGENTCARD_OAUTH_CLIENT_ID, then:
#   (remove AGENTCARD_ACCESS_TOKEN from .env so it runs interactive OAuth)
./try.sh twilio card

B. The messaging agent (terminal chat)

Needs your Anthropic key. Set it once for the shell, then it works in every folder:

export ANTHROPIC_API_KEY=sk-ant-...    # from https://console.anthropic.com

Then, per folder:

./try.sh photon chat
# you> hi
# bot> ...
# (Ctrl-C to quit, move to the next folder)

photon runs on Spectrum; the other 8 run the shared brain + terminal provider. Going live on a real messaging surface (iMessage/SMS/etc.) additionally needs that vendor's credentials + a public webhook — see each folder's README.


Run everything's offline suite at once

cd ~/example-implementations
bun run test          # all 9 folders, offline   → expect "ALL PASS"