Set up Dub in Metorial for Claude, ChatGPT and Cursor
Share Dub with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API key sign-in, 18 tools (8 read-only).
To give your team Dub in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Dub integration in a Metorial portal, and each person signs in to Dub with their own account. Agents can create and manage short links with custom domains, UTM parameters, targeting, expiration, and conversion tracking. The integration has 18 tools, 8 read-only, 6 write and 4 destructive, plus 4 triggers.
What you'll learn
- How an admin shares Dub in a portal and how each person connects
- The 11 OAuth scopes Dub can request, and what each one allows
- How to keep the 8 read-only tools and reject the other 10
Before you start
- A portal with at least one access group
- An account with Dub for each person who connects
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| API Key | API token | apiKey |
| OAuth (default) | OAuth | Signs in to Dub |
The portal and metorial setup use OAuth unless someone picks another method.
API Key
To connect, a person enters:
apiKey: Dub API key (starts with dub_)
OAuth
People sign in to Dub and approve the scopes you allow. The integration can request:
| Scope | Name | What it allows |
|---|---|---|
links.read | Read Links | View links in the workspace |
links.write | Write Links | Create, update, and delete links |
tags.read | Read Tags | View tags in the workspace |
tags.write | Write Tags | Create, update, and delete tags |
analytics.read | Read Analytics | Retrieve analytics data for links and workspace |
domains.read | Read Domains | View domains in the workspace |
domains.write | Write Domains | Add and manage custom domains |
folders.read | Read Folders | View folders in the workspace |
folders.write | Write Folders | Create and manage folders |
conversions.write | Read Conversions | View conversion events (leads and sales) |
user.read | Read User | View user profile information |
Use your own Dub OAuth app
With your own OAuth app, people see your company's name on the Dub consent screen, and the client ID and secret belong to you.
Start the credentials in Metorial
In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Dub and copy the Redirect URI.
Register the app with Dub
Create an OAuth app or client in Dub and add the redirect URI from Metorial as its redirect or callback URL.
Finish in Metorial
Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Dub integration.
Admin: share Dub in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Dub. Under Auth Method, keep OAuth or pick another. For how members connect, choose Each person connects, so everyone signs in to Dub as themselves.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Dub.
Choose who gets it
Add the access groups that should see Dub. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Dub integration. Once it exists, check which groups have it:
Employee: connect Dub
In the portal
Open Dub in the catalog
Sign in to your portal and open Dub. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. A Dub sign-in tab opens. Sign in and approve the permissions listed.
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID. metorial setup uses OAuth. To connect with API Key instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.
Add it to your AI client
metorial install adds your Dub connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 8 read-only tools, such as get_link and who_am_i, and lose the 6 write tools, such as track_lead or track_sale, and the 4 destructive tools, such as delete_link or manage_domains.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 18 tools, minus any you rejected. list_links takes no input. It retrieves a list of short links from your workspace.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (8)
get_link: Retrieve details about a specific short link.list_events: Retrieve a list of tracked events (clicks, leads, sales) from your workspace.list_links: Retrieve a list of short links from your workspace.get_metatags: Retrieve Open Graph metadata (title, description, image) for any URL. Needsurl.list_customers: Retrieve customers tracked through the conversion funnel.get_analytics: Retrieve analytics for your links, workspace, or specific resources.who_am_i: Retrieve the current OAuth user and connected Dub workspace.download_qr_code: Generate a downloadable PNG or SVG QR code for a URL, including a Dub short link.
Write tools (6)
track_sale: Track a sale conversion event. NeedscustomerExternalIdandamount.upsert_link: Create a new short link or update an existing one. NeedsdestinationUrl.create_link: Create a new short link in your Dub workspace. NeedsdestinationUrl.track_lead: Track a lead conversion event attributed to a link click. NeedsclickId,eventNameandcustomerExternalId.update_link: Update an existing short link's properties. NeedslinkId.manage_tags: Create, update, delete, or list tags used to categorize and organize links. Needsaction.
Destructive tools (4)
manage_domains: List, create, update, or delete custom domains for your short links. Needsaction.delete_link: Permanently delete a short link. NeedslinkId.manage_customer: Retrieve, update, or delete a customer by Dub customer ID or an external ID prefixed with ext_.manage_folders: List, create, rename, or delete folders used to organize short links.
Triggers
Dub has 4 triggers, which fire on events in Dub:
partner_events: Triggers for partner/affiliate program events including partner enrollment, application submissions, commission creation, and payout confirmations.link_events: Triggers when a link is created, updated, or deleted in your Dub workspace.conversion_events: Triggers when a lead or sale conversion event is tracked.link_clicked: Triggers when a tracked link is clicked.
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Dub there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Dub on metorial.com: the integration overview