Back to MCP directory
publicPublicdnsLocal runtime

url-shortener

基于CleanURI API的URL短链接生成工具

article

README

🚀 短链接缩短工具 MCP 服务器

本项目是一个简单的 URL 缩短工具,借助 CleanURI 接口 实现 URL 缩短功能,并可运行在 FastMCP 服务器工具上。

🚀 快速开始

先决条件

  • Python 3.10+
  • httpx
  • fastmcp

安装

通过 Smithery 自动安装

若要通过 Smithery 自动在 Claude 桌面安装 URL 缩短工具,可执行以下命令:

npx -y @smithery/cli install @Talismanic/cleanuri-url-shortener-mcp --client claude

手动安装

uv add httpx 'mcp[cli]'

Docker 安装

docker build -t url-shortener .

运行

uv run main.py

若基于 Docker 使用,无需执行其他操作。

添加到 Claude 桌面

使用 uv

{
  "mcpServers": {
    "url-shortener": {
      "command": "/Users/{userName}/.local/bin/uv",
      "args": [
        "--directory",
        "{path_to_repo}/cleanuri-url-shortener-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

使用 Docker

{
  "mcpServers": {
    "url-shortener": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "-e",
        "DOCKER_CONTAINER=true"
      ]
    }
  }
}

✨ 主要特性

  • 利用 CleanURI API 缩短任意给定的 URL。
  • 通过 FastMCP 暴露功能。
  • 具备适当的错误处理和响应验证。
  • 设计为通过 stdio 传输运行,便于与代理或基于工具的系统集成。

项目状态徽章

smithery badge

项目链接

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client