opn-mcp
This server lets AI assistants manage and analyze short links on the opn.onl URL shortener platform through natural language.
Shorten URLs: Create short links with optional custom alias/slug, title, password protection, and expiry timestamp.
List Links: Retrieve your short links (most recent first) with pagination (limit/offset) and text search filtering across URL, title, notes, or code.
Get Link Analytics: View detailed click statistics for any link, including geography, device types, browsers, and referrers.
Update Links: Modify an existing link's destination URL, title, password, or expiry date.
Delete Links: Permanently remove a short link by its ID.
Generate QR Codes: Produce QR code images (PNG or SVG) with optional branding — custom hex foreground color and centre logo overlay.
Check URL Health: Verify that a destination URL is reachable (returns status and response time) before shortening it.
opn-mcp
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
argsfor 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"
}
}
}
}Related MCP server: ShortURLMCP
Configuration
Env var | Required | Default | Description |
| ✅ | — | Your API key ( |
| — |
| API base URL — set this for a self-hosted instance |
Tools
Links
Tool | Description |
| Create a short link — optional alias, title, notes, scheduling ( |
| Shorten many URLs at once, optionally into a folder |
| List your links (limit, offset, search, folder or tag filter) |
| Update destination, title, notes, scheduling, click limit, folder or protections; clear fields with |
| Delete a link |
| Duplicate a link under a fresh short code |
| Pin or unpin a link |
| Check whether a custom alias is free before using it |
Analytics
Tool | Description |
| Per-link analytics (clicks, unique visitors, geo, cities, devices, browsers, OS, referrers); optional |
| Account-wide analytics across all your links |
QR & URL helpers
Tool | Description |
| Get a link's QR image — optional brand colour, centre logo, PNG/SVG |
| Check a destination URL is reachable before shortening |
| Append UTM campaign parameters to a URL |
| Fetch Open Graph metadata (title, description, image) for a URL |
Tags & folders
Tool | Description |
| List or create tags |
| Attach or detach tags on a link |
| List or create folders |
| Move 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.
Bump the version in three places and keep them identical:
package.json,server.json(top-level and thepackages[0].version), andSERVER_VERSIONinsrc/server.ts.Land it: commit to
mainand push. CI (.github/workflows/ci.yml) runsbuild+test— it does not publish.Publish to npm (as npm user
ysalitrynskyi):npm login npm publish # prepublishOnly runs the buildPublish 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.
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ysalitrynskyi/opn-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server