XS Shlink MCP

XS Shlink MCP

Enables to manage and analyze a Shlink URL-shortener instance with tools for short URLs, visits, tags, domains, redirect rules, QR codes, and Mercure integration.

Category
访问服务器

README

XS Shlink MCP

npm version CI Node.js License: MIT

A local Model Context Protocol server for managing and analyzing a Shlink URL-shortener instance.

XS Shlink MCP runs over stdio, keeps the Shlink API key on the machine running the MCP client, and does not require Docker or a separate hosted service.

Features

  • 23 tools for short URLs, visits, tags, domains, redirect rules, QR codes, and Mercure integration information
  • Typed and validated tool inputs
  • Structured Shlink API errors with request IDs
  • Bounded pagination and request timeouts
  • Destructive operations disabled by default
  • Windows, macOS, and Linux support through Node.js

Requirements

  • Node.js 20 or newer
  • A reachable Shlink instance
  • A Shlink API key

The initial release was tested with Shlink 5.1.5 and REST API version 3.

Quick start

Configure an MCP client to launch the published npm package:

{
  "mcpServers": {
    "shlink": {
      "command": "npx",
      "args": ["-y", "xs-shlink-mcp"],
      "env": {
        "SHLINK_BASE_URL": "https://s.example.com",
        "SHLINK_API_KEY": "replace-me",
        "SHLINK_API_VERSION": "3",
        "SHLINK_ALLOW_DESTRUCTIVE": "false"
      }
    }
  }
}

On Windows, use "command": "npx.cmd" if the MCP client does not resolve the .cmd shim automatically.

The MCP client starts and stops the server automatically. Do not run ordinary interactive commands through the server's standard input because stdio is reserved for MCP protocol messages.

Configuration

Variable Required Default Description
SHLINK_BASE_URL Yes - Shlink origin without /rest, such as https://s.example.com
SHLINK_API_KEY Yes - Shlink API key
SHLINK_API_VERSION No 3 REST API major version
SHLINK_TIMEOUT_MS No 10000 Per-request timeout in milliseconds
SHLINK_ALLOW_DESTRUCTIVE No false Enables deletion tools when set to true

Never commit an API key. Tool results and errors do not include it.

Tools

Short URLs

  • list_short_urls
  • get_short_url
  • create_short_url
  • edit_short_url
  • delete_short_url
  • get_qr_code_url

get_qr_code_url supports Shlink's QR-code customization parameters: size, margin, PNG or SVG format, error-correction level, block-size rounding, and foreground/background colors. Shlink deprecated its built-in QR-code endpoint in version 4.5, so this tool is provided for compatibility with instances that still expose it.

Analytics and visits

  • get_visit_stats
  • get_short_url_visits
  • get_tag_visits
  • get_domain_visits
  • list_orphan_visits
  • list_non_orphan_visits
  • delete_short_url_visits
  • delete_orphan_visits

Redirect rules, tags, and domains

  • get_redirect_rules
  • set_redirect_rules
  • list_tags
  • rename_tag
  • delete_tags
  • list_domains
  • set_domain_redirects

Monitoring and integrations

  • shlink_health
  • get_mercure_info

All deletion tools require both SHLINK_ALLOW_DESTRUCTIVE=true and an explicit confirm: true tool argument.

Test with MCP Inspector

Set the API key in the current shell, then launch the published package.

PowerShell:

$env:SHLINK_API_KEY="replace-me"
npx.cmd -y @modelcontextprotocol/inspector -e "SHLINK_BASE_URL=https://s.example.com" -e "SHLINK_API_KEY=$env:SHLINK_API_KEY" -e "SHLINK_API_VERSION=3" -e "SHLINK_ALLOW_DESTRUCTIVE=false" -- npx.cmd -y xs-shlink-mcp

macOS or Linux:

export SHLINK_API_KEY="replace-me"
npx -y @modelcontextprotocol/inspector \
  -e SHLINK_BASE_URL=https://s.example.com \
  -e SHLINK_API_KEY="$SHLINK_API_KEY" \
  -e SHLINK_API_VERSION=3 \
  -e SHLINK_ALLOW_DESTRUCTIVE=false \
  -- npx -y xs-shlink-mcp

Start with shlink_health, followed by list_short_urls.

Local development

git clone https://github.com/AlexGreenUK/XS-Shlink-MCP.git
cd XS-Shlink-MCP
npm install
npm run validate

The automated tests use mocked Shlink responses. They do not require or modify a live Shlink instance.

Useful commands:

npm run dev
npm run build
npm test
npm pack --dry-run

Releases

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md. Use GitHub's private vulnerability reporting instead of opening a public issue for sensitive reports.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选