Model Context Protocol

LinkTwin MCP server: let your AI agent create and manage links.

The official link shortening and deep linking MCP server. Connect Claude, Cursor and other AI assistants to your LinkTwin account, then just ask: create short links and deep links, organize collections, attach pixels, generate QR codes and read your analytics.

See the setup
npx -y @linktwin/mcp
  • MIT licensed, on npm
  • Runs on your machine
  • Works with any MCP client
AI assistant 34 LinkTwin tools
Make a short link for my desk tour video https://www.youtube.com/watch?v=x7K2pQ9mW4s with the alias desk-tour, and add it to my YouTube collection.
linktwin create_linkRunning Done
{
  "url": "https://www.youtube.com/watch?v=x7K2pQ9mW4s",
  "custom": "desk-tour",
  "collections": ["YouTube"]
}

Done. Your new link is in the YouTube collection:

linktw.in/desk-tourOpens in the YouTube app
Example conversations. The tool names and arguments are the real ones.

Why an MCP server

From "shorten this" to done, without leaving your chat.

Switching to a dashboard or wiring up the REST API by hand breaks your flow. The LinkTwin MCP server gives your AI assistant first-class link-management tools, so it can build campaign links, deep links and QR codes for you while you stay in the conversation.

Steps to get it done

  • Dashboard and copy-paste
  • LinkTwin MCP server
Make a link with an alias
Find your top link this month
Counted for someone already signed in. Each block is one action. Some clients let you always allow a tool, which removes the approval step too.
The job Without an MCP With the LinkTwin MCP
Creating links Copy-paste between chat and dashboard Create links by just asking
Targeting and UTM Hand-write API calls and auth headers Deep links, targeting & UTM in one prompt
Your numbers AI cannot see your links or stats AI reads your analytics on demand
Repetitive work Slow, error-prone, repetitive Bulk operations in seconds

Setup

Connect in three steps

Nothing to install: npx runs the server on demand. All you need is Node.js 18 or newer and your API key.

  1. Get your API key

    Copy your API key from Settings or the MCP Server page in your LinkTwin dashboard. API access comes on every plan.

  2. Add the config snippet

    Paste the JSON below into your AI client config and drop in your API key.

  3. Just ask

    Restart your client and ask it to create, edit or analyze links. The LinkTwin tools appear automatically.

One snippet to connect

Add this to Claude Desktop, Cursor or any MCP client, then restart.

Claude Desktop

In Claude Desktop open Settings, then Developer, then Edit Config. Paste the block into claude_desktop_config.json.

{
  "mcpServers": {
    "linktwin": {
      "command": "npx",
      "args": ["-y", "@linktwin/mcp"],
      "env": { "LINKTWIN_API_KEY": "YOUR_API_KEY" }
    }
  }
}
Cursor

In Cursor, create .cursor/mcp.json in your project and paste the block.

{
  "mcpServers": {
    "linktwin": {
      "command": "npx",
      "args": ["-y", "@linktwin/mcp"],
      "env": { "LINKTWIN_API_KEY": "YOUR_API_KEY" }
    }
  }
}
Other MCP clients

Claude Code, Windsurf, Cline and other MCP clients accept the same JSON in their MCP settings.

{
  "mcpServers": {
    "linktwin": {
      "command": "npx",
      "args": ["-y", "@linktwin/mcp"],
      "env": { "LINKTWIN_API_KEY": "YOUR_API_KEY" }
    }
  }
}

Two environment variables

The server talks JSON-RPC over stdio and reads its settings from the env block of your config.

VariableWhat it does
LINKTWIN_API_KEY Required. Your API key from the LinkTwin Settings page.
LINKTWIN_BASE_URL Optional. The site root the server calls. Defaults to https://linktw.in.

Works with

  • Claude Desktop
  • Claude Code
  • Cursor
  • Windsurf
  • Cline
  • Any MCP client
  • Node.js 18 or newer, nothing else to install.
  • The tools are named after what they do, so you can ask for them in your own words.
  • Prefer the terminal? Use the LinkTwin CLI. Building your own integration? Read the API docs.

Capabilities

Everything your agent can manage

34 tools covering the full LinkTwin link-management surface. Every link tool supports geo, device and language targeting, A/B test variants and UTM parameters, set in a single prompt.

34

tools in seven groups. Each one wraps a LinkTwin REST API endpoint and checks its input before it runs.

Links6

Create, edit, list and delete links with custom aliases, expiry, passwords and click limits.

  • create_linkCreate short link
  • list_linksList links
  • get_linkGet link
  • update_linkUpdate link
  • delete_linkDelete link
  • bulk_delete_linksBulk delete links

Analytics4

Per-link and account-wide click stats: top countries, referrers, browsers, devices and day trends.

  • get_link_statsGet link analytics
  • get_dashboard_statsAccount dashboard stats
  • get_detailed_statsAccount detailed stats
  • get_day_trendAccount day trend

Collections6

Group links into collections and manage your branded custom domains.

  • list_collectionsList collections
  • get_collectionGet collection items
  • create_collectionCreate collection
  • update_collectionUpdate collection
  • add_links_to_collectionAdd/remove links in collection
  • delete_collectionDelete collection

Domains4

Add branded domains and choose where the bare domain and missing links send visitors.

  • list_domainsList domains
  • add_domainAdd branded domain
  • update_domainUpdate domain
  • delete_domainDelete domain

Pixels6

