# How to Create and Track Short Links From Claude or ChatGPT

Source: https://lots.link/blog/create-track-short-links-claude-chatgpt
Published: 2026-10-17T03:30:24.466757+00:00

To create and track short links from Claude or ChatGPT, connect a URL shortener's MCP server to your assistant, then ask in plain words. With LotsLink you add `https://api.lots.link/mcp`, sign in with your Lots account, and your agent can create links with UTM tags, make QR codes and read click analytics. Links, clicks and QR codes are free and unlimited.

I ran the whole thing on 16 October 2026 from Claude, through the LotsLink MCP server: listed my workspaces, created a tagged link, made its QR code, read the analytics and export, then switched the test link off. Below are the prompts I used, the real tool output (trimmed), and the setup for Claude, ChatGPT, Claude Code, Codex and Cursor.

## What you need

- A LotsLink account. Short links, clicks, QR codes, analytics, workspaces and team members are free and unlimited. New accounts get 4,000 free credits, valid 90 days, no card. You only pay for your own custom domain ([pricing](https://lots.link/pricing)).
- An AI client that supports remote MCP: Claude (web, desktop), ChatGPT on a plan that allows custom MCP servers, Claude Code, Codex, Cursor or similar.
- The MCP server URL: `https://api.lots.link/mcp`. It signs in with OAuth, so there's no API key to paste.

## Step 1: Connect LotsLink to your AI agent

Every client below uses the same server URL. Only the menus differ. Setup for each one is also on [lots.link/mcp](https://lots.link/mcp).

### Claude (claude.ai and the desktop app)

1. Open **Customize**, then **Connectors**.
2. Click **+ Add**, then **Add custom connector**.
3. Name it LotsLink, paste `https://api.lots.link/mcp` and click **Continue**, keeping the sign-in settings Claude detects.
4. Click **Connect** and sign in with your Lots account.
5. In a chat, turn LotsLink on from the **+** menu under **Connectors**.

Custom connectors work on Claude Free, Pro, Max, Team and Enterprise. Free is limited to one custom connector. On Team and Enterprise, an owner adds the connector once under **Organization settings > Connectors** (Add, Custom, Web), and members then connect it from **Customize > Connectors**. (Claude Help Center, checked on 16 October 2026.)

### ChatGPT (web)

OpenAI changed this flow: you no longer need to turn on developer mode first. In the current Plugins experience:

1. Go to **Plugins**, select **+**, then **Add custom MCP server**.
2. Name it LotsLink and enter `https://api.lots.link/mcp` under **Connection**.
3. Choose OAuth for authentication.
4. Tick **I understand and want to continue**, then **Create as a plugin** and review the tools it found.
5. Install the plugin, start a new chat, type **@** and select LotsLink.

Plan matters here. OpenAI's help page lists custom MCP connections with full read and write support for ChatGPT Business, Enterprise and Edu, on the web only (not mobile). On Business, only admins and owners can create them. Pro users can connect custom MCP servers with read/fetch permissions only, which is enough to read analytics but not to create links. (OpenAI Help Center, "Connecting custom MCP servers in ChatGPT", checked on 16 October 2026.) If your ChatGPT plan can't write through MCP, use Codex below with the same server.

### Claude Code

```bash
claude mcp add --transport http lots-link https://api.lots.link/mcp
```

Start Claude Code, run `/mcp`, select **lots-link**, choose **Authenticate** and allow access in the browser.

### Codex CLI

```bash
codex mcp add lots-link --url https://api.lots.link/mcp
codex mcp login lots-link
codex mcp list
```

The login command opens the browser to sign in; `codex mcp list` confirms it's connected.

### Cursor

Add this to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):

```json
{
  "mcpServers": {
    "lots-link": {
      "url": "https://api.lots.link/mcp"
    }
  }
}
```

Cursor asks you to sign in with your Lots account the first time it connects.

### Cloud agents without MCP

Create an API key at [lotstech.com/mcp/lots-link](https://www.lotstech.com/mcp/lots-link), give the agent the REST docs (`https://api.lots.link/docs.md`) and the agent skill ([lots.link/skill.md](https://lots.link/skill.md)), and it calls the same tools over REST with `Authorization: Bearer <key>`.

## Step 2: Let the agent find your workspace

Every LotsLink tool works inside a workspace, so the agent starts there. My prompt:

> List my LotsLink workspaces and projects.

The agent called `lotslink_list_workspaces`, then `lotslink_list_projects`. Trimmed output:

```json
{
  "success": true,
  "workspaces": [
    { "name": "LotsTech", "type": "team", "role": "owner", "member_count": 1 },
    { "name": "Personal", "type": "personal", "role": "owner", "member_count": 1 }
  ],
  "total": 2
}
```

```json
{
  "success": true,
  "projects": [ { "name": "Website", "is_archived": false, "link_count": 1 } ],
  "total": 1
}
```

If you have one workspace, you never have to name it. If you have several, say which one in your prompt ("in my LotsTech workspace").

## Step 3: Create a short link with UTM tags

> In my LotsTech workspace, create a short link to https://lots.link/blog with the slug mcp-guide-test, utm_source blog-lotslink, utm_medium blog and utm_campaign mcp-guide-test.

The first call came back refused, and the reason is worth knowing:

```json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Cannot shorten a link to the same short-link domain."
  }
}
```

LotsLink won't shorten a lots.link URL into another lots.link URL. That blocks redirect loops and chains. I pointed the link at the LotsLink setup page on lotstech.com instead, and `lotslink_create_link` returned:

```json
{
  "success": true,
  "short_url": "https://lots.link/mcp-guide-test",
  "link": {
    "final_slug": "mcp-guide-test",
    "original_url": "https://www.lotstech.com/mcp/lots-link?utm_source=blog-lotslink&utm_medium=blog&utm_campaign=mcp-guide-test",
    "utm_source": "blog-lotslink",
    "utm_medium": "blog",
    "utm_campaign": "mcp-guide-test",
    "qr_code_url": null,
    "click_count": 0,
    "is_active": true
  },
  "message": "Link created successfully"
}
```

Two things to notice. LotsLink appended the UTM tags to the destination for me, so Google Analytics on the landing page sees the source, medium and campaign of every visit. And the slug I asked for is the slug I got: custom slugs are 7 to 40 characters and must be unique on that domain. Changing a slug later changes the public URL, so pick it before you share or print anything.

## Step 4: Make a QR code for the link

> Make a 512 pixel QR code for the mcp-guide-test link.

`lotslink_create_qr_code` returned:

```json
{
  "success": true,
  "short_url": "https://lots.link/mcp-guide-test",
  "qr_code_url": "https://media.lots.link/qr-codes/.../qr-....png",
  "format": "png",
  "size": 512,
  "foreground_color": "#000000",
  "background_color": "#FFFFFF",
  "message": "QR code for https://lots.link/mcp-guide-test. Scans open the short link, so they show up as visits in its analytics."
}
```

The PNG encodes the short URL, not the destination, so every scan passes through LotsLink and lands in the same analytics as a click. Sizes run from 150 to 1024 pixels, and you can set hex colors for the code and background (keep strong contrast). A fresh `lotslink_get_link` now showed the `qr_code_url` saved on the link. More on counting scans in [how to track QR code scans](https://lots.link/blog/track-qr-code-scans).

## Step 5: Read the click analytics

> How many clicks did mcp-guide-test get in the last 7 days, and from where?

I asked minutes after creating the link and before sharing it anywhere, so the honest answer is zero. `lotslink_get_link_analytics` returned the full shape with nothing in it:

```json
{
  "success": true,
  "analytics": {
    "link": { "slug": "mcp-guide-test" },
    "metrics": { "totalClicks": 0, "clicksInPeriod": 0, "avgClicksPerDay": 0, "peakDay": null },
    "geography": { "countries": [], "cities": [] },
    "devices": { "desktop": 0, "mobile": 0, "tablet": 0, "unknown": 0 },
    "referrers": { "top": [] },
    "timeline": []
  }
}
```

On a link people have clicked, the same call fills in the daily timeline, top countries and cities, device split and top referrers. Location is approximate and only there when available. Known bots, link previews, prefetches and HEAD requests aren't counted, and because LotsLink stores no visitor IP address, there is no unique-visitor count: one person clicking twice counts twice.

For the whole workspace, `lotslink_get_workspace_analytics` returns clicks in the period, clicks today, link counts, average clicks per link and your top link. Mine showed `"clicksInPeriod": 0` for the 7 days too.

> Export the click data for mcp-guide-test as CSV.

`lotslink_export_analytics`:

```json
{
  "success": true,
  "format": "csv",
  "data": "id,link_id,created_at,ip_address,device_type,country,city,referrer",
  "records": 0
}
```

An empty file with the column headers. The `ip_address` column stays empty on every row, since IPs aren't stored. For one click at a time, `lotslink_get_click_details` lists each record with time, approximate location, device and referrer, with filters by date, country and device.

## Step 6: Switch the test link off

> Deactivate the mcp-guide-test link. Don't delete it.

`lotslink_bulk_deactivate_links` returned `"Successfully deactivated 1 links"`, and `lotslink_list_links` showed `"is_active": false` with the link and its QR code still in the workspace. Opening `https://lots.link/mcp-guide-test` right after returned HTTP 410 Gone. Turning it back on is one call (`lotslink_bulk_activate_links`, or `lotslink_update_link` with `is_active: true`). Deleting is permanent and removes the click history and QR code, so I deactivate test links instead.

## Prompts to copy

- "Shorten https://example.com/spring-sale as spring-sale with utm_source newsletter, utm_medium email and utm_campaign spring-sale."
- "Create one short link per channel for https://example.com/launch: newsletter, linkedin, x and podcast. Use the channel as utm_source and launch as utm_campaign, and put them in a project called Launch."
- "Make a 1024 pixel QR code for the spring-sale link, black on white, so I can print it on the flyer."
- "Which of my links got the most clicks in the last 30 days, and from which countries and referrers?"
- "Compare clicks by device for the four launch links over the last 14 days."
- "Export last month's clicks for the Launch project as CSV."
- "Make the spring-sale link expire on 30 November at 23:59 UTC."
- "Deactivate every link in the Launch project. Don't delete anything."

## What the agent can and can't do

The LotsLink MCP server has 34 tools ([full list](https://api.lots.link/tools.json)). The same tools power the REST API, and every change shows up in your dashboard.

| Your agent can | Tools |
|---|---|
| Create links on lots.link, your free `*.lots.link` subdomain or your verified domain, with custom slug, UTM fields, expiry and project | `lotslink_create_link` |
| Change a link's slug, expiry, active status or project | `lotslink_update_link` |
| Switch many links on or off, or delete them | `lotslink_bulk_activate_links`, `lotslink_bulk_deactivate_links`, `lotslink_bulk_delete_links`, `lotslink_delete_link` |
| Make QR codes (PNG, 150 to 1024 px, your colors) | `lotslink_create_qr_code` |
| Read analytics per link or workspace, single clicks, and export CSV or JSON | `lotslink_get_link_analytics`, `lotslink_get_workspace_analytics`, `lotslink_get_click_details`, `lotslink_export_analytics` |
| Add, verify and manage custom domains and your `*.lots.link` subdomain | `lotslink_add_custom_domain`, `lotslink_verify_custom_domain` and more |
| Manage workspaces, projects and team members | `lotslink_create_workspace`, `lotslink_create_project`, `lotslink_invite_workspace_member` and more |
| Show billing and make a checkout link for you to pay in your browser | `lotslink_get_billing`, `lotslink_create_checkout` |

What it can't do:

- **Change a link's destination.** `lotslink_update_link` edits slug, expiry, status and project, not the target URL. For a new destination, create a new link.
- **Count unique visitors.** Analytics are recorded visits, not people.
- **Shorten a lots.link URL** into another lots.link URL (the error above).
- **Remove a domain that links still use.** Reassign or delete those links first.
- **Pay for you.** It hands you a checkout link; card details never go in the chat.
- **Go past your role.** The agent acts as you, with your role in each workspace.

## Roles: what your agent may do in a shared workspace

| Role | What the agent can do as this person |
|---|---|
| Owner | Everything, including deleting the workspace |
| Admin | Manage links, domains, projects and members; bulk actions |
| Member | Create links, and edit, delete and make QR codes for their own links |
| Viewer | Read links and analytics only |

That makes it safe to give a teammate's agent access: a member's agent can't touch other people's links, and a viewer's agent can only read.

## What about Bitly, Dub and Short.io?

They have MCP servers too, each opened on their own pages on 16 October 2026:

- **Bitly**'s server is at `https://api-ssl.bitly.com/v4/mcp`, signs in with OAuth 2.1 or an API token, and documents setup for ChatGPT, Claude, Claude Desktop, Claude Code, Cursor, VS Code and Windsurf. No extra subscription is needed and your plan settings carry over, so Bitly Free's 5 links and 2 QR codes a month apply to what the agent makes too. See [LotsLink vs Bitly](https://lots.link/blog/lotslink-vs-bitly).
- **Dub** documents a remote MCP server that signs in through the browser with OAuth, or with a Dub API key in a header for headless agents, and installs as a ChatGPT plugin.
- **Short.io**'s help article connects its MCP server with your Short.io API key through `mcp-remote`, and says its current implementation can't edit or delete an existing short link.

Free limits, plan gates and tool lists for seven shorteners are in [the best URL shorteners with MCP support](https://lots.link/blog/best-url-shorteners-with-mcp-support). Where LotsLink fits: you want unlimited free links, QR codes and click analytics that your agent can create and read, signed in with OAuth, and you pay only for your own domain.

## FAQ

### Can ChatGPT create short links?

Yes, once you connect a URL shortener's MCP server. In ChatGPT go to Plugins, select +, then Add custom MCP server, and enter https://api.lots.link/mcp with OAuth. OpenAI lists full read and write MCP for Business, Enterprise and Edu on the web; Pro can connect with read/fetch only.

### How do I connect LotsLink to Claude?

In Claude, open Customize, then Connectors, click + Add, then Add custom connector, and paste https://api.lots.link/mcp. Click Connect, sign in with your Lots account, and turn LotsLink on from the + menu in a chat. In Claude Code, run claude mcp add --transport http lots-link https://api.lots.link/mcp.

### Is there a free URL shortener with an MCP server?

Yes. LotsLink includes its MCP server and REST API on every account, with unlimited links, clicks, QR codes and analytics for free. You pay only for your own custom domain, $4 a month on pay as you go or $9 a month for three.

### Can my AI agent make QR codes?

Yes. The agent calls lotslink_create_qr_code and gets a PNG of the short URL, 150 to 1024 pixels, in the colors you ask for. Scans open the short link, so they show up in that link's click analytics.

### Can the agent tell me how many people clicked my link?

It tells you how many recorded clicks a link got, with country, city, device and referrer when available, plus individual click records and CSV or JSON export. LotsLink stores no visitor IP addresses, so there's no unique-visitor count, and bots and link previews aren't counted.

### Can I change where a short link goes after sharing it?

Not through LotsLink today. The agent can change a link's slug, expiry, status or project, but not its destination. For a new destination, create a new link and deactivate the old one.
