Surli MCP Server Overview

The Surli Model Context Protocol (MCP) Server connects AI assistants directly to Surli's URL shortener infrastructure, enabling AI models to programmatically create, manage, inspect, and update short links in real-time.

By integrating Surli's MCP Server into your AI agent or workspace (Claude Desktop, Cursor, Antigravity, Windsurf, VS Code, Zed, etc.), your AI can autonomously shorten destination URLs, customize custom slugs/aliases, check plan quotas, and update destination targets.

Production MCP Server Endpoint
https://mcp.surl.li/mcp
Protocol: Model Context Protocol (MCP v2024-11-05) | Transports: SSE & HTTP JSON-RPC
Key Features & Capabilities:
  • Zero-friction URL Shortening: Create shortened URLs directly from AI chat conversations.
  • Dynamic Destination Updates: Remap existing short link destinations on the fly.
  • Custom Alias Management: Assign custom slugs/aliases to your short URLs.
  • Real-Time Quota Tracking: Track link usage, plan tiers, and remaining monthly quota.
  • Seamless Auth Flow: Supports both OAuth 2.0 (Google/Surli) and Direct API Key (X-API-KEY) authentication.
Quick Reference Architecture
Production Host: mcp.surl.li
SSE Stream: https://mcp.surl.li/mcp/sse
JSON-RPC Messages: https://mcp.surl.li/mcp/messages
Metadata Discovery: https://mcp.surl.li/mcp/metadata
Auth Types: OAuth 2.0 X-API-KEY
Tools Count: 5 Tools

Quickstart Guide (1-Minute Setup)

Connecting Surli MCP Server to your favorite AI environment takes less than a minute. Choose your AI client below or refer to the complete AI Clients Reference section.

Step 1
Obtain Your Surli API Key

Log in to your Surli account at surl.li, go to Account Settings → API Credentials, and copy your X-API-KEY.

Alternatively, connect via OAuth 2.0!
Step 2
Add Configuration

Paste the production MCP endpoint URL into your AI editor or client settings:

https://mcp.surl.li/mcp/sse
Step 3
Ask Your AI

Test your connection by asking your AI agent:

"Shorten https://github.com/surli with custom alias 'surli-mcp' using Surli tool."

What is MCP (Model Context Protocol)?

The Model Context Protocol (MCP) is an open specification created by Anthropic that standardizes how Artificial Intelligence applications (LLMs, AI agents, IDEs) communicate with external data sources, APIs, and tools.

Instead of custom API integrations for every single AI app, MCP provides a unified JSON-RPC protocol over standard transports like SSE (Server-Sent Events) and HTTP.

How Surli MCP Server Works
  1. Discovery: The AI client sends a tools/list JSON-RPC request to https://mcp.surl.li/mcp/messages.
  2. Capability Handshake: Surli MCP Server advertises available tools (create_short_link, get_short_link, etc.) along with JSON schemas.
  3. Tool Execution: When a user asks an AI to shorten a link, the AI formats a tools/call JSON-RPC request.
  4. Secure API Execution: Surli MCP Server executes the request against Surli's user API and returns formatted results directly to the AI conversation.
Why Use Surli MCP Server?
  • No Code Required: You don't need to write custom cURL or SDK code; AI handles parameter parsing automatically.
  • Safety & Scoping: Actions execute safely within your user plan limits and credentials.
  • Universal Client Compatibility: Works across Claude Desktop, Cursor, Antigravity, VS Code, Windsurf, Zed, LibreChat, and custom SDKs.
  • Real-Time Quota Awareness: AI agents inspect your remaining links before creating links to prevent quota errors.

Authentication Methods

Surli MCP Server supports two flexible authentication mechanisms: API Key Authentication for direct client integration, and OAuth 2.0 (Google/Surli OAuth) for seamless browser-based authentication.

Option 1 API Key Authentication

Pass your Surli API key using the standard X-API-KEY header or Authorization Bearer header.

X-API-KEY: YOUR_SURLI_API_KEY

Where to get: Copy your key from Surli Dashboard → API Keys.

Option 2 OAuth 2.0 Authorization Server

For OAuth-enabled MCP clients (like Claude Desktop and custom OAuth portals), Surli MCP Server operates as a standard OAuth 2.0 authorization server.

Metadata: /.well-known/oauth-authorization-server
Authorize: https://mcp.surl.li/oauth/authorize
Token: https://mcp.surl.li/oauth/token
Register: https://mcp.surl.li/oauth/register

Endpoints & Transport Protocol

Surli MCP Server supports both Server-Sent Events (SSE) for real-time streaming sessions and Stateless HTTP JSON-RPC endpoints.

Endpoint Method Transport Type Description
https://mcp.surl.li/mcp/sse GET SSE (Server-Sent Events) Establishes streaming SSE session and emits message endpoint URI.
https://mcp.surl.li/mcp/messages POST HTTP JSON-RPC 2.0 Handles initialize, tools/list, and tools/call RPC messages.
https://mcp.surl.li/mcp/metadata GET JSON Metadata Returns server capabilities, MCP protocol version, and active endpoint URLs.
https://mcp.surl.li/mcp GET / POST HTTP Endpoint Unified MCP endpoint for HTTP JSON-RPC clients.

