Skip to main content
Glama

ShortURLMCP

PyPI version PyPI downloads Python 3.10+ License: MIT MCP

A Model Context Protocol (MCP) server for URL shortening using Short URL API through the AceDataCloud API.

Create short, shareable URLs directly from Claude, VS Code, or any MCP-compatible client.

Features

  • URL Shortening - Convert long URLs into short, shareable links

  • Batch Shortening - Shorten multiple URLs at once (up to 10 per batch)

  • Free Service - Zero credit consumption per request

  • Permanent Links - Short URLs never expire

  • surl.id Domain - Short URLs use the clean surl.id domain

  • Bearer Auth - Secure API access with token authentication

Related MCP server: opn-mcp

Tool Reference

Tool

Description

shorturl_create

Create a short URL from a long URL.

shorturl_batch_create

Create short URLs for multiple long URLs in a single batch.

shorturl_get_usage_guide

Get a comprehensive guide for using the ShortURL tools.

shorturl_get_api_info

Get information about the ShortURL API service.

Quick Start

1. Get Your API Token

  1. Sign up at AceDataCloud Platform

  2. Go to the API documentation page

  3. Click "Acquire" to get your API token

  4. Copy the token for use below

AceDataCloud hosts a managed MCP server — no local installation required.

Endpoint: https://shorturl.mcp.acedata.cloud/mcp

All requests require a Bearer token. Use the API token from Step 1.

Claude.ai

Connect directly on Claude.ai with OAuth — no API token needed:

  1. Go to Claude.ai Settings → Integrations → Add More

  2. Enter the server URL: https://shorturl.mcp.acedata.cloud/mcp

  3. Complete the OAuth login flow

  4. Start using the tools in your conversation

Claude Desktop

Add to your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Cursor / Windsurf

Add to your MCP config (.cursor/mcp.json or .windsurf/mcp.json):

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

VS Code (Copilot)

Add to your VS Code MCP config (.vscode/mcp.json):

