URL缩短工具

一个基于CleanURI API的URL缩短工具,可作为FastMCP服务器工具运行,适用于需要快速缩短URL的场景。

  • by Talismanic
  • Python
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 Talismanic/cleanuri-url-shortener-mcp

使用说明

URL缩短器MCP工具

该项目提供了一个简单的URL缩短工具,使用 CleanURI API 并且被设计为作为 FastMCP 服务器工具。

✨ 特性

  • 使用CleanURI API缩短任何给定的URL。
  • 通过FastMCP将功能作为工具公开。
  • 包括正确的错误处理和响应验证。
  • 设计用于通过 stdio 用于与基于代理或工具的系统集成的传输。

🚀 用法

1.要求

  • Python 3.10+
  • httpx
  • fastmcp

2.安装

通过Smithery安装

通过以下方式自动安装Claude Desktop的URL缩短工具 史密瑟里:

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

手动安装

uv add httpx 'mcp[cli]'

Docker安装:

docker build -t url-shortener .

3.跑步

uv run main.py

对于基于docker的使用,我们不需要在这里做任何事情。

4.添加克劳德桌面

随着紫外线

{
  "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",
        "url-shortener"
      ]
    }
  }
}