AI Client Setup Configurations (11+ Supported AI Clients)

Below are tested, production-ready configuration blocks for 11 popular AI clients and agent frameworks using the production endpoint https://mcp.surl.li/mcp and SSE stream https://mcp.surl.li/mcp/sse.

Official Anthropic Client

File location: %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)

{
  "mcpServers": {
    "surli": {
      "command": "npx",
      "args": [
        "-y",
        "@openmcp/cli",
        "run",
        "https://mcp.surl.li/mcp/sse"
      ]
    }
  }
}
Cursor Settings → MCP

Open Cursor Settings → Features → MCP Servers, click + Add New MCP Server, select SSE type and enter URL, or add to .cursor/mcp.json:

{
  "mcpServers": {
    "surli": {
      "url": "https://mcp.surl.li/mcp/sse"
    }
  }
}
Antigravity Agentic IDE

Run in terminal: agy mcp add surli https://mcp.surl.li/mcp/sse or edit ~/.gemini/antigravity/mcp_config.json:

{
  "mcpServers": {
    "surli": {
      "serverUrl": "https://mcp.surl.li/mcp/sse"
    }
  }
}
Windsurf Editor

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "surli": {
      "serverUrl": "https://mcp.surl.li/mcp/sse"
    }
  }
}
VS Code Extension

In VS Code Roo Code tab, open MCP Settings and add SSE transport:

{
  "mcpServers": {
    "surli": {
      "type": "sse",
      "url": "https://mcp.surl.li/mcp/sse"
    }
  }
}
VS Code Extension

Edit cline_mcp_settings.json:

{
  "mcpServers": {
    "surli": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.surl.li/mcp/sse"]
    }
  }
}
Continue Plugin

Edit ~/.continue/config.json under experimental.mcpServers:

{
  "experimental": {
    "mcpServers": [
      {
        "name": "surli",
        "url": "https://mcp.surl.li/mcp/sse"
      }
    ]
  }
}
Zed Editor

Edit ~/.config/zed/settings.json under context_servers:

{
  "context_servers": {
    "surli": {
      "settings": {
        "url": "https://mcp.surl.li/mcp/sse"
      }
    }
  }
}
Goose CLI

Run command: goose mcp add surli -- sse https://mcp.surl.li/mcp/sse or edit ~/.config/goose/config.yaml:

mcp_servers:
  surli:
    type: sse
    url: https://mcp.surl.li/mcp/sse
LibreChat Open Source UI

Add to your librechat.yaml under mcpServers:

mcpServers:
  surli:
    type: sse
    url: https://mcp.surl.li/mcp/sse
Programmatic SDKs
Python SDK (mcp package):
from mcp import ClientSession
from mcp.client.sse import sse_client

async def run_surli():
    async with sse_client("https://mcp.surl.li/mcp/sse") as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools = await session.list_tools()
            print("Connected to Surli MCP! Tools available:", [t.name for t in tools.tools])
Node.js / TypeScript SDK (@modelcontextprotocol/sdk):
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

const transport = new SSEClientTransport(new URL("https://mcp.surl.li/mcp/sse"));
const client = new Client({ name: "SurliAgent", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);

const tools = await client.listTools();
console.log("Surli Tools:", tools);

Usage Examples & AI Prompts

Once Surli MCP Server is enabled in your AI agent, you can talk to your AI in plain conversational language. The AI agent will automatically call the appropriate Surli MCP tool.

Prompt: Shorten Links

"Hey, please shorten this destination link https://github.com/hypermans/dev-surli with custom alias 'dev-surli' and title 'Dev Surli Repo'."

AI Action: Calls create_short_link(destination_url='...', alias='dev-surli', title='Dev Surli Repo') and displays result.
Prompt: Check Account Quota

"How many short links do I have left in my Surli account for this month?"

AI Action: Calls get_account_limits() and reports plan tier, used count, and remaining quota.
Prompt: Update Link Destination

"Change the destination of link 'dev-surli' to point to https://surl.li/docs instead."

AI Action: Calls update_destination(surl='dev-surli', new_destination_url='https://surl.li/docs').
Prompt: Change Alias

"Update the alias of link 'dev-surli' to 'surli-api'."

AI Action: Calls update_alias(surl='dev-surli', new_alias='surli-api').
Error Codes & Troubleshooting
Error Code Meaning Solution
UNAUTHORIZED Missing or invalid Surli API Key. Log in to Surli and copy a valid API key into your client config or authenticate via OAuth.
LIMIT_EXHAUSTED Monthly short link quota reached. Upgrade plan tier at surl.li/en/tarif.
INVALID_URL Malformed destination URL. Provide valid absolute URL starting with http:// or https://.
FEATURE_NOT_AVAILABLE Custom alias update not supported on plan. Upgrade plan tier to Start/Basic/Pro to enable custom alias updates.