Skip to content
On this page

MCP Server Reference

Revolink supports the Model Context Protocol (MCP) — an open standard that lets AI assistants (Claude, Cursor, Windsurf, and others) interact with external services as tools.

Once configured, your AI assistant can create links, update routing rules, and pull analytics without you ever leaving the chat.

Endpoint

POST https://api.revolink.link/apiv1/mcp

Transport: Streamable HTTP (stateless, one request per tool call).


Authentication

Revolink MCP supports two ways to connect. Pick what fits your situation:

API KeyOAuth 2.0
Best forScripts, dev tools, automationclaude.ai web, apps, teams
SetupGenerate a key, paste in configJust paste the URL, approve access
Key managementYou manage the keyNone — handled automatically

Method 1 — API Key

Generate a key in Profile → Integrations, enable the MCP scopes you need, and pass it in your client config. See Setup below for per-client instructions.

Errors:

HTTPCause
401Missing or invalid API key, or key has expired
403Key exists but has no MCP scopes enabled

Method 2 — OAuth 2.0

For clients like claude.ai (web) that support OAuth — no key needed. You approve access once, and the client handles everything automatically.

How to connect (claude.ai web):

  1. Go to Settings → Integrations in claude.ai.
  2. Click Add MCP server.
  3. Paste: https://api.revolink.link/apiv1/mcp
  4. Click Connect — you'll be redirected to Revolink to approve access.
  5. Done. Revolink tools are now available in your chat.

To revoke access at any time: Profile → Connected Apps → Revoke.


MCP Permissions

MCP permissions are separate from regular API permissions. A key can have full API access but zero MCP access — or vice versa. Available scopes:

ScopeWhat it unlocks
links:readlist_links, get_link
links:writecreate_link, update_link
links:deletedelete_link
links:bulkbulk_create_links
analytics:readget_link_analytics, get_workspace_analytics

For API key auth, scopes are configured per key under Profile → Integrations → MCP in the app.

For OAuth, scopes are requested by the client and approved by the user during the consent flow.


Setup

API Key — Step-by-step

  1. Go to Profile → Integrations in the Revolink app.
  2. Click Create API Key.
  3. Give the key a name (e.g. Claude MCP).
  4. Under MCP — enable the scopes you want to grant. Each scope can be enabled independently.
  5. Click Create and copy the key — it is shown only once.

A key with MCP enabled but no MCP scopes selected will be rejected at the MCP endpoint with a 403 error.

Configure your AI client (API Key)

Claude Desktop (claude_desktop_config.json)

Claude Desktop uses stdio transport. Use the mcp-remote bridge to connect to Revolink's HTTP endpoint.

json
{
  "mcpServers": {
    "revolink": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.revolink.link/apiv1/mcp",
        "--header",
        "X-Api-Key:YOUR_API_KEY"
      ]
    }
  }
}

Open via: Claude menu → Settings → Developer → Edit Config. Restart Claude Desktop after saving.

Claude Code (CLI)
bash
claude mcp add --transport http revolink https://api.revolink.link/apiv1/mcp \
  --header "X-Api-Key: YOUR_API_KEY"

Or add to .claude/settings.json:

json
{
  "mcpServers": {
    "revolink": {
      "type": "http",
      "url": "https://api.revolink.link/apiv1/mcp",
      "headers": {
        "X-Api-Key": "YOUR_API_KEY"
      }
    }
  }
}
Cursor / Windsurf (.cursor/mcp.json or .codeium/windsurf/mcp_config.json)
json
{
  "mcpServers": {
    "revolink": {
      "url": "https://api.revolink.link/apiv1/mcp",
      "headers": {
        "X-Api-Key": "YOUR_API_KEY"
      }
    }
  }
}
VS Code (.vscode/mcp.json)
json
{
  "servers": {
    "revolink": {
      "type": "http",
      "url": "https://api.revolink.link/apiv1/mcp",
      "headers": {
        "X-Api-Key": "${input:revolinkApiKey}"
      }
    }
  },
  "inputs": [
    {
      "id": "revolinkApiKey",
      "type": "promptString",
      "description": "Revolink API Key",
      "password": true
    }
  ]
}

Requires VS Code 1.99+ with GitHub Copilot. The ${input:revolinkApiKey} prompt asks for your key on first use.

Zed (~/.config/zed/settings.json)
json
{
  "context_servers": {
    "revolink": {
      "settings": {
        "url": "https://api.revolink.link/apiv1/mcp",
        "api_key": "YOUR_API_KEY"
      }
    }
  }
}

Configure your AI client (OAuth)

claude.ai (web)

No config needed. When you add a new MCP server in claude.ai → Settings → Integrations, enter:

https://api.revolink.link/apiv1/mcp

Claude will redirect you to the Revolink consent page automatically.


Workspaces — automatic selection

You never need to specify a workspace ID manually. When you send a request without selecting a workspace, the server returns a list of your available workspaces. The AI picks the right one based on context, then continues the operation automatically. From your perspective this is invisible — just describe what you need in plain language.


Available Tools

Returns a paginated list of links in a workspace.

Required scope: links:read

