Technology

URL Shortener MCP Server: Manage Links From Claude & Cursor

Sinkto.Link's hosted MCP server gives AI agents 11 tools for short links, QR codes and click analytics. Connect Claude Code, Cursor or any client in 2 min.

K
Kelvin Kwong
14 min read

Sinkto.Link, the free URL shortener, now ships a hosted MCP server: a single endpoint that lets Claude Code, Claude.ai, Cursor, or any other Model Context Protocol client create short links, edit them, generate QR codes, and read your click analytics — without you touching the dashboard. There is nothing to install and nothing to self-host. You paste one URL and one API key into your AI tool, and "shorten these five launch URLs and tag them for Twitter, LinkedIn and the newsletter" becomes one sentence instead of fifteen clicks.

🔌 The short version

Endpoint: https://www.sinkto.link/api/mcp. Auth: an API key from Teams → API keys, sent as Authorization: Bearer sk_live_.... You get 11 tools, 3 resources and 3 ready-made prompts, scoped to one team and to the permissions you granted. It is free on the free plan — 60 requests/minute, 30-day analytics look-back — and every plan gets the complete tool set.

Already have an account? Create a key and skip to the setup snippets.

What Is a URL Shortener MCP Server?

A URL shortener MCP server is a remote Model Context Protocol server that exposes short-link management — creating, editing, QR codes and click analytics — as tools an AI assistant can call directly. Sinkto.Link hosts one at https://www.sinkto.link/api/mcp. Instead of an assistant guessing at a URL or asking you to go copy a short link out of a dashboard, it calls create_link, get_link_analytics or generate_qr against your team and reports back with real data.

MCP — the Model Context Protocol — is the open standard for connecting AI assistants to outside services. Anthropic released it in November 2024 and it has since been adopted well beyond Claude: OpenAI, Google and essentially every serious coding agent now speak it. One protocol, one integration, and the same server works in every client that implements it. That is the entire reason we built an MCP server rather than yet another proprietary plugin. We are not first, and we will not pretend otherwise: Dub, Bitly and Rebrandly all ship MCP servers too. What differs is where it sits in the pricing — ours is on the free plan, with the complete tool set, while Bitly's runs on its API, which its free plan does not include.

Two details matter for how you should think about it:

  • It is hosted by us. No npm package, no Docker container, no local process to keep alive or update. The server is a URL. When we ship a new tool, your client sees it on the next connection.
  • It is not a chatbot bolted onto a dashboard. The intelligence stays in your assistant. We supply the capabilities, the data, and the guardrails; your model decides what to do with them.

What Can the MCP Server Do? 11 Tools, 3 Resources, 3 Prompts

These are the operations an agent can run against your short links. Tools your API key lacks the scope for are never registered, so an assistant is never shown a capability it would only be refused for using. A read-only key genuinely cannot see delete_link.

ToolScopeWhat it does
whoamianyWhich team, plan, scopes and limits the key has. Call it first in a session.
list_linkslinks:readList and search the team's links — free-text query, paging, sorting, click and date filters.
get_linklinks:readOne link's full detail: destination, clicks, expiry, password protection, social preview.
generate_qrlinks:readRender a QR code as PNG or SVG, from an alias or any raw URL — the same engine as our QR code generator.
create_linklinks:writeShorten a URL, with optional custom alias, title, expiry, password, custom domain and social preview.
bulk_create_linkslinks:writeShorten several URLs in one call. Each row succeeds or fails independently.
update_linklinks:writeChange destination, alias, title, expiry, password, active state or preview. Only fields you pass change.
delete_linklinks:writePermanently delete a link and its click history. Requires an explicit confirm: true flag.
get_link_analyticsanalytics:readClicks and unique visitors, broken down by referrer, device, browser, OS, country, city or any UTM parameter.
get_overview_statsanalytics:readHeadline team numbers — total links, active links, lifetime and period clicks, top links by traffic.
get_recent_clicksanalytics:readThe most recent individual clicks with country, device and browser. For "what just happened".

