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 或自架執行個體上縮短連結、讀取點擊分析、產生品牌 QR 碼並管理連結。

可以做什麼
這是 opn.onl(開源短網址服務)的 MCP 伺服器。它提供建立短連結的工具(支援別名、標題、備註、排程、點擊上限、密碼、閱後即焚、資料夾與標籤)、批次縮短、列出、更新、刪除、複製與釘選連結,以及檢查別名是否可用。它也能讀取單一連結與整個帳號的分析資料(點擊、不重複訪客、地區、裝置、來源),回傳可設定品牌顏色與中央標誌的 QR 圖片,並提供連結健康檢查、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 分