Skip to content

Commit cb432aa

Browse files
committed
update mcp server docs
1 parent 8e0ce5e commit cb432aa

2 files changed

Lines changed: 198 additions & 88 deletions

File tree

docs/mcp-server.mdx

Lines changed: 198 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,201 @@
11
---
22
title: "Dub MCP Server"
3-
description: "Use the Dub MCP server to manage your partner program with the AI agent of your choice."
3+
description: "Use the Dub MCP server to manage your Dub resources with the AI agent of your choice."
44
sidebarTitle: "MCP Server"
55
---
66

7-
## What is an MCP Server?
7+
MCP is an open protocol that standardizes how applications provide context to LLMs. Among other benefits, it provides LLMs tools to act on your behalf. Dub offers both a [remote MCP server](#remote-mcp-server-recommended) and a [local MCP server](#local-mcp-server).
88

9-
MCP (Model Context Protocol) is an open standard for connecting AI applications to external tools and data. It gives your AI agent structured access to APIs so it can take actions on your behalf — like approving partner applications or updating commissions — using natural language.
10-
11-
## What can the Dub MCP server do?
12-
13-
The Dub [MCP server](https://mcp.dub.sh/mcp/dub-partners) gives your AI agent native access to the full Dub platform through a single integration. You can manage your partner program, review applications, update commissions, and track attribution using natural language.
14-
15-
- **Partners** — Create or update partners, list all partners, deactivate, or ban partners from your program
16-
- **Partner links** — Create and upsert links for enrolled partners
17-
- **Applications** — List, approve, and reject pending partner applications
18-
- **Analytics** — Retrieve analytics and list events for any partner, [partner groups](/help/article/partner-groups), or their specific links
19-
- **Customers** — List, retrieve, update, and delete customers
20-
- **Tracking** — Track lead, sale, and deep link open events
21-
- **Bounties** — List, approve, and reject bounty submissions
22-
- **Commissions** — List and update commissions (e.g. for refunds or fraud)
23-
- **Payouts** — List payouts for your partner program
24-
25-
As an example, you could use this to triage partner applications, adjust commissions after a refund, or pull attribution analytics for a top partner — all from your AI client.
9+
<Frame>
10+
<img src="/images/mcp-server.png" alt="MCP Server" />
11+
</Frame>
2612

2713
<Tip>
2814
Looking for the [Dub Links](https://dub.co/links) MCP server? Check out the
2915
[Dub Links MCP server docs](https://mcp.dub.sh/mcp/dub-links).
3016
</Tip>
3117

32-
## Prerequisites
18+
## Remote MCP Server (recommended)
19+
20+
Dub's MCP server is hosted at:
3321

34-
The Dub MCP server is hosted remotely and connects to any [supported MCP client](#mcp-client-integrations) via [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) and `npx`. To use the MCP server, you'll need to:
22+
```
23+
https://mcp.dub.sh/mcp/dub-partners
24+
```
3525

36-
- [Create a Dub API key](https://app.dub.co/settings/tokens) with access to your partner program
26+
Connect any MCP client that supports remote servers (Streamable HTTP). There's nothing to install and no local process to run, which makes it the best option for web-based clients like Claude and hosted agent platforms.
3727

38-
## How to use the MCP Server
28+
When you connect, your client opens a browser window to log in to Dub and approve access using OAuth.
29+
30+
<Tabs>
31+
<Tab title="Claude">
32+
You can install the Dub MCP server as a [custom connector in
33+
Claude](https://claude.ai/new#settings/customize-connectors):
34+
35+
<Frame>
36+
<video
37+
src="https://assets.dub.co/misc/install-claude-custom-connector.mp4"
38+
loop
39+
autoPlay
40+
muted
41+
playsInline
42+
/>
43+
</Frame>
44+
45+
To install only the MCP server, add it manually in Claude (web or desktop) from **Settings** > **Connectors** > **Add custom connector**:
46+
47+
```
48+
https://mcp.dub.sh/mcp/dub-partners
49+
```
3950

40-
Dub's MCP server runs over HTTP at `https://mcp.dub.sh/mcp/dub-partners`. Most clients connect through **`mcp-remote`**, which bridges stdio-based clients to the remote endpoint and forwards your API key in the `Mcp-Dub-Token` header.
51+
</Tab>
52+
53+
<Tab title="ChatGPT">
54+
You can install the Dub MCP server as a [ChatGPT
55+
plugin](https://chatgpt.com/plugins):
56+
57+
<Tip>
58+
Make sure to enable [Developer Mode](https://developers.openai.com/api/docs/guides/developer-mode) in ChatGPT first before installing the plugin.
59+
</Tip>
60+
61+
<Frame>
62+
<video
63+
src="https://assets.dub.co/misc/install-chatgpt-plugin.mp4"
64+
loop
65+
autoPlay
66+
muted
67+
playsInline
68+
/>
69+
</Frame>
70+
71+
</Tab>
72+
73+
<Tab title="Cursor">
74+
Open the command palette and choose **Cursor Settings****MCP****Add new global MCP server**.
75+
76+
```json
77+
{
78+
"mcpServers": {
79+
"dub": {
80+
"url": "https://mcp.dub.sh/mcp/dub-partners"
81+
}
82+
}
83+
}
84+
```
85+
86+
</Tab>
87+
88+
<Tab title="Copilot">
89+
To use GitHub Copilot in VS Code, add the following to your `settings.json`:
90+
91+
```json
92+
{
93+
"mcp": {
94+
"servers": {
95+
"dub": {
96+
"type": "http",
97+
"url": "https://mcp.dub.sh/mcp/dub-partners"
98+
}
99+
}
100+
}
101+
}
102+
```
103+
104+
</Tab>
105+
106+
<Tab title="Windsurf">
107+
108+
In Windsurf's Settings, navigate to **Agents** > **MCP servers**, and click **+ Add** to add a new server.
109+
110+
```json
111+
{
112+
"mcpServers": {
113+
"dub": {
114+
"serverUrl": "https://mcp.dub.sh/mcp/dub-partners"
115+
}
116+
}
117+
}
118+
```
119+
120+
</Tab>
121+
122+
<Tab title="Warp">
123+
In Warp's Settings, navigate to **Agents** > **MCP servers**, and click **+ Add** to add a new server.
124+
125+
```json
126+
{
127+
"dub": {
128+
"serverUrl": "https://mcp.dub.sh/mcp/dub-partners"
129+
}
130+
}
131+
```
132+
133+
</Tab>
134+
</Tabs>
41135

42-
Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actual Dub API key.
136+
---
43137

44-
### MCP client integrations
138+
_If your client runs somewhere a browser login isn't possible_ (a server, CI, or a headless agent), pass a [Dub API key](/docs/api-reference/authentication#api-keys) in the `Mcp-Dub-Token` header instead of using OAuth.
45139

46140
<Tabs>
47141
<Tab title="Claude Code">
48142
```bash
49143
claude mcp add dub-partners \
50-
--env MCP_DUB_TOKEN=dub_xxxxxx \
51-
-- npx -y mcp-remote@0.1.25 https://mcp.dub.sh/mcp/dub-partners \
52-
--header "Mcp-Dub-Token:\${MCP_DUB_TOKEN}"
144+
--transport http https://mcp.dub.sh/mcp/dub-partners \
145+
--header "Mcp-Dub-Token: dub_xxxxxx"
53146
```
54147
</Tab>
55148

56-
<Tab title="Codex">
149+
<Tab title="JSON config">
150+
For clients configured with JSON (Cursor, Windsurf, and others), add a `Mcp-Dub-Token` header:
151+
152+
```json
153+
{
154+
"mcpServers": {
155+
"dub": {
156+
"url": "https://mcp.dub.sh/mcp/dub-partners",
157+
"headers": {
158+
"Mcp-Dub-Token": "dub_xxxxxx"
159+
}
160+
}
161+
}
162+
}
163+
```
164+
165+
</Tab>
166+
</Tabs>
167+
168+
## Local MCP Server
169+
170+
If your MCP client doesn't support connecting directly to a remote HTTP endpoint, use [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) to run a local process that proxies requests to Dub's hosted server. You can integrate it into any supported MCP client using `npx`. You'll need a [Dub API key](/docs/api-reference/authentication#api-keys).
171+
172+
Choose your client below to get started. Remember to replace `dub_xxxxxx` with your actual API key.
173+
174+
### Stdio Transport (Default)
175+
176+
<Tabs>
177+
<Tab title="Claude Code">
57178
```bash
58-
codex mcp add dub-partners \
179+
claude mcp add dub-partners \
59180
--env MCP_DUB_TOKEN=dub_xxxxxx \
60181
-- npx -y mcp-remote@0.1.25 https://mcp.dub.sh/mcp/dub-partners \
61182
--header "Mcp-Dub-Token:\${MCP_DUB_TOKEN}"
62183
```
63184
</Tab>
64185

186+
<Tab title="Codex">
187+
```bash codex mcp add dub-partners \ --env MCP_DUB_TOKEN=dub_xxxxxx \ -- npx
188+
-y mcp-remote@0.1.25 https://mcp.dub.sh/mcp/dub-partners \ --header
189+
"Mcp-Dub-Token:\${MCP_DUB_TOKEN}" ```
190+
</Tab>
191+
65192
<Tab title="Cursor">
66193
Open the command palette and choose **Cursor Settings****MCP****Add new global MCP server**.
67194
68195
```json
69196
{
70197
"mcpServers": {
71-
"dub-partners": {
198+
"dub": {
72199
"command": "npx",
73200
"args": [
74201
"-y",
@@ -93,7 +220,7 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
93220
```json
94221
{
95222
"mcpServers": {
96-
"dub-partners": {
223+
"dub": {
97224
"command": "npx",
98225
"args": [
99226
"-y",
@@ -119,7 +246,7 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
119246
{
120247
"mcp": {
121248
"servers": {
122-
"dub-partners": {
249+
"dub": {
123250
"command": "npx",
124251
"args": [
125252
"-y",
@@ -143,7 +270,7 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
143270
```json
144271
{
145272
"mcpServers": {
146-
"dub-partners": {
273+
"dub": {
147274
"command": "npx",
148275
"args": [
149276
"-y",
@@ -168,7 +295,7 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
168295
{
169296
"$schema": "https://opencode.ai/config.json",
170297
"mcp": {
171-
"dub-partners": {
298+
"dub": {
172299
"type": "local",
173300
"command": [
174301
"npx",
@@ -193,7 +320,7 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
193320
```json
194321
{
195322
"mcpServers": {
196-
"dub-partners": {
323+
"dub": {
197324
"command": "npx",
198325
"args": [
199326
"-y",
@@ -211,66 +338,28 @@ Choose your MCP client below to get started. Replace `dub_xxxxxx` with your actu
211338
```
212339
</Tab>
213340

214-
<Tab title="Other clients">
215-
For any MCP client not listed above, use the raw configuration below:
341+
<Tab title="Warp">
342+
In Warp's Settings, navigate to **Agents** > **MCP servers**, and click **+ Add** to add a new server.
216343

217344
```json
218345
{
219-
"command": "npx",
220-
"args": [
221-
"-y",
222-
"mcp-remote@0.1.25",
223-
"https://mcp.dub.sh/mcp/dub-partners",
224-
"--header",
225-
"Mcp-Dub-Token:${MCP_DUB_TOKEN}"
226-
],
227-
"env": {
228-
"MCP_DUB_TOKEN": "dub_xxxxxx"
229-
}
230-
}
231-
```
232-
233-
</Tab>
234-
</Tabs>
235-
236-
### Native HTTP
237-
238-
Some MCP clients support connecting directly to a remote HTTP endpoint without `mcp-remote`. In that case, point your client at the Dub MCP URL and pass your API key in the `Mcp-Dub-Token` header.
239-
240-
<Tabs>
241-
<Tab title="Claude Code">
242-
```bash
243-
claude mcp add dub-partners \
244-
--transport http https://mcp.dub.sh/mcp/dub-partners \
245-
--header "Mcp-Dub-Token: dub_xxxxxx"
246-
```
247-
</Tab>
248-
249-
<Tab title="Cursor">
250-
Open the command palette and choose **Cursor Settings****MCP****Add new global MCP server**.
251-
252-
```json
253-
{
254-
"mcpServers": {
255-
"dub-partners": {
256-
"url": "https://mcp.dub.sh/mcp/dub-partners",
257-
"headers": {
258-
"Mcp-Dub-Token": "dub_xxxxxx"
259-
}
346+
"dub": {
347+
"command": "npx",
348+
"args": [
349+
"-y",
350+
"mcp-remote@0.1.25",
351+
"https://mcp.dub.sh/mcp/dub-partners",
352+
"--header",
353+
"Mcp-Dub-Token:${MCP_DUB_TOKEN}"
354+
],
355+
"env": {
356+
"MCP_DUB_TOKEN": "dub_xxxxxx"
260357
}
261358
}
262359
}
263360
```
264361

265362
</Tab>
266-
267-
<Tab title="Other clients">
268-
Use your client's remote MCP configuration with:
269-
270-
- **URL:** `https://mcp.dub.sh/mcp/dub-partners`
271-
- **Header:** `Mcp-Dub-Token: dub_xxxxxx`
272-
273-
</Tab>
274363
</Tabs>
275364

276365
### Environment variables
@@ -281,3 +370,24 @@ Some MCP clients support connecting directly to a remote HTTP endpoint without `
281370
Store your API key in the `env` block or an environment variable rather than
282371
hardcoding it in shared config files when possible.
283372
</Info>
373+
374+
## MCP Server tools
375+
376+
The Dub [MCP server](https://mcp.dub.sh/mcp/dub-partners) gives your AI agent native access to the full Dub platform through a single integration. You can manage your partner program, review applications, update commissions, and track attribution using natural language.
377+
378+
- **Partners** — Create or update partners, list all partners, deactivate, or ban partners from your program
379+
- **Partner links** — Create and upsert links for enrolled partners
380+
- **Applications** — List, approve, and reject pending partner applications
381+
- **Analytics** — Retrieve analytics and list events for any partner, [partner groups](/help/article/partner-groups), or their specific links
382+
- **Customers** — List, retrieve, update, and delete customers
383+
- **Tracking** — Track lead, sale, and deep link open events
384+
- **Bounties** — List, approve, and reject bounty submissions
385+
- **Commissions** — List and update commissions (e.g. for refunds or fraud)
386+
- **Payouts** — List payouts for your partner program
387+
388+
Here are some real examples of what your agent can do with these tools:
389+
390+
- Triage pending partner applications and approve or reject them in bulk
391+
- Adjust commissions after a refund or flag suspicious activity
392+
- Pull attribution analytics for a top partner or [partner group](/help/article/partner-groups)
393+
- Create partner links and track lead or sale conversion events

images/mcp-server.png

345 KB
Loading

0 commit comments

Comments
 (0)