{
  "servers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Or install the Ace Data Cloud MCP extension for VS Code, which registers the hosted MCP servers with one-click setup.

JetBrains IDEs

  1. Go to Settings → Tools → AI Assistant → Model Context Protocol (MCP)

  2. Click AddHTTP

  3. Paste:

{
  "mcpServers": {
    "shorturl": {
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Claude Code

Claude Code supports MCP servers natively:

claude mcp add shorturl --transport http https://shorturl.mcp.acedata.cloud/mcp \
  -h "Authorization: Bearer YOUR_API_TOKEN"

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Cline

Add to Cline's MCP settings (.cline/mcp_settings.json):

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Amazon Q Developer

Add to your MCP configuration:

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Roo Code

Add to Roo Code MCP settings:

{
  "mcpServers": {
    "shorturl": {
      "type": "streamable-http",
      "url": "https://shorturl.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

Continue.dev

Add to .continue/config.yaml:

mcpServers:
  - name: shorturl
    type: streamable-http
    url: https://shorturl.mcp.acedata.cloud/mcp
    headers:
      Authorization: "Bearer YOUR_API_TOKEN"

Zed

Add to Zed's settings (~/.config/zed/settings.json):

{
  "language_models": {
    "mcp_servers": {
      "shorturl": {
        "url": "https://shorturl.mcp.acedata.cloud/mcp",
        "headers": {
          "Authorization": "Bearer YOUR_API_TOKEN"
        }
      }
    }
  }
}

cURL Test

# Health check (no auth required)
curl https://shorturl.mcp.acedata.cloud/health

# MCP initialize
curl -X POST https://shorturl.mcp.acedata.cloud/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

3. Or Run Locally (Alternative)

If you prefer to run the server on your own machine:

# Install from PyPI
pip install mcp-shorturl
# or
uvx mcp-shorturl

# Set your API token
export ACEDATACLOUD_API_TOKEN="your_token_here"

# Run (stdio mode for Claude Desktop / local clients)
mcp-shorturl

# Run (HTTP mode for remote access)
mcp-shorturl --transport http --port 8000

Claude Desktop (Local)

{
  "mcpServers": {
    "shorturl": {
      "command": "uvx",
      "args": ["mcp-shorturl"],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "your_token_here"
      }
    }
  }
}

Docker (Self-Hosting)

docker pull ghcr.io/acedatacloud/mcp-shorturl:latest
docker run -p 8000:8000 ghcr.io/acedatacloud/mcp-shorturl:latest

Clients connect with their own Bearer token — the server extracts the token from each request's Authorization header.

Available Tools

URL Shortening Tools

Tool

Description

shorturl_create

Shorten a single URL

shorturl_batch_create

Shorten multiple URLs at once (max 10)

Information Tools

Tool

Description

shorturl_get_usage_guide

Get comprehensive usage guide

shorturl_get_api_info

Get API details and error codes

Usage Examples

Shorten a Single URL

User: Shorten this URL: https://platform.acedata.cloud/documents/shorturl

Claude: I'll shorten that URL for you.
[Calls shorturl_create with url="https://platform.acedata.cloud/documents/shorturl"]

Result: https://surl.id/1uHCs01xa5

Batch Shorten Multiple URLs

User: Shorten these URLs for my social media posts:
- https://example.com/blog/very-long-article-title-about-ai
- https://example.com/products/new-release-2024

Claude: I'll shorten both URLs at once.
[Calls shorturl_batch_create with urls=[...]]
User: I need clean short links for these reference URLs in my doc.

Claude: I'll create short links for all your references.
[Calls shorturl_batch_create with the list of URLs]

Response Structure

Successful Response

{
  "success": true,
  "data": {
    "url": "https://surl.id/1uHCs01xa5"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

Configuration

Environment Variables

Variable

Description

Default

ACEDATACLOUD_API_TOKEN

API token from AceDataCloud

Required

ACEDATACLOUD_API_BASE_URL

API base URL

https://api.acedata.cloud

ACEDATACLOUD_OAUTH_CLIENT_ID

OAuth client ID (hosted mode)

ACEDATACLOUD_PLATFORM_BASE_URL

Platform base URL

https://platform.acedata.cloud

SHORTURL_REQUEST_TIMEOUT

Request timeout in seconds

30

LOG_LEVEL

Logging level

INFO

Command Line Options

mcp-shorturl --help

Options:
  --version          Show version
  --transport        Transport mode: stdio (default) or http
  --port             Port for HTTP transport (default: 8000)

Development

Setup Development Environment

# Clone repository
git clone https://github.com/AceDataCloud/ShortURLMCP.git
cd ShortURLMCP

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or `.venv\Scripts\activate` on Windows

# Install with dev dependencies
pip install -e ".[dev,test]"

Run Tests

# Run unit tests
pytest

# Run with coverage
pytest --cov=core --cov=tools

# Run integration tests (requires API token)
pytest tests/test_integration.py -m integration

Code Quality

# Format code
ruff format .

# Lint code
ruff check .

# Type check
mypy core tools

Build & Publish

# Install build dependencies
pip install -e ".[release]"

# Build package
python -m build

# Upload to PyPI
twine upload dist/*

Project Structure

ShortURLMCP/
├── core/                   # Core modules
│   ├── __init__.py
│   ├── client.py          # HTTP client for ShortURL API
│   ├── config.py          # Configuration management
│   ├── exceptions.py      # Custom exceptions
│   └── server.py          # MCP server initialization
├── tools/                  # MCP tool definitions
│   ├── __init__.py
│   ├── shorturl_tools.py  # URL shortening tools
│   └── info_tools.py      # Information tools
├── prompts/                # MCP prompt templates
│   └── __init__.py
├── tests/                  # Test suite
│   ├── conftest.py
│   ├── test_client.py
│   ├── test_config.py
│   └── test_integration.py
├── deploy/                 # Deployment configs
│   ├── run.sh
│   └── production/
│       ├── deployment.yaml
│       ├── ingress.yaml
│       └── service.yaml
├── .env.example           # Environment template
├── .gitignore
├── .ruff.toml             # Ruff linter configuration
├── CHANGELOG.md
├── Dockerfile             # Docker image for HTTP mode
├── docker-compose.yaml    # Docker Compose config
├── LICENSE
├── main.py                # Entry point
├── pyproject.toml         # Project configuration
└── README.md

API Reference

This server wraps the AceDataCloud Short URL API:

  • Endpoint: POST /shorturl

  • Input: { "content": "https://long-url.example.com/..." }

  • Output: { "success": true, "data": { "url": "https://surl.id/..." } }

  • Pricing: Free (0 credits)

  • Auth: Bearer token

Full API documentation: AceDataCloud Platform

Documentation

Documentation

License

MIT License - see LICENSE for details.

Available Tools

4 tools
shorturl_batch_createAInspect

Create short URLs for multiple long URLs in a single batch.

Shortens multiple URLs at once, returning a mapping of original URLs
to their shortened versions. Useful for bulk URL shortening tasks.

Args:
    urls: A list of long URLs to shorten (max 10 per batch).

Returns:
    JSON response containing the mapping of original to shortened URLs.

Example:
    shorturl_batch_create(urls=["https://example.com/long-url-1", "https://example.com/long-url-2"])
ParametersJSON Schema
NameRequiredDescriptionDefault
urlsYesA list of long URLs to shorten. Each must be a valid HTTP or HTTPS URL. Maximum 10 URLs per batch.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description provides key behavioral details: it returns a mapping of original to shortened URLs, handles multiple URLs, and enforces a maximum of 10 per batch. It does not mention error handling or idempotency, but covers the core behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at about 6 sentences, well-structured with a title, explanation, args, returns, and an example. No wasted words, and all sentences are informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema and only one parameter, the description fully covers the tool's purpose, usage constraints, and provides an example. It is complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description repeats the constraint of 'max 10 per batch' which is already in the schema description, thus adds no new meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool creates short URLs for multiple long URLs in a single batch, which distinguishes it from the sibling tool shorturl_create that likely handles a single URL. The verb 'Create' and resource 'short URLs' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'useful for bulk URL shortening tasks,' which implies when to use this tool over alternatives. However, it does not explicitly state when not to use it or name alternatives like shorturl_create for single URLs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

shorturl_createAInspect

Create a short URL from a long URL.

Converts a long URL into a short, easy-to-share URL using the ShortURL API.
The short URL redirects to the original long URL when visited.

This is useful for:
- Sharing links on social media with character limits
- Creating clean, memorable links for marketing
- Tracking link clicks and engagement
- Making long URLs more manageable in documents and messages

Args:
    url: The long URL to shorten. Must be a valid HTTP or HTTPS URL.

Returns:
    JSON response containing the shortened URL.

Example:
    shorturl_create(url="https://platform.acedata.cloud/documents/a2303356-6672-4eb8-9778-75f55c998fe9")
ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe long URL to shorten. Must be a valid HTTP or HTTPS URL. Required.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description only mentions conversion and redirection. Lacks details on rate limits, authentication, costs, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with bullet points and example. Front-loaded with main action. Some redundancy but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple tool with output schema but description vague on return structure. Lacks error handling or validation details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% with clear parameter description. Description adds examples but no additional meaning beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Create a short URL from a long URL' with specific verb and resource. Distinguishes from siblings like batch_create, get_api_info, get_usage_guide.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Lists use cases (social media, marketing, tracking, documents) but does not explicitly state when not to use or compare to batch_create.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

shorturl_get_api_infoAInspect

Get information about the ShortURL API service.

Returns details about the API endpoint, pricing, and service capabilities.

Returns:
    API information and service details.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions it returns API information and service details but does not disclose side effects, authentication needs, or rate limits. For a simple info tool, it is minimally adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences plus a returns line. It is concise but slightly redundant repeating 'Returns:' line. Not verbose, but could be more streamlined.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no parameters and an output schema present, the description gives adequate info about returns. However, it lacks context on authentication or how it differs from shorturl_get_usage_guide, making it just adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, and schema coverage is 100%. The description adds value by explaining what information is returned (API endpoint, pricing, capabilities), which goes beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it gets information about the ShortURL API service, including endpoint, pricing, and capabilities. It distinguishes from siblings: shorturl_batch_create and shorturl_create are for creating URLs, shorturl_get_usage_guide is about usage guide, not API info.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives like shorturl_get_usage_guide. Usage is implied but no exclusion or guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

shorturl_get_usage_guideAInspect

Get a comprehensive guide for using the ShortURL tools.

Provides detailed information on how to use the ShortURL tools
effectively, including parameters, examples, and best practices.

Returns:
    Complete usage guide for ShortURL tools.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool returns a guide but does not disclose read-only behavior, side effects, authentication requirements, or rate limits. The description is minimal on behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and to the point, with two brief paragraphs and a Returns line. There is minor repetition of 'ShortURL tools', but overall it is efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple nature of the tool (a guide retriever) and the presence of an output schema (though not visible), the description covers the main purpose and return value. It could mention the format of the guide, but it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters, so the description does not need to add parameter-level meaning. Schema coverage is 100% (0 params), and the baseline for no parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves a comprehensive guide for using ShortURL tools. It uses a specific verb ('Get') and resource ('usage guide'), and this purpose is distinct from sibling tools like shorturl_create or shorturl_get_api_info.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when one needs to learn how to use ShortURL tools effectively, but it does not provide explicit guidance on when to use this tool versus alternatives (e.g., shorturl_get_api_info) or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: single create, batch create, API info, and usage guide. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent 'shorturl_' prefix with verb_noun pattern (e.g., batch_create, get_api_info). Perfectly uniform.

Tool Count5/5

With 4 tools, the server is well-scoped for a URL shortening service. It covers the core operations (create, batch create) and supporting info tools.

Completeness4/5

Covers all essential creation and information needs. Minor gap: no delete or update functionality, but agents can manage by creating new short URLs.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Provides a simple tool to shorten URLs using the CleanURI API, designed to run as a FastMCP server that can be integrated with agent or tool-based systems.
    1
    4
    Apache 2.0
  • A
    license
    B
    quality
    A
    maintenance
    MCP server for opn.onl, the open-source self-hostable URL shortener. Shorten links, read click analytics, generate branded QR codes, and manage links — against the hosted service or your own instance.
    24
    48
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that enables AI agents to manage Lnkify links, domains, API keys, and analytics. Allows creation and resolution of short links through natural language.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Official MCP server for INBIO's URL shortener with click analytics and customizable QR codes. Enables link shortening, QR code generation, and link management with optional authentication for advanced features.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AceDataCloud/ShortURLMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server