← Blog
MCP2 min read

Shorten a URL from Claude Code CLI: an MCP shortener

You are working in Claude Code, the agent produces a long URL, and you need a short link. Add the KooLink MCP server and Claude Code shortens any URL itself. Free, no API key.

Claude Code is where a lot of "agent work" actually happens now. The agent is in your terminal, it produces URLs — deploy links, file paths, share links, branch URLs — and then there is the recurring chore of turning a long URL into a short one.

A browser tab is the wrong tool for that chore. An MCP server is the right one.

Add KooLink to Claude Code

Claude Code reads MCP config from .mcp.json in the project root, or you can add it globally. The block looks like this:

{
  "mcpServers": {
    "koolink": {
      "url": "https://mcp.kool.ink",
      "type": "streamable-http"
    }
  }
}

Restart the Claude Code session. KooLink is loaded. The agent now has a shorten_url tool in its tool list.

There is no API key to mint, no account to create, no subscription tier to confirm. The server is free and unlimited.

What the workflow looks like

You are in a Claude Code session, doing real work. The agent produces or references a long URL. You want a short one. You ask in the same context where you are already working:

Give me a short link for that. Generate a clean slug for the README badge and the commit message. Shorten the deploy URL so I can paste it in Slack.

The agent calls shorten_url and hands you back a kool.ink/xyz link. You do not switch tools. You do not break your flow.

Why this is the right tool for the job

Three things make an MCP server the right answer for "I need a short link" inside an agent.

Latency. A shorten_url tool call is one network round-trip, less than a second. A browser tab plus copy-paste is four round-trips and a context break.

Reliability. The same shorten_url tool gives the same kool.ink/xyz shape every time. You can write scripts that rely on the slug format.

No state to manage. No API key to rotate, no environment variable to set per project. The server is the auth.

Where else it works

The same server URL works in every MCP-native client:

  • Cursor, Windsurf, Zed — IDE agents
  • Claude Desktop — desktop agent
  • VS Code with Continue — extension
  • Any other MCP client that supports streamable-http transport

And in your shell, without any agent, the same service is a one-liner:

npx @koolink/koolink https://example.com/very/long/path
# → https://kool.ink/xyz

The piece of the agent ecosystem nobody else has

Most shorteners still ship REST APIs and tell you to bring your own API key. KooLink is the only widely-used shortener that ships a hosted MCP server. That is the entire reason this post exists.

Add the MCP server → · Or grab the CLI →