Resources: context without spending a tool call

MCP resources are read-only documents a client can attach to a conversation wholesale. Ours are already scoped to your team and rendered as markdown, so a model can read them without reasoning about pagination:

  • sinkto://team — plan, member count, verified custom domains, link and click totals.
  • sinkto://links — the 50 most recent links with click counts.
  • sinkto://links/{alias} — one link's detail plus a 7-day click summary.

Prompts: three jobs, pre-written

MCP prompts are templates your client lists in its slash-command or prompt menu. We shipped the three jobs people actually hire a link tool for, each one written to produce the work rather than a plan for the work:

  • campaign_links — build a UTM-tagged link set across channels with a consistent alias convention, shown to you for approval before anything is created.
  • link_report — a written performance report: totals versus the previous period, top three links, biggest source and geography, anomalies, and concrete recommendations.
  • audit_links — find expiring, expired, inactive, zero-click and duplicate links and propose a cleanup. Explicitly read-only; it changes nothing.

What this actually sounds like

Real instructions people give it on day one:

  • "Shorten every URL in this launch doc, alias them spring-<channel>, and give me a markdown table."
  • "Which of our links got clicks from Germany last week, and on what devices?"
  • "The pricing page moved. Repoint every link that still targets the old URL."
  • "Generate a print-ready SVG QR code for summer-menu."
  • "Write me the monthly link report and flag anything that looks broken."

How Does the MCP Server Work?

Your AI client POSTs a JSON-RPC request to https://www.sinkto.link/api/mcp carrying an API key. The key resolves to one team, one plan and a set of scopes; only the tools those scopes allow are registered for that request; the tool runs through the same service layer the dashboard uses and returns both readable markdown and structured JSON.

The design goal was boring reliability: a public machine endpoint that an agent can hammer without taking anything else down, and that cannot be tricked into touching a team it was not issued for.

Transport: Streamable HTTP, stateless

The endpoint speaks JSON-RPC 2.0 over HTTP POST using MCP's Streamable HTTP transport. It is stateless: every request carries its own credential and is self-contained, so there is no session store to lose, no reconnect dance, and no cold-start penalty from a long-lived socket. The legacy SSE transport is deliberately not enabled — it was dropped from the MCP spec in the 2025-03-26 revision.

A GET in your browser answers with a friendly 405 pointing at the docs. That is expected, not a fault.

Auth: one key, one team, chosen scopes

Authentication is an API key in the Authorization: Bearer sk_live_... header. A key belongs to exactly one team, and every tool operates inside that team — which is why none of the tools takes a team argument, and why no prompt injection can talk the server into another tenant's links. Three scopes exist: links:read, links:write, analytics:read.

The lifecycle of one tool call

How one Sinkto.Link MCP tool call is handledAn AI client sends a JSON-RPC POST with a bearer API key to https://www.sinkto.link/api/mcp. The key is resolved to one team, plan and scope set, then rate limited. Only the tools those scopes allow are registered. The tool runs through the same service layer as the dashboard, and the result returns as both markdown and structured JSON while the call is recorded in usage analytics.Your AI clientClaude Code, Cursor…POST /api/mcpJSON-RPC + Bearer keyKey → teamplan, scopes,rate limitScope gateallowed tools onlyTool runssame service layeras the dashboardMarkdown + structured JSONand the call is recorded in usage analytics
One tool call, end to end: the API key decides which team it touches and which tools exist before anything runs.
  1. Your client POSTs a JSON-RPC request with the bearer key.
  2. The key is verified, resolved to a team, plan and scope set, and checked against a per-key sliding-window rate limit.
  3. An MCP server is assembled for that key — only the tools, resources and prompts its scopes allow are registered.
  4. The tool runs through the same service layer the dashboard uses, so permissions, validation and quotas behave identically.
  5. The result comes back as human-readable markdown and structured JSON, so the model can quote it or compute on it.
  6. The call is recorded in usage analytics — method, tool, status, duration, client — which you can see per key.

Design choices that matter in practice

