Opn Mcp

io.github.ysalitrynskyiPublished by GitHub account ysalitrynskyiv1.2.0Updated Oct 24, 2026

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

Overview

AI-generated overview

Lets an assistant shorten URLs, read click analytics, generate branded QR codes, and manage links on opn.onl or a self-hosted instance.

What you can do
An MCP server for opn.onl, an open-source URL shortener. It exposes tools to create short links (with alias, title, notes, scheduling, click limits, password, burn-after-reading, folder and tags), bulk-shorten URLs, list, update, delete, clone and pin links, and check alias availability. It also reads per-link and account-wide analytics (clicks, unique visitors, geography, devices, referrers), returns QR images with optional brand colour and centre logo, and offers helpers such as URL health checks, UTM builder and Open Graph metadata preview, plus tag and folder management.
When to use it
Useful when you want an assistant to create and organise short links, run bulk shortening campaigns, or pull link and dashboard analytics in natural language. Also fits teams running their own opn.onl instance who want link management inside an MCP client such as Claude Desktop or Cursor.
Requirements
Runs locally over stdio, typically via npx opn-mcp, so Node.js is needed. Requires an opn.onl API key in OPN_API_KEY, created under Settings → API Keys. By default it talks to the hosted API; set OPN_BASE_URL to your own instance's API host for self-hosting. Network access to that API is required.
Before you install
The API key in OPN_API_KEY is a secret and is stored in the client configuration file; anyone with the file can manage your links. Tools can create, update, delete, clone and move links, so assistant actions change live data. Shortened links may be public, and analytics and destination URLs are sent to the configured opn.onl API host.

Installation

In SourceWeft

  1. Open Opn Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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.

Source: README.md at commit 1c4baa0

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.2.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts