# Dub — how to use (mcp.ai)

Short link management platform with analytics and API for creating, managing, and tracking branded short links

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_dub?ms=1781542020000`
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. `dub_bulk_delete_links`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/dub`
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/dub/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/dub/bulk/delete/links` — Tool to delete multiple short links in bulk from Dub. Use when you need to remove multiple links at once. Maximum of 100 link IDs per request. Non-existing IDs are silently ignored.
  - body: { link_ids: string[] }
- `POST https://api.mcp.ai/api/dub/bulk/update/links` — Tool to update multiple short links in bulk. Use when you need to apply the same updates to multiple links at once by specifying link IDs or external IDs.
  - body: { data: object, linkIds?: string, externalIds?: string }
- `POST https://api.mcp.ai/api/dub/create/domain` — Tool to add a domain to a Dub workspace. Use when you need to create a new domain for shortening links. The domain must be verified before it can be used for link shortening.
  - body: { logo?: string, slug: string, archived?: string, assetLinks?: string, expiredUrl?: string, notFoundUrl?: string, placeholder?: string, appleAppSiteAssociation?: string }
- `POST https://api.mcp.ai/api/dub/create/tag` — Tool to create a new tag in Dub. Use when you need to organize links by creating custom tags. Tags help categorize and filter links for better organization.
  - body: { name: string, color?: string }
- `POST https://api.mcp.ai/api/dub/delete/domain` — Tool to delete a domain from your Dub workspace. Use when you need to permanently remove a domain. The domain must exist and be owned by your workspace.
  - body: { slug: string }
- `POST https://api.mcp.ai/api/dub/delete/tag` — Tool to delete a tag from Dub. Use when you need to remove a tag that is no longer needed.
  - body: { id: string }
- `POST https://api.mcp.ai/api/dub/get/link/info` — Tool to retrieve details of a specific short link from Dub. Use when you need to get comprehensive information about a link including its configuration, targeting settings, and performance metrics.
  - body: { key?: string, domain?: string, link_id?: string, external_id?: string }
- `POST https://api.mcp.ai/api/dub/get/links` — Tool to retrieve a paginated list of links for the authenticated workspace. Use when you need to list links with optional filtering by domain, tags, folder, search terms, or user. Supports pagination 
  - body: { page?: string, sort?: string, tagId?: string, domain?: string, search?: string, sortBy?: string, tagIds?: string, userId?: string, folderId?: string, pageSize?: string, tagNames?: string, tenantId?: string, withTags?: string, sortOrder?: string, showArchived?: string }
- `POST https://api.mcp.ai/api/dub/get/links/count` — Tool to retrieve the count of links in workspace with optional filters. Use when you need to get the total number of links matching specific criteria such as domain, tags, folder, or search terms.
  - body: { tagId?: string, domain?: string, search?: string, tagIds?: string, userId?: string, groupBy?: string, folderId?: string, tagNames?: string, tenantId?: string, withTags?: string, showArchived?: string }
- `POST https://api.mcp.ai/api/dub/get/tags` — Tool to retrieve a list of tags from Dub. Use when you need to fetch all tags or search for specific tags by name or IDs. Supports pagination and sorting by name or creation date.
  - body: { ids?: string, page?: string, search?: string, sort_by?: string, page_size?: string, sort_order?: string }
- `POST https://api.mcp.ai/api/dub/get/workspace` — Tool to retrieve detailed information for a specific workspace. Use when you need to get workspace details including plan, usage limits, domains, users, and configuration settings.
  - body: { id_or_slug: string }
- `POST https://api.mcp.ai/api/dub/list/domains` — Tool to retrieve a list of domains for the authenticated workspace. Use when you need to view all domains, search for specific domains, or filter domains by archived status. Supports pagination for la
  - body: { page?: string, search?: string, archived?: string, page_size?: string }
- `POST https://api.mcp.ai/api/dub/track/open` — Tool to track a deep link open event in Dub. Use when you need to record when a user opens your app via a deep link. Supports both direct tracking via deepLink parameter or probabilistic tracking via 
  - body: { deep_link?: string, dub_domain?: string }
- `POST https://api.mcp.ai/api/dub/update/domain` — Tool to update a domain configuration in Dub. Use when you need to modify domain settings like redirect URLs, placeholder text, archive status, or deep linking configurations.
  - body: { logo?: string, slug: string, archived?: string, new_slug?: string, asset_links?: string, expired_url?: string, placeholder?: string, not_found_url?: string, apple_app_site_association?: string }
- `POST https://api.mcp.ai/api/dub/update/tag` — Tool to update an existing tag by ID. Use when you need to change the name or color of a tag.
  - body: { id: string, name?: string, color?: string }
- `POST https://api.mcp.ai/api/dub/update/workspace` — Tool to update workspace settings in Dub. Use when you need to modify workspace name, slug, logo, or conversion tracking settings.
  - body: { logo?: string, name?: string, slug?: string, id_or_slug: string, conversion_enabled?: string }
- `POST https://api.mcp.ai/api/dub/upsert/link` — Tool to create or update a short link in Dub. Use when you need to create a new short link or update an existing one. If the link already exists (matching domain and key), it will be updated; otherwis
  - body: { geo?: string, ios?: string, key?: string, ref?: string, url: string, image?: string, proxy?: string, tagId?: string, title?: string, video?: string, domain?: string, prefix?: string, tagIds?: string, android?: string, doIndex?: string, rewrite?: string, archived?: string, comments?: string, folderId?: string, password?: string, tagNames?: string, tenantId?: string, utm_term?: string, expiresAt?: string, keyLength?: string, partnerId?: string, programId?: string, expiredUrl?: string, externalId?: string, utm_medium?: string, utm_source?: string, webhookIds?: string, description?: string, publicStats?: string, utm_content?: string, testVariants?: string, utm_campaign?: string, testStartedAt?: string, testCompletedAt?: string, trackConversion?: string }

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