# tollbooth-shortlinks [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/lonniev/tollbooth-shortlinks  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/tollbooth-shortlinks

## Description
Ephemeral, human-friendly short URLs for Tollbooth MCP services

## Tools
Capabilities this server exposes over MCP:

- **create_shortlink** — Store a URL, get back a memorable slug (or supply your own)
- **resolve_shortlink** — Look up where a slug points without redirecting
- **delete_shortlink** — Remove a shortlink before it expires
- **shortlink_status** — Health check showing active link count and TTL

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "tollbooth-shortlinks": {
    "url": "https://api.schwab.com/v1/oauth/authorize?client_id=abc123&redirect_uri=https%3A%2F%2F"
  }
}
```

## Documentation

## What tollbooth-shortlinks does

tollbooth-shortlinks provides temporary short URLs for the Tollbooth ecosystem and other MCP workflows that need to pass around long URLs. A submitted URL is associated with a memorable slug, such as a four-word phrase, and the resulting full short URL is returned to the caller. Callers may also provide their own slug.

The service is designed for short-lived links, including OAuth authorization flows. Each mapping is retained for 24 hours before expiration. The project does not require credits, an npub, or a Tollbooth ledger to use its MCP tools.

## How it works

The MCP process writes and reads link mappings in a Neon Postgres database. `create_shortlink` inserts a URL and returns its slug and short URL; `resolve_shortlink` retrieves the destination without performing a redirect. `delete_shortlink` removes a mapping early, and `shortlink_status` reports the active-link count and configured time-to-live.

Redirect traffic is handled separately by the Val Town function in `val/redirect.js`. It reads the same Neon database, finds the slug, and responds with an HTTP 302 redirect. The redirect host defaults to `https://tollbooth.val.run`, while the MCP response includes the complete short URL so callers do not need to construct that host themselves.

Peer Tollbooth services can discover the service URL through the DPYC Oracle. Operators using `tollbooth-dpyc` can call the shortlink helper, which performs discovery and the request on a best-effort basis.

## Setup and configuration

Install the package with:

```bash
pip install -e ".[dev]"
```

Set `NEON_SHORTLINKS_URL` to a Neon Postgres connection string before starting the MCP process. `SHORTLINK_REDIRECT_BASE` optionally changes the host placed in generated short URLs; if omitted, the default is `https://tollbooth.val.run`.

Run the local MCP process with:

```bash
python -c "from server import mcp; mcp.run()"
```

The Val Town redirect handler must use the same `NEON_SHORTLINKS_URL` value. The repository also includes a `fastmcp.json` configuration prepared for `fastmcp deploy`.

## Tools and capabilities

- `create_shortlink`: Stores a destination URL and generates a memorable slug, or uses a caller-supplied slug.
- `resolve_shortlink`: Returns the destination associated with a slug without redirecting the requester.
- `delete_shortlink`: Deletes a shortlink before its automatic expiration.
- `shortlink_status`: Provides a health-oriented view of active links and their TTL.
- Automatic expiration: Removes links after 24 hours.
- HTTP redirection: The companion Val Town handler returns a direct 302 response without an interstitial page.

## Limitations and notes

Shortlinks are intentionally ephemeral rather than permanent. The MCP tools manage database records, while browser-facing redirects depend on the separate Val Town handler. Neon Postgres is required for shared storage between those components. The redirect base can be changed for generated URLs, but the handler and MCP service must be configured against the same database.

_Full upstream README: https://allmcps.com/mcp/tollbooth-shortlinks/readme_

