MetorialDocs

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

Sign-in methods

MethodTypeWhat a person provides
API KeyAPI tokenapiKey
OAuth (default)OAuthSigns 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:

ScopeNameWhat it allows
links.readRead LinksView links in the workspace
links.writeWrite LinksCreate, update, and delete links
tags.readRead TagsView tags in the workspace
tags.writeWrite TagsCreate, update, and delete tags
analytics.readRead AnalyticsRetrieve analytics data for links and workspace
domains.readRead DomainsView domains in the workspace
domains.writeWrite DomainsAdd and manage custom domains
folders.readRead FoldersView folders in the workspace
folders.writeWrite FoldersCreate and manage folders
conversions.writeRead ConversionsView conversion events (leads and sales)
user.readRead UserView 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:

metorial-admin portals access list <portal-id> --type provider_template --search dub

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

metorial catalog search dub
metorial setup <catalog-item-id>

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.

metorial list dub
metorial client list
metorial install <client-identifier> <integration-id>

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 list dub
metorial tools <integration-id>
metorial call <integration-id> list_links -d '{}'

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. Needs url.
  • 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. Needs customerExternalId and amount.
  • upsert_link: Create a new short link or update an existing one. Needs destinationUrl.
  • create_link: Create a new short link in your Dub workspace. Needs destinationUrl.
  • track_lead: Track a lead conversion event attributed to a link click. Needs clickId, eventName and customerExternalId.
  • update_link: Update an existing short link's properties. Needs linkId.
  • manage_tags: Create, update, delete, or list tags used to categorize and organize links. Needs action.

Destructive tools (4)

  • manage_domains: List, create, update, or delete custom domains for your short links. Needs action.
  • delete_link: Permanently delete a short link. Needs linkId.
  • 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