mcpField
O
opn-mcp

opn-mcp

Local
github.com/ysalitrynskyiBusiness & Marketing2Updated 15w ago

About opn-mcp

opn-mcp gives MCP clients access to opn.onl link management for users handling links and analytics through natural language. It can connect to the hosted service or a self-hosted instance.

Key features

  1. 01Create single or bulk short links
  2. 02Edit, clone, and delete links
  3. 03View link and account analytics
  4. 04Generate branded QR codes
  5. 05Manage tags, folders, and UTM parameters

Use cases

  1. 01Shorten campaign URLs in bulk
  2. 02Review link clicks by source and device
  3. 03Create QR codes for a branded campaign

MCP support

The MCP server exposes opn.onl tools for link management, analytics, QR codes, and URL helpers. It connects to the hosted API or a configured self-hosted instance using an API key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"ysalitrynskyi-opn": {
"command": "npx",
"args": [
"-y",
"opn-mcp"
],
"env": {
"OPN_API_KEY": "<OPN_API_KEY>",
"OPN_BASE_URL": "<OPN_BASE_URL>"
}
}
}
}
Run commandnpx -y opn-mcp
Environment variables to set
OPN_API_KEYSecretYour opn.onl API key (create one under Settings → API Keys).
OPN_BASE_URLAPI base URL. Set this to your own instance's API for a self-hosted opn.onl.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmopn-mcp1.2.0

Tools

24

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
urlstringYesThe destination URL to shorten
aliasstringNoCustom alias / slug (optional). Use check_alias_available first to avoid collisions.
notesstringNoPrivate notes for the link (optional)
titlestringNoPrivate title for the link (optional)
tag_idsarrayNoTag ids to attach to the link (optional)
passwordstringNoPassword-protect the link (optional)
folder_idintegerNoPlace the link in this folder id (optional)
starts_atstringNoISO-8601 timestamp before which the link is inactive (optional)
expires_atstringNoISO-8601 timestamp after which the link stops working (optional)
max_clicksintegerNoDeactivate the link after this many clicks (optional)
burn_after_readingbooleanNoOne-time link: destroy it after the first successful visit (optional)
safe_link_interstitialbooleanNoShow a safety interstitial page before redirecting (optional)

Details

From the project 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):

{
  "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:

{
  "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

npm install
npm run build      # tsc → dist/
npm test           # vitest
OPN_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):
    npm login
    npm publish        # prepublishOnly runs the build
    
  4. Publish to the MCP registry (as GitHub user ysalitrynskyi):
    mcp-publisher validate      # optional, offline check
    mcp-publisher login github  # interactive browser OAuth
    mcp-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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.