Server data from the Official MCP Registry
Tollbooth Authority — Certified Purchase Order Service for DPYC operators
Tollbooth Authority — Certified Purchase Order Service for DPYC operators
Remote endpoints: streamable-http: https://tollbooth-authority.fastmcp.app/mcp
Tollbooth Authority is a well-structured MCP server with appropriate security architecture. The codebase delegates sensitive operations (tool definitions, crypto signing, auth verification) to the vetted wheel dependency `tollbooth-dpyc`, minimizing local attack surface. All tools requiring identity verification enforce proof validation. Permissions are appropriate for the server's purpose (payment processing, Nostr signing, registry lookups). Minor findings relate to test mock construction and HTTP error handling, which do not affect production security. Supply chain analysis found 7 known vulnerabilities in dependencies (1 critical, 3 high severity).
7 files analyzed · 10 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Available as Local & Remote
This plugin can run on your machine or connect to a hosted endpoint. during install.
From the project's GitHub README.
The institution that built the infrastructure.
The metaphors in this project are drawn with admiration from The Phantom Tollbooth by Norton Juster, illustrated by Jules Feiffer (1961). Milo, Tock, the Tollbooth, Dictionopolis, and Digitopolis are creations of Mr. Juster's extraordinary imagination. We just built the payment infrastructure.
Every turnpike has an authority. Not the operators who run the booths, and not the drivers who pay the fares — but the institution that poured the concrete, erected the signs, and stamped the purchase orders.
The Tollbooth Authority is the Massachusetts Turnpike Authority of the Lightning economy. It doesn't operate any toll booths. It doesn't touch operator BTCPay stores. It never sees user payment data. What it does is simpler and more essential:
The Authority's signature is the proof that the turnpike is legitimate. Without the stamp, the toll booth doesn't open.
As of v0.9.0, this Authority is an ~80-line thin consumer of the tollbooth-dpyc wheel. Every piece of generic Authority code — onboarding state machine, Schnorr certificate signer, replay tracker, Neon tenant provisioner, and the full 10-tool MCP surface — lives in the wheel's tollbooth.authority package. This repo's server.py supplies only actor-specific configuration: identity name, human-readable instructions, OperatorRuntime construction, and two register_*_tools(mcp, runtime) calls.
# The entire server.py, distilled
from fastmcp import FastMCP
from tollbooth.authority import (
AUTHORITY_TOOL_REGISTRY,
OPERATOR_CREDENTIAL_TEMPLATE,
register_authority_tools,
)
from tollbooth.runtime import OperatorRuntime, register_standard_tools
from tollbooth.tool_identity import STANDARD_IDENTITIES
mcp = FastMCP("tollbooth-authority", instructions="…")
runtime = OperatorRuntime(
tool_registry={**STANDARD_IDENTITIES, **AUTHORITY_TOOL_REGISTRY},
purchase_mode="direct", # Authority is its own trust root
ots_enabled=True,
operator_credential_template=OPERATOR_CREDENTIAL_TEMPLATE,
)
register_standard_tools(mcp, "authority", runtime, ...)
register_authority_tools(mcp, runtime)
Refactor history:
OperatorRuntime and delegated standard tools to the wheel — ~1,900 lines → ~970._verify_operator_proof helper was promoted to wheel-side tollbooth.identity_proof.require_proof.tollbooth.authority.*.@tool definitions into register_authority_tools(mcp, runtime).0.4.0 releases.The Tollbooth ecosystem is a three-party protocol spanning three repositories:
| Repo | Role |
|---|---|
| tollbooth-authority (this repo) | The institution — fee collection, Schnorr signing, purchase order certification |
| tollbooth-dpyc | The booth — operator-side credit ledger, BTCPay client, tool gating |
| thebrain-mcp | The first city — reference MCP server powered by Tollbooth |
The three-party protocol above is the core, but the Authority certifies a wider federation of independent MCP services, all built on the same tollbooth-dpyc SDK:
| Repo | Role |
|---|---|
| tollbooth-dpyc | Shared SDK — crypto, vault, auth, pricing, audit |
| dpyc-community | Governance registry — members.json, GOVERNANCE.md, CI validation |
| dpyc-oracle | Free community concierge — membership, governance, onboarding answers |
| tollbooth-authority | This repo — certification backbone, Schnorr certs, fee ledger |
| tollbooth-sample | Reference template for new operators |
| tollbooth-pricing-studio | Pricing editor — native iOS, Nostr DMs |
| cypher-mcp | Monetized graph answers — named Cypher over Neo4j/AuraDB |
| schwab-mcp | Charles Schwab brokerage data |
| thebrain-mcp | TheBrain knowledge-graph access |
| excalibur-mcp | X/Twitter posting |
| taxsort-mcp | Tax sorting + classification |
| optionality-mcp | Options analytics |
| tollbooth-oauth2-collector | Shared OAuth2 callback collector (community Advocate) |
| tollbooth-shortlinks | URL shortener utility |
Register. An operator connects to the Authority via Horizon MCP and calls register_operator(npub=...). The Authority creates a ledger entry and provisions an isolated Neon schema for the operator.
Fund. The operator calls purchase_credits with the number of sats they want to pre-fund. The Authority returns a Lightning invoice from its own BTCPay Server. The operator pays. After settlement, check_payment credits the balance.
Certify. When a user wants to buy credits from an operator, the operator's server calls certify_credits. The Authority deducts the 2% ad valorem fee (via the @runtime.paid_tool decorator), signs a Schnorr-based Nostr event certificate, and returns it.
Verify. The operator's tollbooth-dpyc library verifies the certificate using the Authority's Nostr npub. Only if the stamp is valid does the operator create a Lightning invoice for the user. No stamp, no fare.
Certificates are Schnorr-signed Nostr events (NIP-33 parameterized replaceable events) rather than Ed25519 JWTs. Each certificate contains the operator npub in a p tag, the certified amount and protocol in t/L tags, an expiration tag, and the content field holds the structured claim data. Verification uses BIP-340 Schnorr signatures against the Authority's Nostr npub.
The Authority checks the dpyc-community members.json registry at certification time. Operators must have "status": "active" in the registry. The registry is HTTP-cached with a configurable TTL. Design is fail-closed: if the registry is unreachable, certification is denied.
Parent Authority relationships live in the dpyc-community registry — each Authority's upstream_authority_npub points at its sponsor. Operator MCPs resolve their certifying Authority via resolve_authority_service(operator_npub) walking that registry chain; no per-Authority env var configures the upstream. The Authority's own certify_credits simply collects the ad valorem fee from its operator's pre-funded balance and signs the certificate — no per-transaction upstream call.
certify_credits is registered as a @runtime.paid_tool with 2% ad valorem pricing on the amount_sats parameter (minimum 10 sats). The fee is debited by the decorator, and the cost is read from runtime._last_debit_cost — no double computation.
OpenTimestamps notarization is enabled (ots_enabled=True on the runtime). Ledger state can be notarized and verified through the standard notarize_ledger and get_notarization_proof tools provided by the wheel.
Every certificate includes a unique JTI (JWT ID). The Authority tracks seen JTIs in an in-memory ordered dict with TTL-based pruning. This prevents certificate replay attacks even if a certificate is intercepted before expiration.
All tools are now wheel-defined and registered by the two register_*_tools calls in server.py. For the full canonical tables (Authority tools mounted by register_authority_tools, standard tools mounted by register_standard_tools) see the tollbooth-dpyc README. The short version:
register_authority_tools(mcp, runtime). This set also includes the owner-side deferred-adoption courtship flow added in tollbooth-dpyc 0.45.x — receive_adoption_request, list_adoption_requests, approve_adoption, and reject_adoption (an operator requests adoption; the Authority owner reviews and approves or rejects) — plus repair_operator_schema (owner repair of a tenant's table ownership).register_standard_tools(mcp, "authority", runtime, ...).Every tool that accepts npub requires a non-empty proof parameter and verifies it via tollbooth.identity_proof.require_proof (wheel v0.19.0+). No exceptions, no fallbacks.
The Authority runs on FastMCP Cloud. Any MCP client (Claude Desktop, Cursor, your own agent) can connect via Horizon:
https://www.fastmcp.cloud/server/lonniev/tollbooth-authority
Authentication is automatic — Horizon OAuth identifies you as an operator. No API keys to manage.
Once connected, walk through the bootstrap in order:
register_operator(npub="npub1...") — Creates your ledger entry and provisions a Neon schema. Returns your npub, balance, and Neon URL.purchase_credits(amount_sats=1000) — Returns a Lightning invoice. Pay it with any Lightning wallet.check_payment(invoice_id="...") — Pass the invoice ID from step 2. Confirms settlement and credits your balance.check_balance — Verify your balance is funded.operator_status — See your registration, balance, vault backend, and the Authority's public key (you'll hardcode this in your tollbooth-dpyc integration).To run your own Authority instance, set these environment variables:
| Variable | Purpose | Example |
|---|---|---|
NEON_DATABASE_URL | Neon Postgres URL for persistent operator ledgers. The Authority IS the trust root -- it reads this from env (unlike certified operators, which bootstrap it from Authority via Nostr DM). At startup, the Authority injects search_path=authority into the connection string for per-schema isolation. | postgresql://... |
TOLLBOOTH_NOSTR_OPERATOR_NSEC | Nostr secret key (nsec) for Schnorr certificate signing and Secure Courier DMs | nsec1... |
BTCPay credentials are delivered via Secure Courier, not set as environment variables:
| Credential | Description |
|---|---|
btcpay_host | Authority's BTCPay Server URL for fee collection |
btcpay_api_key | BTCPay API key with invoice + payout permissions |
btcpay_store_id | BTCPay store ID for the Authority's fee store |
| Variable | Purpose | Default |
|---|---|---|
TOLLBOOTH_NOSTR_RELAYS | Comma-separated relay URLs | built-in defaults |
TOLLBOOTH_NOSTR_AUDIT_ENABLED | Enable NIP-78 audit trail on vault writes | false |
CERTIFICATE_TTL_SECONDS | How long a signed certificate remains valid | 600 (10 min) |
DPYC_ENFORCE_MEMBERSHIP | Enable registry enforcement at certification time | true |
DPYC_REGISTRY_CACHE_TTL_SECONDS | How long to cache the DPYC community registry | 300 |
Each registered operator receives an isolated Neon schema (op_{hash}) with a dedicated Postgres LOGIN role. The Authority schema (authority) holds the Authority's own ledger. Operator schemas are provisioned automatically by register_operator and access is enforced via role-based grants -- no cross-operator data access is possible.
Legacy deployments may still use THEBRAIN_API_KEY, THEBRAIN_BRAIN_ID, and THEBRAIN_VAULT_THOUGHT_ID environment variables for TheBrain-based vault storage. These are superseded by NeonVault and will be removed in a future release.
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -q
The Authority signs certificates with a Nostr nsec/npub keypair. Generate one using any Nostr key generator (e.g., nak key generate). The nsec goes in TOLLBOOTH_NOSTR_OPERATOR_NSEC; the npub is surfaced via operator_status for tollbooth-dpyc verification.
Each Authority has a Nostr keypair that identifies it on the DPYC Certification Chain:
pip install nostr-sdk
python -c "from nostr_sdk import Keys; k = Keys.generate(); print(f'npub: {k.public_key().to_bech32()}'); print(f'nsec (back up!): {k.secret_key().to_bech32()}')"
The Phantom Tollbooth on the Lightning Turnpike — the full story of how we're monetizing the monetization of AI APIs, and then fading to the background.
Apache License 2.0 — see LICENSE and NOTICE for details.
Because every turnpike needs an authority. Not to control the road — just to make sure the stamps are real and the fares are fair.
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.