Tollbooth Shortlinks

io.github.lonnievv0.1.0更新於 Oct 6, 2026

Ephemeral, human-friendly short URLs for Tollbooth MCP services

已驗證Streamable HTTP可網頁執行Developer ToolsProductivity & Workflow

概覽

AI 產生的概覽

建立、解析與刪除 24 小時後過期的臨時四詞短網址,主要用於 OAuth 授權連結。

功能
Tollbooth Shortlinks 把長網址變成好記的四詞短語(例如 brave-otter-finds-gold),將對應關係存入 Neon Postgres,並在 24 小時後過期。工具包括 create_shortlink(存入網址並取得短網址,也可自行指定)、resolve_shortlink(不重新導向直接查詢短網址指向)、delete_shortlink(在過期前刪除短網址)以及 shortlink_status(顯示有效連結數與 TTL 的健康檢查)。搭配的 HTTP 處理器執行無中間頁面的 302 重新導向。
適用情境
當助理或 MCP 伺服器需要把簡短、方便複製貼上的網址交給使用者時使用,特別適合一次性 OAuth 授權流程中冗長的查詢字串。它是無商業化的免費社群工具,適合臨時連結,而非永久或帶追蹤的連結。
執行需求
清單宣告為遠端 streamable HTTP 端點,不需要驗證、環境變數或標頭。若改在本地執行,則需要 Python、從原始碼安裝此套件,以及 NEON_SHORTLINKS_URL 的 Postgres 連線字串;部署使用 fastmcp 設定檔。
安裝前請注意
連結是臨時的,會在 24 小時後無聲過期,不應用於需要長期保存的內容。建立與刪除工具會寫入及移除共享 Postgres 儲存中的資料,知道短網址的人都能解析它。本地執行需要 NEON_SHORTLINKS_URL 資料庫憑證,應妥善保密。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tollbooth Shortlinks,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "tollbooth-shortlinks": {
      "type": "http",
      "url": "https://tollbooth-shortlinks.fastmcp.app/mcp"
    }
  }
}

README

Tollbooth Shortlinks

[License] [Version] [Python]

Don't Pester Your Customer™ (DPYC™) — Ephemeral, human-friendly short URLs for the Tollbooth ecosystem.

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.


Why This Exists

OAuth Authorization URLs are long, ugly, and hostile to copy-paste:

https://api.schwab.com/v1/oauth/authorize?client_id=abc123&redirect_uri=https%3A%2F%2Ffastmcp.cloud%2Foauth%2Fcallback%3Fserver_id%3D...&scope=...&response_type=code&state=...

Traditional link shorteners have become opinionated. They inject interstitial pages, track clicks, require accounts, gate features behind paywalls, or silently expire links on their own schedule. When an MCP server needs to hand a patron a one-time URL for an OAuth dance, none of that belongs in the path.

Tollbooth Shortlinks is a community utility with no monetization. It turns any URL into a memorable four-word phrase like brave-otter-finds-gold, stores the mapping in Neon Postgres, and expires it after 24 hours. A companion Val Town HTTP handler does the 302 redirect with zero interstitial.

How It Works

MCP Server                    Shortlinks MCP              Val Town    |                              |                         |    |-- create_shortlink(url) ---->|                         |    |<-- brave-otter-finds-gold ---|                         |    |                              |                         |    |  (patron clicks short URL)   |                         |    |                              |    GET /brave-otter-..  |    |                              |<------------------------|    |                              |    Neon lookup           |    |                              |-- 302 redirect -------->|    |                              |                         |    |        (24h later)           |                         |    |                              |  link expires silently   |

Tools

ToolDescription
create_shortlinkStore a URL, get back a memorable slug (or supply your own)
resolve_shortlinkLook up where a slug points without redirecting
delete_shortlinkRemove a shortlink before it expires
shortlink_statusHealth check showing active link count and TTL

All tools are free -- no credits, no npub, no Tollbooth ledger required.

Install

bash
pip install -e ".[dev]"

Run Locally

bash
export NEON_SHORTLINKS_URL="postgres://user:[email protected]/shortlinks"python -c "from server import mcp; mcp.run()"

Deploy to Horizon

The .fastmcp.yaml at the repo root is ready for fastmcp deploy.

DPYC Identity

Tollbooth Shortlinks is registered as an Advocate in the DPYC Social Contract. Peer MCP servers discover its URL via registry lookup:

python
from tollbooth import resolve_service_by_name
shortlinks_url = resolve_service_by_name("tollbooth-shortlinks")redirect_base  = resolve_service_by_name("tollbooth-shortlinks-redirect")

Related Repos

The Tollbooth DPYC™ ecosystem:

RepoRole
tollbooth-dpycThe wheel -- operator-side credit ledger, BTCPay client, tool gating, constraint engine
tollbooth-authorityThe institution -- fee collection, Schnorr signing, purchase certification
dpyc-oracleThe oracle -- Social Contract governance, membership, ban elections
dpyc-communityThe registry -- governance data, operator catalog, community rules
tollbooth-sampleReference operator -- weather API with full Tollbooth wiring
cypher-mcpMonetized graph answers -- named Cypher over Neo4j/AuraDB
schwab-mcpCharles Schwab brokerage MCP -- trading, quotes, portfolio access
excalibur-mcpeXcalibur -- formatted posting to X (Twitter)
thebrain-mcpPersonal Brain MCP -- thought graphs, knowledge management
taxsort-mcpTax sorting and classification MCP
optionality-mcpOptions analytics MCP
tollbooth-shortlinks (this repo)Community utility -- ephemeral short URLs for OAuth flows
tollbooth-oauth2-collectorOAuth2 callback collector -- browser-based token exchange
tollbooth-pricing-studioiOS app -- operator dashboard and pricing model editor

License

Apache-2.0. See LICENSE for details.

來源:README.md,提交 401e943

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026