AI assistants (MCP)

Connect Claude Code, Cursor or any MCP client to LinkTrail with a server API key to read your links and analytics, and optionally create and edit links.

LinkTrail runs a remote MCP (Model Context Protocol) server, so an AI assistant — Claude Code, Cursor, or any MCP HTTP client — can read your links and analytics, and, if you let it, create, edit, archive and unarchive links. It talks to the same /v1 API the dashboard does, and it can never delete links.

The MCP server adds no new data and no new powers: it exposes exactly what a server API key already can. Every tool it offers calls the same service, with the same validation, plan limits and locked-link rules, as its REST route — so the assistant sees the same links, totals, QR codes, earnings and analytics you see in the dashboard, and nothing else.

Requirements

  • A server API key (lt_srv_…). Create one on the dashboard's AI assistants page: Dashboard → Developers → AI assistants. It is shown once — copy it then and keep it secret.
  • A plan with the API capability. Server keys need the api plan capability, which is on Starter and above (not the Free plan). The check runs when a key is created and again on every request made with it, so after a downgrade keyed requests are refused.
  • An MCP-capable client that speaks Streamable HTTP over an Authorization: Bearer header — Claude Code, Cursor, and other MCP clients all do.

Server URL

Point your client at the LinkTrail MCP endpoint:

MCP server URLText
https://backend.linktrail.io/v1/mcp

Authenticate with your server API key as a bearer token (Authorization: Bearer lt_srv_…). The key fixes the workspace, so there is nothing else to configure. SDK keys (lt_live_…) and dashboard logins are refused here.

Scopes

What the assistant can do is exactly the scopes on the key you give it. Pick the access level when you create the key on the AI assistants page.

AccessScopesWhat the assistant can do
Read-only (recommended)links:read + stats:readList links, totals, QR codes and earnings, and read the same analytics as the dashboard. It can't change anything.
Read and writelinks:read + stats:read + links:writeEverything in read-only, plus create, edit, archive and unarchive links.
Warning

Deleting is never permitted. No access level grants it and there is no delete tool; the server has no way to remove a link. To take a link down, the assistant archives it (and can unarchive it later).

The links and analytics the assistant reads and writes are the same ones documented on the Links API and Stats API pages.

Set up your client

Claude Code

Run this in your terminal to add LinkTrail to Claude Code:

TerminalShell
claude mcp add --transport http linktrail https://backend.linktrail.io/v1/mcp --header "Authorization: Bearer <your server key>"

Cursor

Add LinkTrail to the mcpServers object in ~/.cursor/mcp.json, then restart Cursor:

~/.cursor/mcp.jsonJSON
{
  "mcpServers": {
    "linktrail": {
      "url": "https://backend.linktrail.io/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your server key>"
      }
    }
  }
}

Other clients

Any client that supports HTTP MCP servers works. Add an mcpServers entry with "type": "http", the server URL, and the bearer header:

MCP client configJSON
{
  "mcpServers": {
    "linktrail": {
      "type": "http",
      "url": "https://backend.linktrail.io/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your server key>"
      }
    }
  }
}

Example prompts

Once connected, ask your assistant in plain language. Reading needs only a read-only key:

  • Which of my links got the most clicks this week?
  • Compare installs by campaign for October and September.
  • Show the conversion rate for my top five links over the last 30 days.

Writing needs a read-and-write key:

  • Create a link for the Black Friday campaign on my verified domain.

Security

Important

Your server API key is a secret. Anyone holding it can act in your workspace within the key's scopes, so keep it out of shared repos and chat logs, and revoke it from the AI assistants page if it leaks.

  • Prefer read-only. It's the recommended default: the assistant can read everything the dashboard shows but can't change a thing.
  • Write access is an explicit opt-in. A read-and-write key lets the assistant create, edit, archive and unarchive links, acting on whatever it reads. Only grant it if you trust the sources the assistant reads, since a prompt hidden in that content could steer it into write actions.
  • Revoke any time. Keys are listed on the AI assistants page with their scopes and last-used time; revoke one and it stops working on the next request.