diff --git a/docs.json b/docs.json index 0d9e35b5..f83c50ea 100644 --- a/docs.json +++ b/docs.json @@ -116,6 +116,13 @@ "group": "INTEGRATIONS", "pages": ["docs/integrations", "docs/integrations/quickstart"] }, + { + "group": "MCP SERVERS", + "pages": [ + "docs/sdks/mcp/dub-links", + "docs/sdks/mcp/dub-partners" + ] + }, { "group": "OPEN SOURCE", "pages": ["docs/local-development", "docs/self-hosting"] diff --git a/docs/sdks/mcp/dub-links.mdx b/docs/sdks/mcp/dub-links.mdx new file mode 100644 index 00000000..bc1a8f28 --- /dev/null +++ b/docs/sdks/mcp/dub-links.mdx @@ -0,0 +1,217 @@ +--- +title: "Dub Links MCP Server" +description: "Use the Dub Links MCP server to manage links, analytics, domains, and more with any MCP-compatible AI client." +"og:title": "Dub Links MCP Server" +--- + +The Dub Links [MCP server](https://mcp.dub.sh/mcp/dub-links) gives your AI agent native access to the full Dub Links platform through a single integration. You can manage links, track conversions, and retrieve analytics using natural language. + +## What can the Dub Links MCP server do? + +- **Links** — Create, upsert, bulk-create, retrieve, list, update, bulk-update, delete, bulk-delete, and count links +- **Analytics** — Retrieve analytics and list events for any link, domain, or workspace +- **QR codes** — Retrieve a QR code for any link +- **Customers** — List, retrieve, update, and delete customers +- **Tracking** — Track lead, sale, and deep link open events +- **Domains** — Create, list, update, and delete custom domains +- **Tags** — Create, list, update, and delete tags +- **Folders** — Create, list, update, and delete folders + +## Prerequisites + +You'll need a Dub API key to authenticate with the MCP server. You can create one in your [Dub workspace settings](https://app.dub.co/settings/tokens). + +## Setup + +Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actual Dub API key. + + + + Open **Cursor Settings** → **MCP** → **Add new global MCP server** and paste the following: + + ```json + { + "mcpServers": { + "dub-links": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-links", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + Open **Claude Desktop** settings → **Developer** tab → **Edit Config** and add the following: + + ```json + { + "mcpServers": { + "dub-links": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-links", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + ```bash + claude mcp add dub-links \ + --env MCP_DUB_TOKEN=dub_xxxxxx \ + -- npx -y mcp-remote@0.1.25 https://mcp.dub.sh/mcp/dub-links \ + --header "Mcp-Dub-Token:\${MCP_DUB_TOKEN}" + ``` + + + Add the following to your `settings.json`: + + ```json + { + "mcp": { + "servers": { + "dub-links": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-links", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + } + ``` + + + ```json + { + "mcpServers": { + "dub-links": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-links", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + For any MCP client not listed above, use the raw configuration below: + + ```json + { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-links", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + ``` + + + +## Available tools + + + + | Tool | Description | + |------|-------------| + | `dub_create_link` | Create a link for the authenticated workspace | + | `dub_upsert_link` | Upsert a link by URL — returns the existing link or creates a new one | + | `dub_bulk_create_links` | Bulk create up to 100 links | + | `dub_get_link_info` | Retrieve the info for a link | + | `dub_get_links` | Retrieve a paginated list of links | + | `dub_get_links_count` | Retrieve the total number of links | + | `dub_update_link` | Update a link | + | `dub_bulk_update_links` | Bulk update up to 100 links with the same data | + | `dub_delete_link` | Delete a link | + | `dub_bulk_delete_links` | Bulk delete up to 100 links | + + + | Tool | Description | + |------|-------------| + | `dub_retrieve_analytics` | Retrieve analytics for a link, domain, or workspace. The response type depends on the `event` and `type` query parameters | + | `dub_list_events` | Retrieve a paginated list of events for the authenticated workspace | + + + | Tool | Description | + |------|-------------| + | `dub_get_qr_code` | Retrieve a QR code for a link | + + + | Tool | Description | + |------|-------------| + | `dub_get_customers` | Retrieve a paginated list of customers | + | `dub_get_customer` | Retrieve a customer by ID. Prefix the ID with `ext_` to look up by external ID | + | `dub_update_customer` | Update a customer | + | `dub_delete_customer` | Delete a customer from the workspace | + + + | Tool | Description | + |------|-------------| + | `dub_track_lead` | Track a lead event for a short link | + | `dub_track_sale` | Track a sale event for a short link | + | `dub_track_open` | Track when a user opens your app via a Dub-powered deep link (iOS and Android) | + + + | Tool | Description | + |------|-------------| + | `dub_create_domain` | Create a custom domain for the workspace | + | `dub_list_domains` | Retrieve a paginated list of domains | + | `dub_update_domain` | Update a domain | + | `dub_delete_domain` | Delete a domain and all its associated links | + + + | Tool | Description | + |------|-------------| + | `dub_create_tag` | Create a tag for the workspace | + | `dub_get_tags` | Retrieve a paginated list of tags | + | `dub_update_tag` | Update a tag | + | `dub_delete_tag` | Delete a tag. Existing links will no longer be associated with this tag | + + + | Tool | Description | + |------|-------------| + | `dub_create_folder` | Create a folder for the workspace | + | `dub_list_folders` | Retrieve a paginated list of folders | + | `dub_update_folder` | Update a folder | + | `dub_delete_folder` | Delete a folder. Existing links will no longer be associated with this folder | + + diff --git a/docs/sdks/mcp/dub-partners.mdx b/docs/sdks/mcp/dub-partners.mdx new file mode 100644 index 00000000..d1792b26 --- /dev/null +++ b/docs/sdks/mcp/dub-partners.mdx @@ -0,0 +1,210 @@ +--- +title: "Dub Partners MCP Server" +description: "Use the Dub Partners MCP server to manage your partner program — partners, commissions, payouts, and more — with any MCP-compatible AI client." +"og:title": "Dub Partners MCP Server" +--- + +The Dub Partners [MCP server](https://mcp.dub.sh/mcp/dub-partners) gives your AI agent native access to the full Dub Partners platform through a single integration. You can manage your partner program, review applications, update commissions, and track attribution using natural language. + +## What can the Dub Partners MCP server do? + +- **Partners** — Create or update partners, list all partners, deactivate, or ban partners from your program +- **Partner links** — Create and upsert links for enrolled partners +- **Applications** — List, approve, and reject pending partner applications +- **Analytics** — Retrieve analytics and list events for any link, domain, or workspace +- **Customers** — List, retrieve, update, and delete customers +- **Tracking** — Track lead, sale, and deep link open events +- **Bounties** — List, approve, and reject bounty submissions +- **Commissions** — List and update commissions (e.g. for refunds or fraud) +- **Payouts** — List payouts for your partner program + +## Prerequisites + +You'll need a Dub API key to authenticate with the MCP server. You can create one in your [Dub workspace settings](https://app.dub.co/settings/tokens). + +## Setup + +Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actual Dub API key. + + + + Open **Cursor Settings** → **MCP** → **Add new global MCP server** and paste the following: + + ```json + { + "mcpServers": { + "dub-partners": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-partners", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + Open **Claude Desktop** settings → **Developer** tab → **Edit Config** and add the following: + + ```json + { + "mcpServers": { + "dub-partners": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-partners", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + ```bash + claude mcp add dub-partners \ + --env MCP_DUB_TOKEN=dub_xxxxxx \ + -- npx -y mcp-remote@0.1.25 https://mcp.dub.sh/mcp/dub-partners \ + --header "Mcp-Dub-Token:\${MCP_DUB_TOKEN}" + ``` + + + Add the following to your `settings.json`: + + ```json + { + "mcp": { + "servers": { + "dub-partners": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-partners", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + } + ``` + + + ```json + { + "mcpServers": { + "dub-partners": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-partners", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + } + } + ``` + + + For any MCP client not listed above, use the raw configuration below: + + ```json + { + "command": "npx", + "args": [ + "-y", + "mcp-remote@0.1.25", + "https://mcp.dub.sh/mcp/dub-partners", + "--header", + "Mcp-Dub-Token:${MCP_DUB_TOKEN}" + ], + "env": { + "MCP_DUB_TOKEN": "dub_xxxxxx" + } + } + ``` + + + +## Available tools + + + + | Tool | Description | + |------|-------------| + | `dub_create_partner` | Create or update a partner (upsert). If a partner with the same email already exists, their program enrollment is updated | + | `dub_list_partners` | List all partners enrolled in a program | + | `dub_deactivate_partner` | Deactivate a partner and disable all their active links. Commissions and payouts remain intact | + | `dub_ban_partner` | Ban a partner from your program. All links are disabled and commissions are canceled | + | `dub_create_partner_link` | Create a link for a partner enrolled in your program | + | `dub_upsert_partner_link` | Upsert a link for a partner — returns the existing link or creates a new one | + + + | Tool | Description | + |------|-------------| + | `dub_list_partner_applications` | Retrieve a paginated list of pending applications for your partner program | + | `dub_approve_partner_application` | Approve a pending partner application. The partner is enrolled in the specified group and notified | + | `dub_reject_partner_application` | Reject a pending partner application. The partner is notified via email | + + + | Tool | Description | + |------|-------------| + | `dub_retrieve_analytics` | Retrieve analytics for a link, domain, or workspace. The response type depends on the `event` and `type` query parameters | + | `dub_list_events` | Retrieve a paginated list of events for the authenticated workspace | + + + | Tool | Description | + |------|-------------| + | `dub_get_customers` | Retrieve a paginated list of customers | + | `dub_get_customer` | Retrieve a customer by ID. Prefix the ID with `ext_` to look up by external ID | + | `dub_update_customer` | Update a customer | + | `dub_delete_customer` | Delete a customer from the workspace | + + + | Tool | Description | + |------|-------------| + | `dub_track_lead` | Track a lead event for a short link | + | `dub_track_sale` | Track a sale event for a short link | + | `dub_track_open` | Track when a user opens your app via a Dub-powered deep link (iOS and Android) | + + + | Tool | Description | + |------|-------------| + | `dub_list_bounty_submissions` | List all submissions for a specific bounty in your partner program | + | `dub_approve_bounty_submission` | Approve a bounty submission. Optionally specify a custom reward amount | + | `dub_reject_bounty_submission` | Reject a bounty submission with a specified reason and optional note | + + + | Tool | Description | + |------|-------------| + | `dub_list_commissions` | Retrieve a paginated list of commissions for your partner program | + | `dub_update_commission` | Update an existing commission amount. Useful for handling refunds or fraudulent sales | + + + | Tool | Description | + |------|-------------| + | `dub_list_payouts` | Retrieve a paginated list of payouts for your partner program | + +