add_tags_to_link
Attach one or more existing tags to a link.
Shorten links, read their click analytics, generate QR codes and organise them into folders and tags — hosted or self-hosted.
LABSCO SUMMARY
The two tools that make it worth an agent's attention are set_link_routing_rules, which targets by device, OS, country or language with A/B weights, and preview_url_metadata, which lets a link be auto-titled from the page it points at. Because OPN_BASE_URL is a plain switch, the same conversation works against your own deployment.
An MCP server for opn.onl, an open-source URL shortener. It covers the full link lifecycle in natural language — create, schedule, protect, route and retire links — plus per-link and account-wide analytics, and it works against the hosted service or your own instance.
An opn.onl API key, created under Settings > API Keys and shown once; set it as OPN_API_KEY. Clients run npx -y opn-mcp over stdio and it talks to the hosted API by default. Point OPN_BASE_URL at your own instance's API host to use a self-hosted opn.onl.
One command plus a key — npx -y opn-mcp, then supply credentials
USE CASES
Build the UTM-tagged URL, check the alias is free, then shorten it into the campaign folder with tags.
Create them all in one call into a new folder, then confirm what failed.
Read the clicks, unique visitors and country breakdown for the window you care about.
Set routing rules by device, OS or country, and check what is already configured first.
Generate a branded SVG QR code after confirming the destination is reachable.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
add_tags_to_linkAttach one or more existing tags to a link.
build_utm_urlAppend UTM campaign parameters to a URL. Returns the tagged URL (does not create a link).
check_alias_availableCheck whether a custom alias/slug is available before shortening with it.
check_url_healthCheck whether a destination URL is reachable (status + timing) before shortening it.
clone_linkDuplicate an existing link (same destination and settings) under a fresh short code.
create_folderCreate a folder for grouping links.
create_tagCreate a tag for organizing links.
delete_linkDelete a short link.
export_links_csvExport all your links as CSV (returns the raw CSV text).
get_dashboard_statsGet account-wide analytics across all your links: totals, top links, and aggregate click breakdowns.
get_link_routing_rulesGet the smart-routing rules for a link (device/OS/country/language targeting and A/B weighting).
get_link_statsGet click analytics for a link (clicks, unique visitors, geography, cities, devices, browsers, OS, referrers).
get_qr_codeGet the QR code for a link, optionally branded with a colour, centre logo, and PNG/SVG format.
list_foldersList your folders (each with its link count).
list_linksList your short links (most recent first). Filter by folder, tag or free-text search.
list_tagsList your tags (each with its link count).
move_links_to_folderMove one or more links into a folder.
preview_url_metadataFetch Open Graph metadata (title, description, image, site name) for a URL — handy for auto-titling a link before shortening it.
remove_tags_from_linkDetach one or more tags from a link.
set_link_routing_rulesReplace ALL smart-routing rules for a link. Each rule sends visitors matching the given device/OS/country/language to its destination; empty match fields mean 'any'. Send an empty array to clear all rules.
shorten_urlCreate a short link on opn.onl. Supports scheduling, click limits, folders, tags and one-time (burn-after-reading) links. Returns the short URL and its code.
shorten_urls_bulkShorten many URLs in one call. Returns the created links plus any per-URL errors.
toggle_link_pinPin or unpin a link (pinned links surface first in the dashboard). Toggles the current state.
update_linkUpdate a link's destination, title, notes, scheduling, click limit, folder or protections. Use the remove_* flags to clear a field.
BEFORE YOU INSTALL
24 tools when we connected. get_link_routing_rules, set_link_routing_rules and export_links_csv are undocumented. About half the tools write, including delete_link and move_links_to_folder.
All 3 documented setups run the server on your machine.
CONTEXT COST
Rated by the size of the 24 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y opn-mcp{
"mcpServers": {
"opn": {
"command": "npx",
"args": [
"-y",
"opn-mcp"
],
"env": {
"OPN_API_KEY": "<YOUR_OPN_API_KEY>"
}
}
}
}<YOUR_OPN_API_KEY> is your API key: on opn.onl, open Settings → API Keys and create one (it starts with opn_ and is shown once).
{
"mcpServers": {
"opn": {
"command": "npx",
"args": [
"-y",
"opn-mcp"
],
"env": {
"OPN_API_KEY": "<YOUR_OPN_API_KEY>",
"OPN_BASE_URL": "<YOUR_OPN_BASE_URL>"
}
}
}
}For your own opn.onl instance: OPN_BASE_URL is that instance's API host, and <YOUR_OPN_API_KEY> a key created under its Settings → API Keys. Leave OPN_BASE_URL out to use the hosted service at https://l.opn.onl.
{
"mcpServers": {
"opn": {
"command": "npx",
"args": [
"-y",
"github:ysalitrynskyi/opn-mcp"
],
"env": {
"OPN_API_KEY": "<YOUR_OPN_API_KEY>"
}
}
}
}This form installs straight from the GitHub repository, which builds on install.