Skip to main content
Glama

ShortURLMCP

PyPI version PyPI downloads Python 3.10+ License: MIT MCP

Сервер Model Context Protocol (MCP) для сокращения URL с использованием Short URL API через AceDataCloud API.

Создавайте короткие ссылки, которыми можно делиться, прямо из Claude, VS Code или любого другого клиента, совместимого с MCP.

Возможности

  • Сокращение URL - Превращайте длинные URL в короткие ссылки для обмена

  • Пакетное сокращение - Сокращайте несколько URL одновременно (до 10 за раз)

  • Бесплатный сервис - Нулевое потребление кредитов за запрос

  • Постоянные ссылки - Короткие URL никогда не истекают

  • Домен surl.id - Короткие URL используют чистый домен surl.id

  • Bearer Auth - Безопасный доступ к API с аутентификацией по токену

Related MCP server: lnkify

Справочник инструментов

Инструмент

Описание

shorturl_create

Создать короткий URL из длинного URL.

shorturl_batch_create

Создать короткие URL для нескольких длинных URL в одном пакете.

shorturl_get_usage_guide

Получить подробное руководство по использованию инструментов ShortURL.

shorturl_get_api_info

Получить информацию о сервисе ShortURL API.

Быстрый старт

1. Получите ваш API-токен

  1. Зарегистрируйтесь на платформе AceDataCloud

  2. Перейдите на страницу документации API

  3. Нажмите "Acquire", чтобы получить ваш API-токен

  4. Скопируйте токен для использования ниже

2. Используйте хостинг-сервер (рекомендуется)

AceDataCloud предоставляет управляемый MCP-сервер — локальная установка не требуется.

Эндпоинт: https://shorturl.mcp.acedata.cloud/mcp

Все запросы требуют токен Bearer. Используйте API-токен из шага 1.

Claude.ai

Подключайтесь напрямую на Claude.ai через OAuth — API-токен не требуется:

  1. Перейдите в Claude.ai Settings → Integrations → Add More

  2. Введите URL сервера: https://shorturl.mcp.acedata.cloud/mcp

  3. Завершите процесс входа через OAuth

  4. Начните использовать инструменты в вашем диалоге

Claude Desktop

Добавьте в ваш конфиг (~/Library/Application Support/Claude/claude_desktop_config.json на macOS):

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

Cursor / Windsurf

Добавьте в ваш MCP-конфиг (.cursor/mcp.json или .windsurf/mcp.json):

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

VS Code (Copilot)

Добавьте в ваш MCP-конфиг VS Code (.vscode/mcp.json):

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

Или установите расширение Ace Data Cloud MCP для VS Code, которое объединяет все 15 MCP-серверов с настройкой в один клик.

JetBrains IDEs

  1. Перейдите в Settings → Tools → AI Assistant → Model Context Protocol (MCP)

  2. Нажмите Add → HTTP

  3. Вставьте:

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

Claude Code

Claude Code поддерживает MCP-серверы нативно:

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

Или добавьте в .mcp.json вашего проекта:

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

Cline

Добавьте в настройки MCP Cline (.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

Добавьте в вашу конфигурацию MCP:

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

Roo Code

Добавьте в настройки MCP Roo Code:

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

Continue.dev

Добавьте в .continue/config.yaml:

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

Zed

Добавьте в настройки Zed (~/.config/zed/settings.json):

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

Тест cURL

# 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. Или запустите локально (альтернатива)

Если вы предпочитаете запускать сервер на своей машине:

# 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 (локально)

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

Docker (самохостинг)

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

Клиенты подключаются со своим собственным токеном Bearer — сервер извлекает токен из заголовка Authorization каждого запроса.

Доступные инструменты

Инструменты сокращения URL

Инструмент

Описание

shorturl_create

Сократить один URL

shorturl_batch_create

Сократить несколько URL одновременно (макс. 10)

Информационные инструменты

Инструмент

Описание

shorturl_get_usage_guide

Получить подробное руководство по использованию

shorturl_get_api_info

Получить детали API и коды ошибок

Примеры использования

Сокращение одного URL

User: Shorten this URL: https://platform.acedata.cloud/documents/a2303356-6672-4eb8-9778-75f55c998fe9

Claude: I'll shorten that URL for you.
[Calls shorturl_create with url="https://platform.acedata.cloud/documents/a2303356-6672-4eb8-9778-75f55c998fe9"]

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

Пакетное сокращение нескольких URL

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]

Структура ответа

Успешный ответ

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

Ответ с ошибкой

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

Конфигурация

Переменные окружения

Переменная

Описание

По умолчанию

ACEDATACLOUD_API_TOKEN

API-токен от AceDataCloud

Обязательно

ACEDATACLOUD_API_BASE_URL

Базовый URL API

https://api.acedata.cloud

ACEDATACLOUD_OAUTH_CLIENT_ID

OAuth client ID (режим хостинга)

—

ACEDATACLOUD_PLATFORM_BASE_URL

Базовый URL платформы

https://platform.acedata.cloud

SHORTURL_REQUEST_TIMEOUT

Тайм-аут запроса в секундах

30

LOG_LEVEL

Уровень логирования

INFO

Параметры командной строки

mcp-shorturl --help

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

Разработка

Настройка среды разработки

# 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 unit tests
pytest

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

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

Качество кода

# Format code
ruff format .

# Lint code
ruff check .

# Type check
mypy core tools

Сборка и публикация

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

# Build package
python -m build

# Upload to PyPI
twine upload dist/*

Структура проекта

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

Этот сервер является оберткой для AceDataCloud Short URL API:

  • Эндпоинт: POST /shorturl

  • Входные данные: { "content": "https://long-url.example.com/..." }

  • Выходные данные: { "success": true, "data": { "url": "https://surl.id/..." } }

  • Стоимость: Бесплатно (0 кредитов)

  • Аутентификация: Bearer token

Полная документация API: AceDataCloud Platform

Лицензия

MIT License - подробности см. в LICENSE.

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"])

Inputs: urls (required). Returns: result

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")

Inputs: url (required). Returns: result

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.

Inputs: no named parameters. Returns: result

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.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    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

    ActivityActive
    ResponsivenessLimited data

    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
      Not graded
      quality
      D
      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
    • F
      license
      Not graded
      quality
      D
      maintenance
      Free URL shortener with a hosted MCP server. Create, update, and bulk-create short links with custom aliases and QR codes, and read click analytics (countries, cities, devices, browsers, referrers, UTM) from Claude, Cursor, or any MCP client. Unlimited links on the free plan; read-only and write scopes are assigned per API key.
      1
      -