ParameterTypeRequiredDescription
pageintegerPage number (default: 1)
limitintegerLinks per page, 1–100 (default: 20)
searchstringFilter by name or slug
tagIdsstring[]Filter by tag IDs

Returns full details of a single link including its routing rules.

Required scope: links:read

ParameterTypeRequiredDescription
linkIdstringLink ID

Creates a new smart link with routing rules.

Required scope: links:write

ParameterTypeRequiredDescription
namestringLink name (max 255 chars)
rulesRule[]Routing rules — see Rule object below. Exactly one must have isDefault: true
slugstringCustom slug (lowercase, hyphens allowed). Auto-generated if omitted
domainstringCustom domain. Defaults to workspace default
descriptionstringInternal note (max 1000 chars)
activebooleanWhether the link is active (default: true)
tagIdsstring[]Tag IDs to attach
clicksLimitintegerDeactivate link after N clicks. 0 = no limit
expirationDatestringISO 8601 datetime. Link deactivates after this date
conversionTrackingbooleanEnable conversion pixel
gpsTrackingbooleanEnable GPS location capture on click
abTestAbTestA/B test config — see A/B Test object below

Example prompt:

"Create a link called 'Product Hunt Launch' that sends desktop visitors to the desktop landing page and mobile visitors to the mobile landing page."


Updates an existing link. Only include the fields you want to change.

Required scope: links:write

Same parameters as create_link, plus:

ParameterTypeRequiredDescription
linkIdstringID of the link to update
ogTitlestringOG title shown when the link is shared on social (max 255 chars)
ogDescriptionstringOG description for social previews (max 500 chars)
appearanceColorstringBrand hex color (e.g. #FF5733)

When rules is provided, the entire rules array is replaced. Include all rules you want to keep, not just the changed ones. The AI fetches existing rule IDs internally before updating.


Permanently deletes a link.

Required scope: links:delete

ParameterTypeRequiredDescription
linkIdstringID of the link to delete

Creates multiple links in a single request. Subject to the plan's link quota.

Required scope: links:bulk

ParameterTypeRequiredDescription
linksLinkInput[]Array of link objects (1–100). Each has the same fields as create_link

The response includes created (succeeded) and failed (failed with reason) arrays, so partial success is possible.


Returns click analytics for a single link, broken down by country, device, browser, OS, routing rule, and A/B variant.

Required scope: analytics:read

ParameterTypeRequiredDescription
linkIdstringLink ID
fromstringStart date YYYY-MM-DD (default: all time)
tostringEnd date YYYY-MM-DD (default: today)

get_workspace_analytics

Returns aggregated click analytics across all links in a workspace.

Required scope: analytics:read

ParameterTypeRequiredDescription
fromstringStart date YYYY-MM-DD (default: all time)
tostringEnd date YYYY-MM-DD (default: today)

Rule Object

Every link must have at least one rule. Exactly one rule must have isDefault: true — this is the fallback when no other rule's conditions match. The default rule cannot have any conditions.

FieldTypeDescription
targetUrlstringDestination URL (required)
isDefaultbooleantrue for the fallback rule (required)
countrystring[]ISO 3166-1 alpha-2 codes, e.g. ["UA", "DE"]
citystring[]City names. Requires country to be set
devicestring[]"desktop" "mobile" "tablet" "console" "smarttv" "wearable" "embedded"
osstring[]"Windows" "macOS" "Linux" "iOS" "Android"
browserstring[]"Chrome" "Firefox" "Safari" "Edge" "Opera" "Brave"
timeStartstringActive window start "HH:MM" UTC. Must pair with timeEnd
timeEndstringActive window end "HH:MM" UTC. Must pair with timeStart
daysOfWeekinteger[]Days: 0 = Sunday … 6 = Saturday
localestring[]Browser language codes, e.g. ["uk", "en"]
namestringOptional label for this rule

A/B Test Object

When abTest.enabled is true, clicks are split between variants according to their weights. Routing rules still apply first — the A/B split happens only for visitors matched by a given rule.

FieldTypeDescription
enabledbooleantrue to activate A/B testing
variantsVariant[]At least 2 variants required when enabled

Variant:

FieldTypeDescription
urlstringDestination URL for this variant
weightnumberRelative traffic share. E.g. 70 and 30 means a 70 %/30 % split

Error Handling

The MCP server returns standard JSON-RPC errors. Tool-level errors use the following codes:

CodeMeaning
-32602Invalid params — bad input (validation error, slug taken, etc.)
-32603Internal error — server-side failure

HTTP-level errors (before the tool is called):

HTTPCause
401Missing or invalid API key / Bearer token
403Key has no MCP permissions enabled, or key owner has no access to the workspace
404Workspace not found

Example Tool Calls

List your links:

"Show me all links in my workspace tagged summer-sale."

Create a geo-targeted link:

"Create a link called 'App Download'. Send iOS users to the App Store, Android users to Google Play, and everyone else to the website."

Update routing rules:

"Update link 664a1b2c… — add a rule that redirects German visitors to https://de.example.com."

Get last week's analytics:

"What were the top countries for link 664a1b2c… last week?"