ADVANCED

Docs

Kilo from your AI assistant (MCP)

Kilo speaks MCP - the Model Context Protocol, the standard AI assistants use to work with outside tools. Connect Claude, Cursor, or any MCP client to the Kilo Routes server and your assistant can mint short links, design QR codes, and read your analytics in plain conversation, under the same rules the dashboard enforces.

One server, your whole workspace

MCP is to AI assistants what a REST API is to programs: a standard way in. Kilo’s MCP server lives at the same origin as the API - one hosted server, run by Kilo, nothing to install - and exposes a small set of tools an assistant can call on your behalf once you hand it an API key.

The practical effect: “make a QR code for the menu, and tell me next week how it did” becomes a complete workflow you can run from a chat window. The assistant creates the link, saves the QR styling, and reads the numbers back; the finished artwork is one click away in the dashboard.

  • Create - short links and the QR codes that ride on them (“shorten this”, “make a QR for the spring flyer”).
  • Design - save a link’s QR styling: colors, module shapes, gradients, a logo; animated designs on plans with animated export.
  • Measure - totals, timeseries, countries, devices, referrers, and click quality (likely-human vs datacenter vs VPN).
  • Browse - list links and campaigns, inspect one link, check the account and plan with whoami.

Connect a client

The server speaks JSON-RPC 2.0 over Streamable HTTP at a single endpoint on the Kilo QR origin, under /api/mcp. Most clients take a small JSON block - this is the shape (the key comes from the next section):

MCP client config (JSON)
{
  "mcpServers": {
    "kilo-routes": {
      "type": "http",
      "url": "https://qr2r.com/api/mcp",
      "headers": { "Authorization": "Bearer $KILO_API_KEY" }
    }
  }
}

In Claude Desktop and Cursor that block goes in the MCP settings file; other clients name the fields slightly differently, but it always comes down to the URL plus the Authorization header. Claude Code wires it up in one line:

Claude Code (one command)
claude mcp add --transport http kilo-routes https://qr2r.com/api/mcp \
  --header "Authorization: Bearer $KILO_API_KEY"

A stable hostname is coming

The endpoint shares the origin your links resolve on because that Worker is the platform. A dedicated api.kiloroutes.com hostname binds at the launch window; until then, point clients at the origin above. The protocol and the tools do not change when the hostname does.

Keys, scopes, and the plan gate

Authentication is the same bearer API key as the REST API: mint one in the dashboard under API keys. Give the assistant a read key if it only reports numbers, or a read + write key if it should create links and designs. Key management itself stays interactive-only - no key, and no MCP tool, can mint or revoke other keys.

MCP access is included from the Pro plan up. Ask below that and the server answers with a structured error carrying the exact upgrade and pricing URLs - so an assistant relaying the failure hands you a working next step instead of a dead end:

Plan-gate error (JSON-RPC)
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32003,
    "message": "MCP access is included from the Pro plan up (current plan: Free). …",
    "data": {
      "feature": "mcp_access",
      "upgrade_url": "…/billing",
      "pricing_url": "…/#pricing"
    }
  }
}

Admin-configurable, like every limit

Which plans include MCP is a flag in the live plan catalogue, not a constant in the code - the same way every other Kilo limit works. If the lineup changes, the gate follows without a deploy.

What to ask for

The tools are deliberately phrased around the sentences people actually say. A few that work as-is:

  • “Shorten https://example.com/spring-catalog and call it Spring catalog.”
  • “Make a QR code for our cafe menu and style it dark green with rounded dots.”
  • “How many scans did the flyer get in the last 30 days, and from which countries?”
  • “Which of our active links got the most likely-human clicks this week?”

Under the hood those map to a handful of tools - create_link, save_link_qr_design, get_link_analytics, list_links - plus a whoami the assistant calls when it needs to check your plan or diagnose a permissions error. The server also publishes a getting-started resource any client can read back to you.

Safe by design

The tool set is read + create only, on purpose. An assistant holding your key can add things and read things; it cannot destroy or redirect anything that already exists.

  • No delete, no disable, no pause - no tool removes a link.
  • No destination edits - a printed QR can’t be silently re-pointed from a chat.
  • Every create runs the same validation, plan caps, and destination safety scanning as the dashboard - MCP is not a side door.
  • A read-only key cannot call a create tool, and nothing over MCP touches members, billing, or other keys.

Everything an assistant can do over MCP you can also do over plain HTTP - the API guides cover the same ground one endpoint at a time.

Create your API key
NextThe APIAuthenticate with a key; understand scopes, errors, and rate limits - the API the dashboard itself uses.Read the guide