Skip to content
LinkProfit

MCP Server for AI Assistants

Connect Claude Code, Claude Desktop or Cursor to your workspace over the Model Context Protocol: ready-made configs, the tool catalogue, permissions and plan gating.

Updated August 14, 2026

The MCP server lets an AI assistant work with your links and analytics directly: "shorten this landing page on our brand domain", "which five links earned the most clicks last week", "mute the alert rule for the campaign domain until Monday". The assistant does this through the same public API you would call yourself, with exactly the rights of the key you connected it with.

https://api.linkprofit.com/v1/mcp

The transport is JSON-RPC 2.0 over HTTP, following the Model Context Protocol revision 2025-06-18 (revision 2025-03-26 is accepted too). There is no server-initiated event stream and no session state: GET and DELETE answer 405, no Mcp-Session-Id is issued, and every request carries all the context it needs in the key itself. Any MCP client that speaks HTTP works — the three below are just the ones we ship copy-paste configs for.

1. Create a key for the assistant

In your dashboard open Settings → API keys and create a workspace key (lp_live_…). Grant it only the scopes the assistant should really have — the tool catalogue below lists what each tool needs. A key with links:read + analytics:read gives you a read-only assistant that can answer questions but cannot change anything.

The full key value is shown once. Treat it like a password: it is going into a config file on your machine.

2. Add the server to your client

Claude Code

One command, no config file to edit:

claude mcp add --transport http linkprofit https://api.linkprofit.com/v1/mcp \
  --header "Authorization: Bearer lp_live_…your key…"

Add --scope user to make the server available in every project on your machine instead of only the current one. Check the result with claude mcp list, and remove it later with claude mcp remove linkprofit.

Claude Desktop

Edit the configuration file — on macOS ~/Library/Application Support/Claude/claude_desktop_config.json, on Windows %APPDATA%\Claude\claude_desktop_config.json — and add the server:

{
  "mcpServers": {
    "linkprofit": {
      "type": "http",
      "url": "https://api.linkprofit.com/v1/mcp",
      "headers": {
        "Authorization": "Bearer lp_live_…your key…"
      }
    }
  }
}

Restart Claude Desktop. The tools appear in the tool picker of a new conversation.

Cursor

Create .cursor/mcp.json in the project (or ~/.cursor/mcp.json to have it everywhere):

{
  "mcpServers": {
    "linkprofit": {
      "url": "https://api.linkprofit.com/v1/mcp",
      "headers": {
        "Authorization": "Bearer lp_live_…your key…"
      }
    }
  }
}

Cursor picks up the file on save and shows the server in Settings → MCP.

Checking the connection by hand

Any client's problems are easier to read at the protocol level. This is the same handshake the clients perform:

curl -s -X POST https://api.linkprofit.com/v1/mcp \
  -H "Authorization: Bearer $LINKPROFIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": { "name": "curl", "version": "1.0" }
    }
  }'

A healthy answer names the protocol version, the server and its tool capability. Swap the method for tools/list to see the catalogue, and for ping to check nothing more than reachability.

Tools

Ten tools, all scoped to the workspace the key belongs to. The scope column is what the key must carry; a tool the key has no scope for simply fails when called, it is not hidden from the catalogue.

| Tool | What it does | Required scope | | --- | --- | --- | | list_links | List the workspace's short links, optionally filtered by a search string | links:read | | get_link | Read one link by its id | links:read | | create_link | Create a short link; without domain_id the workspace's default domain is used | links:write | | update_link | Change the destination or the title of an existing link | links:write | | analytics_summary | Clicks, visitors and QR scans for a period, optionally for a single link | analytics:read | | analytics_breakdown | Clicks and visitors grouped by country, city, device, browser, OS, referer, UTM, region, network, visitor type, proxy type, quality or local hour; the last six dimensions require the geo_analytics plan feature | analytics:read | | analytics_top_links | The most clicked links of the period, with clicks and visitors | analytics:read | | analytics_timeseries | Clicks and visitors over time, by hour, day or week | analytics:read | | list_alert_rules | List alert rules with their channels and suppression window | alerts:read | | update_alert_rule | Enable, disable or re-tune the suppression window of an alert rule | alerts:write |

Argument schemas come from the same definitions that validate the call, so what the assistant is told about a tool and what the server actually accepts cannot drift apart. Read-only tools are annotated as such, which is what lets a client ask for confirmation before the three tools that change data: create_link, update_link and update_alert_rule — plus anything a future release adds to that list.

Every mutating tool call is written to the workspace audit trail with the key that made it and the note that it arrived over MCP, so an assistant's changes are as traceable as a person's.

Permissions and safety

The key is the permission boundary. There is no privileged "assistant mode": a tool call runs with the scopes of the key, inside the workspace of the key, under the same rate limit and the same tenant isolation as a REST call. An id from another workspace is not_found, exactly as it is over REST.

Three habits worth adopting:

  • Give the assistant its own key, never the one your production integration uses. Revoking it then costs nothing.
  • Start read-only. links:read + analytics:read covers the reporting questions people actually ask an assistant. Add links:write only once you want links created from chat.
  • Rotate on exposure. A key in a config file travels with backups, screen shares and support tickets. Revoke it in the dashboard the moment it leaks; the next request answers 401.

The rate limit is shared with the REST API — per key, sliding one-minute window — so a chatty assistant and a background job on the same key compete for the same budget. That is another argument for a separate key. See Rate limits for the headers and the retry rules.

Plan requirements

Two plan features gate the endpoint:

  • api_access — the right to use the API at all;
  • assistant_tools — the right to use the tool catalogue and therefore MCP.

Both are set on the plan your workspace is on. A workspace whose plan lacks either one gets 403 with the code plan_restricted and a message naming the missing capability. If you resell LinkProfit under your own brand, this is a feature you decide to include in a plan or sell as an upgrade.

Troubleshooting

403 plan_restricted — the plan does not include assistant_tools (or api_access). Upgrade the plan; nothing about the key or the client config will fix this one.

401 unauthorized — the header is missing, malformed, or the key is unknown, revoked or expired. The three are deliberately indistinguishable. Check that the value is the whole key, that it is prefixed with Bearer , and that the client really sends the header — the curl handshake above answers that in one request.

403 forbidden — a partner key (lpp_live_…) was used. MCP is a workspace surface; create a workspace key.

429 rate_limited — the key ran out of its window. The response carries Retry-After; clients that retry immediately only keep the key locked out.

405 on GET — expected, not a fault. The server offers no event stream and keeps no session; a client that only speaks the SSE-based transport of older revisions cannot connect.

A tool answers with an error instead of data — two different things look similar in a chat transcript. Arguments that fail validation come back as a tool result marked as an error, listing the offending fields, and the assistant can correct itself and retry. A missing scope comes back as a protocol error with the code insufficient_scope and the scope named: that one needs a new key, not another attempt.

  • Authentication — keys, the full scope list, rotation.
  • Errors — every error code and how to handle it.
  • API reference — the REST endpoints behind the tools.
  • SDKs — the same operations from your own code.