Opn Mcp

io.github.ysalitrynskyi由 GitHub 账号 ysalitrynskyi 发布v1.2.0更新于 Oct 24, 2026

MCP server for opn.onl: shorten links, analytics, branded QR codes, and link management.

概览

AI 生成的概览

让助手在 opn.onl 或自建实例上缩短链接、读取点击分析、生成品牌二维码并管理链接。

可以做什么
这是 opn.onl(开源短链接服务)的 MCP 服务器。它提供创建短链接的工具(支持别名、标题、备注、定时、点击上限、密码、阅后即焚、文件夹和标签)、批量缩短、列出、更新、删除、克隆和置顶链接,以及检查别名是否可用。它还能读取单条链接和账户整体的分析数据(点击、独立访客、地域、设备、来源),返回可设品牌颜色和中心标志的二维码图片,并提供链接健康检查、UTM 构建、Open Graph 元数据预览以及标签和文件夹管理。
适用场景
适合让助手用自然语言创建和整理短链接、执行批量缩短活动,或查询链接与账户分析数据。也适合自建 opn.onl 实例、希望在 Claude Desktop 或 Cursor 等 MCP 客户端内管理链接的团队。
运行要求
以 stdio 方式在本地运行,通常通过 npx opn-mcp 启动,因此需要 Node.js。需要 opn.onl 的 API 密钥,放在 OPN_API_KEY 中,可在 Settings → API Keys 创建。默认连接托管 API;自建实例需将 OPN_BASE_URL 设为自有实例的 API 地址。需要能访问该 API 的网络。
安装前请注意
OPN_API_KEY 中的 API 密钥属于机密,会保存在客户端配置文件中,能读取该文件的人即可管理你的链接。相关工具可以创建、更新、删除、克隆和移动链接,助手的操作会改动线上数据。短链接可能是公开的,分析数据和目标网址会发送到所配置的 opn.onl API 主机。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Opn Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

opn-mcp

[opn-mcp MCP server]

An MCP server for opn.onl — the open-source, self-hostable URL shortener. It lets AI assistants (Claude Desktop, Cursor, etc.) shorten links, read analytics, generate QR codes, and manage links in natural language.

Works against the hosted service or your own self-hosted instance.

Setup

1. Get an API key

On your opn.onl instance, go to Settings → API Keys, create a key, and copy it (it starts with opn_ and is shown once).

2. Add the server to your MCP client

Claude Desktop — edit claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows):

json
{  "mcpServers": {    "opn": {      "command": "npx",      "args": ["-y", "opn-mcp"],      "env": {        "OPN_API_KEY": "opn_your_key_here"      }    }  }}

Restart your client. That's it — it talks to the hosted API (https://l.opn.onl) by default.

Prefer to run from source? Swap the args for the GitHub build — same config: "args": ["-y", "github:ysalitrynskyi/opn-mcp"] (it builds on install).

Self-hosted instance

Point OPN_BASE_URL at your own instance's API host:

json
{  "mcpServers": {    "opn": {      "command": "npx",      "args": ["-y", "opn-mcp"],      "env": {        "OPN_API_KEY": "opn_your_key_here",        "OPN_BASE_URL": "https://l.your-domain.com"      }    }  }}

Configuration

Env varRequiredDefaultDescription
OPN_API_KEY✅—Your API key (opn_…), from Settings → API Keys
OPN_BASE_URL—https://l.opn.onlAPI base URL — set this for a self-hosted instance

Tools

Links

ToolDescription
shorten_urlCreate a short link — optional alias, title, notes, scheduling (starts_at/expires_at), max_clicks, password, burn-after-reading, folder and tags
shorten_urls_bulkShorten many URLs at once, optionally into a folder
list_linksList your links (limit, offset, search, folder or tag filter)
update_linkUpdate destination, title, notes, scheduling, click limit, folder or protections; clear fields with remove_* flags
delete_linkDelete a link
clone_linkDuplicate a link under a fresh short code
toggle_link_pinPin or unpin a link
check_alias_availableCheck whether a custom alias is free before using it

Analytics

ToolDescription
get_link_statsPer-link analytics (clicks, unique visitors, geo, cities, devices, browsers, OS, referrers); optional days window
get_dashboard_statsAccount-wide analytics across all your links

QR & URL helpers

ToolDescription
get_qr_codeGet a link's QR image — optional brand colour, centre logo, PNG/SVG
check_url_healthCheck a destination URL is reachable before shortening
build_utm_urlAppend UTM campaign parameters to a URL
preview_url_metadataFetch Open Graph metadata (title, description, image) for a URL

Tags & folders

ToolDescription
list_tags / create_tagList or create tags
add_tags_to_link / remove_tags_from_linkAttach or detach tags on a link
list_folders / create_folderList or create folders
move_links_to_folderMove links into a folder

Example prompts

  • "Shorten https://example.com/very/long/url and call it launch-2026"
  • "Shorten these five URLs into a new folder called Q3 Campaign"
  • "How many clicks did link 42 get in the last 30 days, and from which countries?"
  • "Give me a branded SVG QR code for link 42"
  • "Tag my last 10 links as 'newsletter' and show my dashboard stats"
  • "Build a UTM link for https://example.com — source newsletter, medium email"

Development

bash
npm installnpm run build      # tsc → dist/npm test           # vitestOPN_API_KEY=opn_… npm run dev   # run from source (stdio)

Releasing

All three registries are owned by ysalitrynskyi (npm user, GitHub user, and the io.github.ysalitrynskyi MCP-registry namespace), so publishing must be done while signed in as that account.

  1. Bump the version in three places and keep them identical: package.json, server.json (top-level and the packages[0].version), and SERVER_VERSION in src/server.ts.
  2. Land it: commit to main and push. CI (.github/workflows/ci.yml) runs build + test — it does not publish.
  3. Publish to npm (as npm user ysalitrynskyi):
    bash
    npm loginnpm publish        # prepublishOnly runs the build
  4. Publish to the MCP registry (as GitHub user ysalitrynskyi):
    bash
    mcp-publisher validate      # optional, offline checkmcp-publisher login github  # interactive browser OAuthmcp-publisher publish

Smithery (smithery.yaml) and Glama (glama.json) track the npm/registry release automatically — no separate step.

License

MIT © ysalitrynskyi. Part of the opn.onl project.

来源:README.md,提交 1c4baa0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分