Most of these came out of building the thing rather than designing it on paper — agents behave differently from browsers, and a few assumptions did not survive contact with one:

  • Links are addressed by alias, not UUID. "Update the launch-2026 link" works, because the alias is the part a human already knows.
  • Deletion is gated behind an explicit confirm flag and annotated as destructive, so a well-behaved client asks you before it fires.
  • Rate limiting is keyed by API key, never by IP. Agents share egress addresses; one noisy tenant must not throttle everyone behind the same NAT.
  • Errors are returned as JSON-RPC errors with real messages — including a Retry-After on a 429 — so your assistant can tell you what went wrong instead of "failed to connect".

How Do I Connect It to Claude Code, Cursor, or Any AI Agent?

Step 1 — Create an API key

Open Teams → API keys, switch to the team the key should act on, pick the permissions, choose an expiry, and create it. Start with Read links and Read analytics; add Manage links only when you want the assistant to create or delete things.

Copy the key immediately — it is shown once. Treat it like a password: never commit it to a repository, never paste it into a shared doc. If it leaks, revoke it and issue a new one.

Step 2 — Paste it into your client

Pick your tool below. In every snippet, replace sk_live_... with your key.

Claude Code

One command in your terminal:

claude mcp add --transport http sinkto https://www.sinkto.link/api/mcp \
  --header "Authorization: Bearer sk_live_..."

Then /mcp inside Claude Code to confirm it connected, and ask it to run whoami. Add --scope project if you want the server checked into the repo's .mcp.json for teammates — but keep the key out of version control.

Claude.ai and Claude Desktop

  1. Settings → Connectors → Add custom connector.
  2. URL: https://www.sinkto.link/api/mcp
  3. Header: name Authorization, value Bearer sk_live_...

The connector then appears in the tools menu of any conversation and in Claude's Projects.

Cursor

Add the server to ~/.cursor/mcp.json (global) or .cursor/mcp.json (this project), then enable it under Settings → MCP:

{
  "mcpServers": {
    "sinkto": {
      "type": "http",
      "url": "https://www.sinkto.link/api/mcp",
      "headers": {
        "Authorization": "Bearer sk_live_..."
      }
    }
  }
}

VS Code, Windsurf, Cline, Zed and other config-file clients

The JSON above is the shape the ecosystem has converged on — an HTTP server with a url and a headers object. What differs between clients is the file it lives in and occasionally the top-level key (VS Code uses servers in .vscode/mcp.json; several others use mcpServers). Check your client's MCP docs for the path, then paste the same three values: transport http, the endpoint, and the Authorization header.

Custom, open-model and workflow agents

Nothing here is Claude-specific. Any agent that speaks MCP — one you built on the official Python or TypeScript SDK, an open-weights model like Hermes running through an MCP-capable harness, LangGraph, the OpenAI Agents SDK, or a workflow tool such as n8n — connects with the same two values. With the Python SDK:

from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async with streamablehttp_client(
    "https://www.sinkto.link/api/mcp",
    headers={"Authorization": "Bearer sk_live_..."},
) as (read, write, _):
    async with ClientSession(read, write) as session:
        await session.initialize()

        tools = await session.list_tools()          # 11 tools, minus what your scopes exclude
        result = await session.call_tool(
            "create_link",
            {"url": "https://example.com/launch", "customAlias": "launch-2026"},
        )

In no-code workflow builders, add an MCP client node, set the transport to HTTP/Streamable HTTP, paste the endpoint, and add the Authorization header as a credential.

Verify with curl

curl -X POST https://www.sinkto.link/api/mcp \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

⚠️ Always use the www host

sinkto.link permanently redirects to www.sinkto.link, and some clients drop the request body when they follow a redirect on POST. Both curl examples and every config snippet above use the www host for that reason.