Create Facebook, GTM and other pixels and attach them to links in bulk.

  • list_pixelsList pixels
  • get_pixelGet pixel
  • create_pixelCreate pixel
  • update_pixelUpdate pixel
  • delete_pixelDelete pixel
  • assign_pixel_to_linksAssign pixel to links

QR codes5

Generate and update QR codes for any link, with colors and logos.

  • list_qr_codesList QR codes
  • get_qr_codeGet QR code
  • create_qr_codeCreate QR code
  • update_qr_codeUpdate QR code
  • delete_qr_codeDelete QR code

Account3

Check your plan and usage, set your default domain and time zone, and switch workspaces.

  • get_accountGet account info
  • update_account_settingsUpdate account settings
  • switch_workspaceSwitch workspace

Try asking your assistant

Write the request the way you would say it. The assistant picks the tools, fills in the arguments and tells you what it did.

Create a campaign link

Create a short link for https://example.com/spring-sale with the alias spring-sale, and add it to my Marketing collection.
  • Calls
  • create_link

Route visitors by country

Make a deep link that opens Canadian visitors on example.ca and everyone else on example.com.
  • Calls
  • create_link

Find your best links

Which of my links got the most clicks this month, and where did the traffic come from?
  • Calls
  • get_detailed_stats

QR codes and retargeting

Generate a QR code for my latest link and attach my Facebook pixel to it.
  • Calls
  • list_links
  • create_qr_code
  • list_pixels
  • assign_pixel_to_links

Clean up old tests

Find my links with "test" in the title and delete them.
  • Calls
  • list_links
  • bulk_delete_links

Work in a team workspace

Switch to my team workspace and list the branded domains we can use.
  • Calls
  • get_account
  • switch_workspace
  • list_domains

How the LinkTwin MCP server works

Your AI client starts the server on your computer with npx and talks to it over stdio. The server calls the LinkTwin API over HTTPS with your API key, inside your own account.

  1. Your AI client Claude, Cursor, Windsurf, Cline or any MCP client
  2. LinkTwin MCP server Started by npx -y @linktwin/mcp On your computer
  3. LinkTwin API Your links, collections, pixels, QR codes and stats
  • It only does what your API key allows, inside your own account and workspace.
  • Errors such as a wrong key, a rate limit, a plan limit or invalid input come back as tool results marked as errors, so the agent can explain or retry.
  • Nothing is deleted unless the agent calls a delete tool, such as delete_link or bulk_delete_links.
  • Regenerate your API key at any time to revoke access instantly.

MCP Server Questions

Everything about the link shortening and deep linking MCP. Still have questions? Contact us.

What is the LinkTwin MCP server?

The LinkTwin MCP server is the official Model Context Protocol (MCP) server for link shortening and deep linking. It connects AI assistants like Claude and Cursor to your LinkTwin account, so they can create, edit and manage short links and deep links, organize collections, attach retargeting pixels, generate QR codes and read click analytics, all from a conversation in plain language.

What is an MCP (Model Context Protocol) server?

MCP is an open standard that lets AI assistants connect to outside tools and data. An MCP server exposes a set of tools the assistant can call. The LinkTwin MCP server exposes 34 link management tools, so any MCP-compatible app (Claude Desktop, Claude Code, Cursor, Windsurf, Cline and more) can manage your links for you.

Is the link shortening MCP free?

The MCP server itself is free and MIT licensed, published on npm as @linktwin/mcp. It works through the LinkTwin API, and API access comes on every plan. You can create a free account first and upgrade when you are ready to connect your agent.

Which AI clients are supported?

Any client that speaks the Model Context Protocol over stdio, including Claude Desktop, Claude Code, Cursor, Windsurf and Cline. You add one JSON snippet to the client's MCP settings, and the LinkTwin tools appear after a restart.

Can the MCP server create deep links and not just short links?

Yes. It is a deep linking MCP as well as a link shortening MCP. Through your assistant you can create links that open in apps like YouTube, Amazon and Spotify, with geo, device and language targeting, A/B testing variants, UTM parameters, branded domains and in-app browser escaping. These are the same options as in the LinkTwin dashboard and API.

How do I get my API key?

Sign in to LinkTwin and open Settings, or Tools & Integrations and then MCP Server, in your dashboard. Copy your API key and paste it into your MCP client config as LINKTWIN_API_KEY. The key is shown once your plan includes API access.

Is it safe to give an AI agent access to my links?

The MCP server runs on your own computer and only does what your API key allows, inside your own account. Your key goes from your machine to the LinkTwin API and is never shared with third parties. Deleting anything takes an explicit tool call, and you can regenerate your API key at any time to revoke access instantly.

Which tools does the LinkTwin MCP server include?

34 tools in seven groups: links (create_link, list_links, get_link, update_link, delete_link and bulk_delete_links), analytics (get_link_stats, get_dashboard_stats, get_detailed_stats and get_day_trend), collections, branded domains, retargeting pixels, QR codes and your account. Each one is a thin wrapper over the LinkTwin REST API, documented in the API documentation.

Do I need to install anything?

Only Node.js 18 or newer. The config snippet runs the server on demand with npx -y @linktwin/mcp, so there is no global install and you always get the published version.

One API key, three ways to build

The REST API, the MCP server and the CLI all use the same API key and manage the same links.

API documentation

Every endpoint, with examples

Read the API docs

Give your AI the power to manage links

Connect the LinkTwin MCP server and start creating links by conversation.

npx -y @linktwin/mcp

API access comes on every plan. See plans