跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt

Use this file to discover all available pages before exploring further.

MCP(Model Context Protocol) 是由 Anthropic 推出的模型上下文协议,允许 AI 模型(如 Claude、GPT 等)通过标准化接口调用外部工具。通过 AceData Cloud 提供的 ShortURL MCP Server,你可以在 Claude Desktop、VS Code、Cursor 等 AI 客户端中直接生成短链接。

功能概览

ShortURL MCP Server 提供以下核心功能:
  • 单个链接缩短 — 将长 URL 转换为简短易分享的短链接
  • 批量链接缩短 — 一次性缩短多个 URL(最多 10 个)
  • 使用指南 — 获取完整的使用说明和最佳实践
  • API 信息 — 查看 API 服务详情和错误码说明

前置准备

使用前,你需要获取 AceData Cloud API Token:
  1. 注册或登录 AceData Cloud 平台
  2. 前往 ShortURL API 页面
  3. 点击「Acquire」获取 API Token(首次申请赠送免费额度)

安装配置

方式一:pip 安装(推荐)

pip install mcp-shorturl

方式二:源码安装

git clone https://github.com/AceDataCloud/MCPShortURL.git
cd MCPShortURL
pip install -e .
安装完成后,即可使用 mcp-shorturl 命令启动服务。

在 Claude Desktop 中使用

编辑 Claude Desktop 配置文件:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
  "mcpServers": {
    "shorturl": {
      "command": "mcp-shorturl",
      "env": {
        "ACEDATACLOUD_API_TOKEN": "你的API Token"
      }
    }
  }
}
如果使用 uvx(无需提前安装包):
{
  "mcpServers": {
    "shorturl": {
      "command": "uvx",
      "args": ["mcp-shorturl"],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "你的API Token"
      }
    }
  }
}
保存配置后重启 Claude Desktop,即可在对话中使用 ShortURL 相关工具。

在 VS Code / Cursor 中使用

在项目根目录创建 .vscode/mcp.json
{
  "servers": {
    "shorturl": {
      "command": "mcp-shorturl",
      "env": {
        "ACEDATACLOUD_API_TOKEN": "你的API Token"
      }
    }
  }
}
或者使用 uvx
{
  "servers": {
    "shorturl": {
      "command": "uvx",
      "args": ["mcp-shorturl"],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "你的API Token"
      }
    }
  }
}

可用工具列表

工具名说明
shorturl_create缩短单个 URL
shorturl_batch_create批量缩短多个 URL(最多 10 个)
shorturl_get_usage_guide获取完整使用指南
shorturl_get_api_info获取 API 服务详情

使用示例

配置完成后,你可以在 AI 客户端中直接用自然语言调用这些功能,例如:
  • 「帮我把这个链接缩短一下」
  • 「批量缩短这 5 个 URL」
  • 「生成一个短链接用于分享」

更多信息