Five Minutes Well Spent After You Connect

  1. Ask it who it is. "Run whoami on sinkto" confirms the team, plan, scopes and limits in one answer — and is the fastest way to debug a permissions surprise later.
  2. Run the audit prompt. audit_links is read-only and tends to surface the embarrassing stuff immediately: expired campaign links still in circulation, three aliases pointing at the same page, links with zero clicks after a month.
  3. Build one campaign set. Give campaign_links a destination and your channels and let it produce the UTM-tagged, consistently-aliased set. Compare the time against doing it by hand; that comparison is the whole product pitch.

Is It Safe? What an AI Agent Can and Cannot Do

Handing an autonomous assistant write access to anything deserves a paragraph of scrutiny, so here is the honest version.

ControlWhat it means
Team bindingA key reaches exactly one team. There is no cross-team tool and no team parameter to manipulate.
Scope gatingUngranted tools are never registered. A read-only key cannot see, let alone call, a write tool.
Destructive confirmationdelete_link requires confirm: true and is flagged destructive, so clients prompt first.
RevocationRevoke, expire, or remove the owner from the team and the key stops working immediately.
Rate limitsPer-key, per-minute, with a fail-closed backstop. A runaway loop hits a ceiling, not your bill.
Usage visibilityEvery request is logged per key — method, tool, status, duration, client — so unusual behaviour is visible.
No account accessKeys reach links, QR codes and analytics. Not billing, not members, not passwords, not other teams.

The practical advice: issue read-only keys by default, give write scope to the one client you actually supervise, and put a short expiry on anything experimental.

What Are the Free and Pro Limits?

Every plan gets the full tool set. Pro raises the ceilings; it does not unlock the door — which is worth stating plainly, because API access is exactly the feature most shorteners reserve for paid tiers. Bitly's free plan, for comparison, includes no API access at all (see our breakdown of Bitly's free limits).

LimitFreePro
API keys per team110
Requests per minute60600
Analytics look-back30 days90 days
Links per bulk call1025

Custom domains and per-link custom social previews remain Pro features, and the tools say so if you try to use them on a free team.

Troubleshooting: Common MCP Connection Errors

SymptomFix
401 UnauthorizedThe header must read exactly Authorization: Bearer sk_live_.... Revoked, expired, or owner-removed keys stop working immediately.
429 Too Many RequestsYou hit the per-minute ceiling. Wait for the window in the Retry-After header, or upgrade the team.
406 Not AcceptableSend Accept: application/json, text/event-stream. Real clients do this for you; hand-written curl needs it spelled out.
Connects, but lists no toolsThe key has no scopes, or only scopes whose tools are hidden. Run whoami or check the key in Settings.
Works in one client, fails in anotherCheck the host. Use www.sinkto.link, not the bare apex domain.

The full error reference — including what a GET in the browser means and every WWW-Authenticate code — is kept current in the MCP troubleshooting docs.


Why This Matters Beyond Convenience

Running a link shortener is a chore that sits between two things people actually care about: the content and the numbers. It is repetitive, it is easy to do inconsistently, and inconsistency is precisely what ruins attribution — one teammate writes utm_source=twitter, another writes Twitter, and your campaign report silently splits in half.

AI agent link management fixes that, and not by being clever: an agent with tools does the same work the same way every time. It also closes the loop: the same assistant that creates the links can read the analytics a week later and tell you which ones worked. That is a different workflow from "open dashboard, export CSV, paste into a spreadsheet", and it is the reason we put analytics tools in the server rather than shipping a write-only API.

It matters in the other direction too. AI assistants are now a real traffic source, and the links they cite are frequently mis-attributed by site-side analytics — a problem we covered in tracking ChatGPT traffic in GA4 and in the complete guide to AI link management. Creating those links through an agent that also measures them at the redirect is the tidiest answer available today.

Frequently Asked Questions

What is an MCP server for a URL shortener?

A URL shortener MCP server is a service that exposes link-shortening capabilities — create, update, delete, QR codes, click analytics — as tools an AI assistant can call through the Model Context Protocol. Rather than you operating a dashboard, your assistant operates the product on your behalf, inside whatever chat or editor you already work in.

Do I need to install anything?

No. The Sinkto.Link MCP server is hosted at https://www.sinkto.link/api/mcp. There is no package, no local process, and no version to keep current. You need an API key and one line of config.

