Dub.co MCP server

Provides a streamlined interface for creating, updating, and deleting short links through the Dub.co URL shortening service with robust error handling and automatic domain selection.
Back to servers
Setup instructions
Provider
Gitmaxd
Release date
Mar 07, 2025
Language
TypeScript
Package
Stats
1.2K downloads
5 stars

The dubco-mcp-server is an unofficial Model Context Protocol (MCP) server that enables AI assistants to create, manage, and delete short links through the Dub.co API. It provides a seamless way to integrate Dub.co link shortening capabilities with AI systems using the MCP standard.

Installation Options

Using Smithery

Install automatically for Claude Desktop:

npx -y @smithery/cli install @Gitmaxd/dubco-mcp-server-npm --client claude

Global Installation

npm install -g dubco-mcp-server

Local Installation

npm install dubco-mcp-server

Direct Usage with npx

npx dubco-mcp-server

Configuration

The server requires a Dub.co API key from the Dub.co dashboard.

Set up your API key as an environment variable:

export DUBCO_API_KEY=your_api_key_here

For persistent configuration, add to your shell profile:

echo 'export DUBCO_API_KEY=your_api_key_here' >> ~/.zshrc

Setting Up in Cursor IDE

Step 1: Install Cursor IDE

Download and install Cursor IDE (version 0.4.5.9 or later).

Step 2: Configure in Settings

  1. Open Cursor IDE and access settings (gear icon or Cmd+,/Ctrl+,)
  2. Navigate to Features > MCP Servers
  3. Click "+ Add new MCP server"
  4. Enter the following:
    • Name: "Dub.co MCP Server"
    • Type: "command"
    • Command: env DUBCO_API_KEY=your_api_key_here npx -y dubco-mcp-server

Step 3: Verify Connection

Check for a green status indicator next to the server name in settings.

Using with MCP

MCP Configuration Example

{
  "mcpServers": {
    "dubco": {
      "command": "npx",
      "args": ["-y", "dubco-mcp-server"],
      "env": {
        "DUBCO_API_KEY": "your_api_key_here"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Available Tools

create_link

Creates a new short link on Dub.co.

Parameters:

{
  "url": "https://example.com",
  "key": "optional-custom-slug",
  "externalId": "optional-external-id",
  "domain": "optional-domain-slug"
}

Example:

{
  "url": "https://github.com/gitmaxd/dubco-mcp-server-npm",
  "key": "dubco-mcp"
}

update_link

Updates an existing short link.

Parameters:

{
  "linkId": "link-id-to-update",
  "url": "https://new-destination.com",
  "domain": "new-domain-slug",
  "key": "new-custom-slug"
}

Example:

{
  "linkId": "clwxyz123456",
  "url": "https://github.com/gitmaxd/dubco-mcp-server-npm/releases"
}

delete_link

Deletes a short link.

Parameters:

{
  "linkId": "link-id-to-delete"
}

Example:

{
  "linkId": "clwxyz123456"
}

How It Works

The server operates by:

  1. Validating input parameters when a tool is called
  2. Sending appropriate requests to the Dub.co API using your API key
  3. Processing responses and returning them in a format compatible with AI assistants

When using with an AI assistant, explicitly instruct the AI to use the Dub.co tools (create_link, update_link, delete_link) and accept the tool usage prompts when they appear.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dubco" '{"command":"npx","args":["-y","dubco-mcp-server"],"env":{"DUBCO_API_KEY":"your_api_key_here"},"disabled":false,"autoApprove":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dubco": {
            "command": "npx",
            "args": [
                "-y",
                "dubco-mcp-server"
            ],
            "env": {
                "DUBCO_API_KEY": "your_api_key_here"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "dubco": {
            "command": "npx",
            "args": [
                "-y",
                "dubco-mcp-server"
            ],
            "env": {
                "DUBCO_API_KEY": "your_api_key_here"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later