OAuth2 Authorization Code Collector

v0.2.16
io.github.lonniev/tollbooth-oauth2-collector Checked 11 hours ago Published 5 days ago

Unauthenticated OAuth2 callback collector for Tollbooth MCP services

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

store_code Store Code

Store a sealed OAuth2 authorization code. Called by the serverless callback function after the browser redirect. The ``state`` carries the patron npub, the operator npub (the PUBLIC key the code is sealed to) and the flow's one-time secret — see the SDK's ``pack_oauth_state``. The code is sealed with NIP-44 to the operator so only that operator's nsec can open it. The Neon row is keyed by ``oauth_code_key(state)`` (patron npub + secret), so only the flow that holds the secret finds it: a link someone else built with a patron's npub files its code where that patron's flow never looks.

ParameterTypeDescription
code *stringThe authorization code from the OAuth provider.
state *stringThe packed state (``patron_npub.operator_npub.secret``).

retrieve_code Retrieve Code

Retrieve a stored authorization code (one-time read, auto-deleted). Called by the originating MCP server to pick up the code after the user has authorized in the browser. Returns the encrypted code which the caller decrypts using the same state token.

ParameterTypeDescription
state *stringWhere the code was filed: patron npub + the flow's secret (the SDK's ``oauth_code_key`` of the authorization state).

collector_status Collector Status

Health check — shows the number of pending authorization codes and TTL.

service_status Service Status

Report the running build so a redeploy can be verified. Free. Delegates to the SDK's canonical ``build_service_status`` — the single source of the service_status payload shape — so this collector reports the same envelope as every other DPYC service. The load-bearing field is ``build_info.fastmcp_cloud_git_commit_sha``: the commit Horizon actually deployed. The post-merge deploy-verify probe reads it to confirm the live service redeployed the merged sha; with no ``service_status`` tool to probe, that sha reads as ``<none>`` and an otherwise-healthy deploy is flagged as "did not land". Th…