Is it free?

Yes. Every plan, including the free one, gets all 11 tools, all resources and all prompts. The free plan allows 1 API key per team, 60 requests per minute, a 30-day analytics look-back and 10 links per bulk call. Pro raises those to 10 keys, 600 requests per minute, 90 days and 25 links.

Which AI tools can connect to it?

Any MCP client. In practice that covers Claude Code, Claude.ai and Claude Desktop, Cursor, VS Code, Windsurf, Cline, Zed, workflow tools like n8n, and custom agents built on the MCP Python or TypeScript SDKs — including agents running open-weights models. The connection is always the same endpoint plus an Authorization header.

Can an AI agent delete my links by accident?

Only if you grant links:write. Without it, delete_link is not registered and the assistant cannot see it. With it, deletion still requires an explicit confirm: true argument and is annotated as destructive, so compliant clients ask you first. Keys are revocable at any time.

Can one key access more than one team?

No. A key is bound to a single team at creation and every tool operates inside it. That is why no tool takes a team argument. If you manage several teams, issue one key per team.

How is this different from a REST API?

A REST API expects you to read docs and write the calling code — request types, auth, paging, error handling. An MCP server ships the argument schema, the description and the usage guidance with each tool, so a model calls it correctly without an integration project. Underneath they are the same product: our MCP tools and our dashboard's own /api/links endpoints both run through the same service layer, so permissions, validation and quotas behave identically and the two can never drift apart.

How do I shorten a link directly from Claude Code?

Once the server is connected, ask in plain language: "Shorten https://example.com/launch and alias it launch-2026." Claude Code calls create_link and hands back the live short link in the same reply — add "and give me a QR code for it" and it calls generate_qr too. You never open the dashboard and you never write an API call.

Can I read click analytics through the MCP server?

Yes — that is half the point of it. get_overview_stats returns headline totals and top links, get_link_analytics breaks clicks and unique visitors down by referrer, device, browser, OS, country, city or any UTM parameter, and get_recent_clicks returns the individual clicks as they happen. It is the same data the dashboard shows, returned as markdown your assistant can quote and JSON it can compute on. The look-back is 30 days on the free plan and 90 on Pro.

How does this compare to the Bitly, Dub or Rebrandly MCP servers?

We are not the only shortener with an MCP server — Bitly, Dub and Rebrandly all ship one, and Bitly's exposes a larger tool surface than ours. The difference is the price of entry: the Sinkto.Link MCP server is included on the free plan with all 11 tools, whereas Bitly's MCP runs on its API, which its free plan does not include. If you want an AI assistant managing real short links without a paid plan first, that is the gap we are filling.

What data does the server see?

Only what the tools return: your team's links, QR codes and click analytics. Keys cannot reach billing, team membership, account passwords, or any other team's data. Every request is logged for usage analytics against the key that made it.

Connect it in two minutes

Create a free account, generate an API key under Teams → API keys, and paste one line into your client. The full tool reference, per-client setup and troubleshooting live in the MCP documentation.

Get your API key free →

Published: August 2026. Tool names, scopes, plan limits and error codes in this article were verified against the live Sinkto.Link MCP server at https://www.sinkto.link/api/mcp on publication. Client setup steps change as vendors ship updates — the canonical, maintained version is the MCP setup guide. Spotted something out of date? Tell us.

K

Kelvin Kwong

Founder & Solution Architect

Full-stack developer and the creator of Sinkto.Link. Passionate about building tools that make link management accessible to everyone. Based in Hong Kong.

XiaohongshuThreads

Related articles

Ready to optimize your links?

Join thousands of creators using Sinkto.Link — free forever

Get Started Free →

Share this article

Instagram and Xiaohongshu have no web share link — those buttons open your device's share sheet, or copy the link to paste into a post, story or bio.

Command Palette

Search for a command to run...

We use cookies to improve your experience and analyze traffic. By clicking "Accept", you consent to the use of cookies. See our Cookie Policy.