shorten.dev/docs
shorten.dev/docs
Getting StartedAuthentication
OverviewSetupTools Reference
MCP Integration

Tools Reference

Complete reference for all available tools in the Shorten MCP server.

Authentication

MCP requests are authenticated using the same API keys as the REST API. Pass your key in the Authorization header of the MCP connection.

ToolRequired scope
create_short_linkwrite
bulk_create_linkswrite
list_linksread
get_analyticsread
revoke_linkwrite
generate_qrread

An API key with read + write scopes covers all tools.


create_short_link

Create a new shortened link.

Parameters

NameTypeRequiredDescription
urlstringYesDestination URL to shorten
custom_slugstringNoCustom slug (auto-generated if omitted)
tagsstring[]NoTags for organization (max 3, each ≤ 50 chars)
include_qrbooleanNoInclude QR code SVG in response

Example prompt

"Shorten this URL: https://docs.example.com/api/v2/getting-started"

Response

{
  "short_url": "https://r.shorten.dev/x7kQ2m",
  "link": {
    "slug": "x7kQ2m",
    "destination_url": "https://docs.example.com/api/v2/getting-started",
    "status": "active",
    "threat_type": null,
    "revoked_at": null,
    "tags": [],
    "created_at": "2026-02-15T12:00:00Z",
    "updated_at": "2026-02-15T12:00:00Z"
  }
}

bulk_create_links

Create multiple shortened links in a single request (max 500). The operation is all-or-nothing.

Parameters

NameTypeRequiredDescription
linksarrayYesArray of link objects (1–500)
links[].urlstringYesDestination URL to shorten
links[].custom_slugstringNoCustom slug (auto-generated if omitted)
links[].tagsstring[]NoTags for organization (max 3, each ≤ 50 chars)

Example prompt

"Create short links for these three docs pages: https://docs.example.com/guide-1, https://docs.example.com/guide-2, https://docs.example.com/guide-3"

Response

{
  "links": [
    {
      "link": {
        "slug": "aB3nP9k",
        "destination_url": "https://docs.example.com/guide-1",
        "status": "active",
        "threat_type": null,
        "revoked_at": null,
        "tags": [],
        "created_at": "2026-02-23T00:00:00Z",
        "updated_at": "2026-02-23T00:00:00Z"
      },
      "short_url": "https://r.shorten.dev/aB3nP9k"
    }
  ],
  "total_created": 3
}

list_links

List all links for the authenticated user with optional filtering.

Parameters

NameTypeRequiredDescription
limitintegerNoMaximum results (default: 10, max: 50)
statusstringNoFilter: active, flagged, or revoked
searchstringNoSearch in slug and destination URL

Example prompt

"Show me my 5 most recent active links"

Response

{
  "links": [
    {
      "slug": "x7kQ2m",
      "destination_url": "https://docs.example.com/tutorials",
      "status": "active",
      "threat_type": null,
      "revoked_at": null,
      "tags": ["marketing"],
      "created_at": "2026-02-15T12:00:00Z",
      "updated_at": "2026-02-15T12:00:00Z"
    }
  ],
  "total": 25
}

get_analytics

Retrieve click analytics for a specific link.

Parameters

NameTypeRequiredDescription
slugstringYesThe link slug
periodstringNo7d, 30d, or 90d (default: 7d)

Example prompt

"How many clicks did r.shorten.dev/x7kQ2m get this month?"

Response

{
  "slug": "x7kQ2m",
  "period": "30d",
  "total_clicks": 12847,
  "unique_visitors": 8234,
  "time_series": [
    { "date": "2026-01-17", "clicks": 423 },
    { "date": "2026-01-18", "clicks": 512 }
  ],
  "top_referrers": [
    { "referrer": "google.com", "count": 4521 },
    { "referrer": "twitter.com", "count": 2103 }
  ],
  "top_countries": [
    { "country": "US", "count": 5423 },
    { "country": "GB", "count": 1876 }
  ],
  "top_devices": [
    { "device": "desktop", "count": 7981 },
    { "device": "mobile", "count": 3989 }
  ],
  "top_browsers": [
    { "browser": "Chrome", "count": 7234 },
    { "browser": "Safari", "count": 2876 }
  ]
}

revoke_link

Permanently revoke a shortened link. The short URL will stop redirecting immediately. This cannot be undone.

Parameters

NameTypeRequiredDescription
slugstringYesThe link slug to revoke

Example prompt

"Revoke the link r.shorten.dev/x7kQ2m — it's no longer needed"

Response

{
  "slug": "x7kQ2m",
  "destination_url": "https://docs.example.com/api/v2/getting-started",
  "status": "revoked",
  "threat_type": null,
  "revoked_at": "2026-02-23T18:30:00Z",
  "tags": [],
  "created_at": "2026-02-15T12:00:00Z",
  "updated_at": "2026-02-23T18:30:00Z"
}

generate_qr

Generate a QR code for an existing shortened link.

Parameters

NameTypeRequiredDescription
slugstringYesThe link slug to generate a QR code for
formatstringNoOutput format: svg (default) or png_data_url

Example prompt

"Generate a QR code for r.shorten.dev/x7kQ2m"

Response

{
  "slug": "x7kQ2m",
  "short_url": "https://r.shorten.dev/x7kQ2m",
  "format": "svg",
  "qr_code": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>...</svg>"
}

Setup

Step-by-step instructions for connecting AI clients to the Shorten MCP server.

On this page

Authenticationcreate_short_linkbulk_create_linkslist_linksget_analyticsrevoke_linkgenerate_qr