Dub MCP server
63 operations14 webhooks
Dub (dub.co) short links and partner programs - create, update, upsert and delete links, read click and conversion analytics and raw events, generate SVG QR codes, manage tags, domains, folders and customers, run the Partners program (partners, applications, commissions, payouts, discount codes, bounties, messages), and receive signed webhooks.
Try Dub with your agent
Connect Dub, then paste this into Claude, ChatGPT or Cursor. For ideas from other apps, see the use cases.
Using Corsair, show me what you can do in Dub on my account, then run one read-only example and show me the result.
Dub tools and triggers
Tools are what your agent can do in Dub through Corsair's MCP server. Triggers are the Dub events a routine can start from.
Partners
- AnalyticsRead-only
Retrieve analytics for a partner: retrieve analytics for a partner within a program. The response type vary based on the `groupBy` query parameter.
partners.analytics
- Attribute Referring PartnerDestructive
Attribute a referring partner: attribute a partner to the partner who referred them. Both partners must be approved in your program, and a partner can only be attributed once. When… (can create commissions for past events)
partners.attributeReferringPartner
- BanDestructive
Ban a partner: ban a partner from your program. This will disable all links and mark all commissions as canceled. (bans the partner from the program)
partners.ban
- CreateWrite
Create or update a partner: creates a partner and enrolls them in the program. If that email is already enrolled, the enrollment is returned unchanged, except a different `tenantId`…
partners.create
- Create LinkWrite
Create a link for a partner: create a link for a partner that is enrolled in your program.
partners.createLink
- DeactivateDestructive
Deactivate a partner: this will deactivate the partner from your program and disable all their active links. Their commissions and payouts will remain intact. You can reactivate… (removes the partner and disables their links)
partners.deactivate
- ListRead-only
List all partners: list all partners for a partner program.
partners.list
- List LinksRead-only
Retrieve a partner's links: retrieve a partner's links by their partner ID or tenant ID.
partners.listLinks
- List NetworkRead-only
List all partners in the network: list the partners in the Dub partner network for your program. The partner network must be enabled for the program.
partners.listNetwork
- Update GroupWrite
Update the group of partners: move up to 100 partners enrolled in your program into a group. They get the group's rewards and discount. Partners already in the group are skipped, unless…
partners.updateGroup
- Update TagsWrite
Update the tags of partners: add and remove partner tags on up to 100 partners enrolled in your program. Tags that a partner already has are not added again, and tags a partner does not…
partners.updateTags
- Upsert LinkWrite
Upsert a link for a partner: upsert a link for a partner that is enrolled in your program. If a link with the same URL already exists, return it (or update it if there are any changes).…
partners.upsertLink
Links
- Bulk CreateWrite
Create up to 100 links in one call; the answer carries one row per link, including per-link errors
links.bulkCreate
- Bulk DeleteDestructive
Permanently delete up to 100 links in one call; their analytics are not recoverable
links.bulkDelete
- Bulk UpdateWrite
Apply one set of field changes to up to 100 links named by id or externalId
links.bulkUpdate
- CountRead-only
Count links matching the filters, optionally grouped by domain, tag, folder or user
links.count
- CreateWrite
Create a short link; a duplicate domain and slug answers 409 conflict
links.create
- DeleteDestructive
Permanently delete a short link; recreating it does not restore its analytics
links.delete
- GetRead-only
Retrieve one link by id, externalId, or a domain and slug pair
links.get
- ListRead-only
List short links with filters and cursor paging; the next cursor is the last link id
links.list
- UpdateWrite
Update a short link by id (or externalId prefixed with ext_)
links.update
- UpsertWrite
Create a link, or return and update the existing link with the same destination url; a different key renames that link's slug, so use links.update to change one specific link
links.upsert
Domains
- Check StatusRead-only
Check the availability of one or more domains: check if a domain name is available for purchase. You can check multiple domains at once.
domains.checkStatus
- CreateWrite
Add a domain to the workspace; it still needs DNS verification in the dashboard
domains.create
- DeleteDestructive
Permanently delete a domain; its links stop resolving and analytics are not restored on recreate
domains.delete
- ListRead-only
List the workspace domains with search and page paging
domains.list
- RegisterDestructive
Register a domain: register a domain for the authenticated workspace. Only available for Enterprise Plans. (claims a .link domain for the workspace)
domains.register
- UpdateWrite
Update a domain or rename it with newSlug; redirects and branding are editable here
domains.update
Commissions
- Bulk UpdateDestructive
Bulk update commissions: bulk update up to 100 commissions with the same status. (changes what partners are paid)
commissions.bulkUpdate
- CreateDestructive
Create commission: create one or more commissions (custom, lead or sale) for a partner. Custom commissions accept a negative `amount` to create a clawback. Commission creation… (creates a commission owed to a partner)
commissions.create
- ListRead-only
List all commissions: retrieve a paginated list of commissions for your partner program.
commissions.list
- UpdateDestructive
Update a commission: update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales. (changes what a partner is paid)
commissions.update
Customers
- DeleteDestructive
Permanently delete a customer; past events keep their recorded data
customers.delete
- GetRead-only
Retrieve one customer by their Dub id, or their externalId prefixed with ext_
customers.get
- ListRead-only
List customers with filters and cursor paging; the next cursor is the last customer id
customers.list
- UpdateWrite
Update a customer email, name, avatar or country
customers.update
Folders
- CreateWrite
Create a folder to group links, with an access level
folders.create
- DeleteDestructive
Permanently delete a folder; its links keep existing
folders.delete
- ListRead-only
List folders with search and page paging
folders.list
- UpdateWrite
Rename a folder, change its description or access level
folders.update
Tags
- CreateWrite
Create a tag with an optional color
tags.create
- DeleteDestructive
Permanently delete a tag and remove it from every link
tags.delete
- ListRead-only
List tags with search, sorting and page paging
tags.list
- UpdateWrite
Rename a tag or change its color
tags.update
Bounties
- Approve SubmissionDestructive
Approve a bounty submission: approve a bounty submission. Optionally specify a custom reward amount. (awards the bounty reward)
bounties.approveSubmission
- List SubmissionsRead-only
List bounty submissions: list all submissions for a specific bounty in your partner program.
bounties.listSubmissions
- Reject SubmissionDestructive
Reject a bounty submission: reject a bounty submission with a specified reason and optional note. (notifies the partner)
bounties.rejectSubmission
Discount Codes
- CreateDestructive
Create a discount code: create a discount code for a partner. The partner's group must already have a discount assigned to it, and the discount code must be associated with a link… (creates a live discount code)
discountCodes.create
- DeleteDestructive
Delete a discount code: delete a discount code for a partner by its unique ID or alphanumeric code. This will also disable the code in your connected discount provider (Stripe,… (deletes the code; customers can no longer use it)
discountCodes.delete
- ListRead-only
List discount codes: retrieve a paginated list of discount codes in a program or filtered by partner, discount, or code.
discountCodes.list
Program Applications
- ApproveDestructive
Approve a partner application: approve a pending partner application to your program. The partner will be enrolled in the specified group and notified of the approval. (enrolls the partner and emails them)
programApplications.approve
- ListRead-only
List all program applications: retrieve a paginated list of applications for your partner program. Filter by `status` to list pending, approved, or rejected applications.
programApplications.list
- RejectDestructive
Reject a partner application: reject a pending partner application to your program. The partner will be notified via email that their application was not approved. (emails the partner)
programApplications.reject
Track
- LeadDestructive
Record a lead conversion attributed to a click; there is no delete, so a tracked lead cannot be undone
track.lead
- OpenWrite
Track a deep link open event: this endpoint is used to track when a user opens your app via a Dub-powered deep link (for both iOS and Android).
track.open
- SaleDestructive
Record a sale conversion in cents attributed to a customer; invoiceId deduplicates, but a tracked sale cannot be undone
track.sale
Messages
- CreateDestructive
Send a message to a partner: send a direct message from your partner program to a partner. Until the partner replies, you can only send one message to a partner who isn't enrolled in your… (sends a message to the partner)
messages.create
- ListRead-only
List all messages: retrieve a paginated list of direct messages between your partner program and its partners, newest first.
messages.list
Analytics
- RetrieveRead-only
Read aggregated click, lead and sale analytics, grouped by count, timeseries, country, device, link and more
analytics.retrieve
Embed Tokens
- Create ReferralsWrite
Create a referrals embed token: create a referrals embed token for the given partner/tenant. The endpoint first attempts to locate an existing enrollment using the provided tenantId. If no…
embedTokens.createReferrals
Events
- ListRead-only
List raw click, lead and sale events with filters, newest first
events.list
Payouts
- ListRead-only
List all payouts: retrieve a paginated list of payouts for your partner program.
payouts.list
Qr
- GetRead-only
Generate an SVG QR code for a URL; the document comes back as the svg string
qr.get
Connect Dub to Claude, ChatGPT or Cursor
- 1
Connect Dub in Corsair
Add your Dub API key once in Corsair. Corsair stores the credential encrypted and makes the Dub API calls for your agent, so it never goes into a prompt or a config file. Connect Dub
If your link lets the agent add apps, you can skip this: it gives you a sign-in link the first time it needs Dub. On a ChatGPT personal plan, connect Dub here first.
- 2
Add Corsair's MCP server to your agent
Every client uses the same address:
https://mcp.corsair.dev/mcpOpen Plugins → Add → Add custom connector, name it Corsair, paste the address, select Continue, then Add.Add a custom MCP server with the address and choose OAuth. Personal plans get read tools only.Add to CursorOr add this to~/.cursor/mcp.json. Cursor opens Corsair to sign in the first time it connects.{ "mcpServers": { "corsair": { "url": "https://mcp.corsair.dev/mcp" } } }Run this, then run/mcpin Claude Code to sign in.claude mcp add --transport http corsair https://mcp.corsair.dev/mcpCodex, Gemini CLI, VS Code, Zed and other clients with OAuth sign-in work the same way. Clients without it, such as GitHub Copilot's coding agent, use a link's own address and an API key. Setup for every client
- 3
Sign in and choose what needs your approval
Your client opens Corsair to sign in. Pick a link: the apps your agent can use and a mode that decides what it may do without asking. In the default Cautious mode, Dub's read and write operations run right away and its 22 destructive operations wait for your approval. Strict mode asks before every write and refuses destructive operations, and Read mode allows reads only.
FAQ
Install corsair and @corsair-dev/dub, add the Dub plugin, and connect with an API key. Then call methods like corsair.dub.api.analytics.retrieve() from your app. Corsair verifies webhooks, and keeps each tenant isolated.
Yes. Dub requires an API key from your Dub account or developer dashboard. Create credentials with access that matches what you automate, then paste them into Corsair or connect through managed auth in Hub.
Yes. One Corsair client can hit Dub, GitHub, Notion, Stripe, and the rest. Trigger Dub from a webhook, push updates to Slack, or chain actions across plugins. Same tenant context across integrations, plain TypeScript.
Teams use Corsair for dub (dub.co) short links and partner programs - create, update, upsert and delete links, read click and conversion analytics and raw events, generate SVG QR codes, manage tags, domains, folders and customers, run the Partners program (partners, applications, commissions, payouts, discount codes, bounties, messages), and receive signed webhooks. Common builds include sync jobs, admin tooling, and agents that call Dub APIs from your backend. Webhook handlers react to Dub events and fan out to Slack, email, or other plugins in the same tenant.
The SDK is open source. Self-host and you pay Corsair nothing for the integration layer. Hub bills for hosted auth and execution, not per Dub API call. Hub has a generous free tier. For hobby projects you can probably run the whole thing on free. Paid plans start to matter with more tenants or heavier traffic.
We maintain @corsair-dev/dub in the open repo. When Dub ships API changes, upgrade the package. Your call sites stay typed. You should not need to rewrite the integration layer each time.
No. Corsair does not read your Dub data or hold individual access credentials. Credentials stay in your database. API calls run on your instance. We do not store Dub data on your behalf.
Yes. Add https://mcp.corsair.dev/mcp as a custom connector or MCP server in Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex or any client that supports remote MCP servers with OAuth sign-in, then sign in to Corsair. On ChatGPT personal plans, custom servers currently get read tools only.
Yes. Put Dub on a link in Strict mode and every write waits for your approval, while destructive actions are refused. The default Cautious mode asks only before the 22 destructive Dub operations. You can change a link's mode at hub.corsair.dev/me.