Developers

Connect turl.ca to your MCP client

Shorten and manage links from the REST API, an AI agent, or your scripts.

Developer guide

MCP for AI agents

turl.ca runs a Model Context Protocol server at https://turl.ca/mcp, so Claude Desktop, Cursor, the MCP Inspector, and other agents can shorten and manage links directly.

Add https://turl.ca/mcp as a remote MCP server in your client, then sign in with your Pastebin.ca account.

In Claude, open Customize → Connectors → Add → Custom → Web, enter the URL and use Claude’s published identity when prompted.

Try it List my three most recent short links and show their destinations.

Option B — API-key bearer (automation)

For headless use, send a minted key directly:

{
  "mcpServers": {
    "turl": {
      "url": "https://turl.ca/mcp",
      "headers": { "Authorization": "Bearer pbca_live_…" }
    }
  }
}
pbca account api-key create \
  --scopes link:read,link:create,link:delete \
  --audience https://turl.ca

Tools

ToolScopePurpose
whoami—Echo account id, scopes, audience, and token kind.
create_linklink:createShorten a URL; returns resolution, trust reason, safety state, and expiry.
get_linklink:readFetch one link with its current resolution behavior.
list_my_linkslink:readList links with current resolution behavior; cursor-paginated.
delete_linklink:deleteRetire one of the caller's links.

OAuth & DPoP

pastebin.ca is the OAuth authorization server; turl.ca is a protected resource and never mints tokens.

  • OAuth tokens are audience-bound to https://turl.ca/mcp (RFC 8707) and honored only on the MCP route.
  • If a key is DPoP-bound (RFC 9449), every MCP request must carry a matching ES256 proof; replays are rejected. Plain bearer keys work without DPoP.
  • Revoke a key or connected app anytime from your pastebin.ca account.

Discovery

DocumentURL
OpenAPI 3.1/api/v1/openapi.json
Agent card/.well-known/agent.json
MCP protected resource/.well-known/oauth-protected-resource/mcp
LLM site map/llms.txt