# Bitly — how to use (mcp.ai)

Connect your Bitly account and use 10 tools for URL shortener straight from your AI agent. Connect with your own API key. Bitly is a link management platform for shortening, customizing, sharing, and measuring links and QR codes.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_bitly?ms=1787295720000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `bitly_delete_bitlink`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/bitly`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/bitly/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/bitly/delete/bitlink` — Permanently delete an eligible unedited hash Bitlink.
  - body: { bitlink: string }
- `POST https://api.mcp.ai/api/bitly/expand/link` — Resolve a Bitlink to its current destination and destination history, when available.
  - body: { bitlink: string }
- `POST https://api.mcp.ai/api/bitly/get/account/context` — Return the authenticated Bitly user together with accessible groups and organizations needed by other tools.
  - body: { organization_guid?: string }
- `POST https://api.mcp.ai/api/bitly/get/bitlink` — Retrieve full Bitlink metadata, including destination, title, tags, archive or deletion state, and associated QR code IDs.
  - body: { bitlink: string }
- `POST https://api.mcp.ai/api/bitly/get/bitlink/activity` — Return paid-plan click or engagement analytics for a Bitlink as a timeline or summary. Requires Bitlink analytics entitlement.
  - body: { unit?: string, view?: string, units?: integer, metric?: string, bitlink: string, unit_reference?: string }
- `POST https://api.mcp.ai/api/bitly/get/bitlink/traffic/sources` — Break down paid-plan Bitlink click analytics by country, city, device, referrer, or referring domain. Requires Bitlink analytics entitlement.
  - body: { size?: integer, unit?: string, units?: integer, bitlink: string, dimension: string, unit_reference?: string }
- `POST https://api.mcp.ai/api/bitly/get/usage/and/limits` — Inspect monthly plan quotas, hourly endpoint budgets, and optional group feature usage before performing quota-consuming work.
  - body: { group_guid?: string, endpoint_path?: string, feature_names?: string[], organization_guid: string }
- `POST https://api.mcp.ai/api/bitly/list/bitlinks` — List or search Bitlinks owned by a group, one cursor-controlled page at a time.
  - body: { size?: integer, tags?: string[], query?: string, archived?: string, group_guid?: string, next_cursor?: string, created_after?: integer, created_before?: integer, hostname_path_query?: string }
- `POST https://api.mcp.ai/api/bitly/shorten/link` — Create an ordinary Bitly short link for a long URL in a specific group.
  - body: { domain?: string, long_url: string, group_guid: string, force_new_link?: boolean }
- `POST https://api.mcp.ai/api/bitly/update/bitlink` — Update safe metadata or archive state for a Bitlink; this tool does not redirect destinations or configure advanced routing.
  - body: { tags?: string[], title?: string, bitlink: string, archived?: boolean }

## Example prompts
- "What can I do in Bitly?"
- "Show me a summary of my Bitly account"

## More
- Page: https://mcp.ai/bitly
- Agent spec (llms.txt): https://mcp.ai/bitly/llms.txt
- Postman collection: https://mcp.ai/bitly/postman.json
