dubco-mcp-gateway
A standardized Model Context Protocol (MCP) interface for programmatic manipulation of URL redirection services hosted by Dub.co, facilitating seamless integration with automated systems and AI agents.
Author

Gitmaxd
Quick Info
Actions
Tags
Unofficial Dub.co URL Shortener Provider Interface
This implementation acts as an intermediary server adhering to the Model Context Protocol (MCP) specification, specifically designed to interface with the Dub.co platform's Application Programming Interface (API) for managing short URLs. It provides robust mechanisms for any MCP-compliant artificial intelligence assistant to dynamically provision, modify, or retire branded short links.
⚙️ Core Functionality
This service exposes essential CRUD operations for URL management via the Dub.co backend:
- Provisioning: Instantiate new shortened links, optionally specifying custom slugs and associated domain names.
- Modification: Alter the destination URL or metadata of an existing redirect pointer.
- Decommissioning: Permanently remove a specific short link.
- AI Interoperability: Designed for native invocation within AI agent environments supporting the MCP standard.
🎯 Requirements
To deploy and utilize this server successfully, the following dependencies must be satisfied:
- A runtime environment supporting Node.js version 16.0.0 or newer.
- An active subscription to Dub.co granting access to their REST API.
- A valid API Access Key obtainable from the Dub.co developer settings portal.
🚀 Deployment Methods
Automated Deployment via Smithery
Leverage the Smithery CLI for streamlined, automated setup for agents like Claude Desktop:
bash npx -y @smithery/cli install @Gitmaxd/dubco-mcp-server-npm --client claude
Standard NPM Installation
Install globally for system-wide access:
bash npm install -g dubco-mcp-server
Install locally within a project context:
bash npm install dubco-mcp-server
Direct Execution
Execute the utility directly using npx:
bash npx dubco-mcp-server
🔑 Configuration Protocol
Operational success hinges on providing the Dub.co API credential. This key must be exposed to the server process, typically via an environment variable:
bash export DUBCO_API_KEY=your_secret_api_token
For persistent shell configuration (e.g., Bash/Zsh profiles):
bash echo 'export DUBCO_API_KEY=your_secret_api_token' >> ~/.zshrc
🖥️ Integration with Cursor IDE
Cursor IDE natively incorporates MCP endpoints. Configure the service as follows (requires Cursor version 0.4.5.9+):
Setup Procedure
- Ensure Cursor IDE is installed.
- Access the application settings (Gear icon or
Cmd+,/Ctrl+,). - Navigate to the 'Features' pane.
- Locate and expand the "MCP Servers" configuration area.
Adding the Endpoint
- Select the "+ Add new MCP server" option.
-
Populate the fields:
- Name: Define a recognizable identifier (e.g., "Dub.co Link Manager").
- Type: Set to "command".
- Command: Input the execution string, embedding the API key directly for localized use: bash env DUBCO_API_KEY=your_actual_api_key npx -y dubco-mcp-server
-
Finalize by clicking "Save".
Connectivity Verification
A successful connection is indicated by a green status indicator. Troubleshoot potential issues by confirming key validity, restarting Cursor, or ensuring Node.js prerequisites are met.
🛠️ Protocol Usage via MCP
Once integrated into your MCP environment, the server exposes methods corresponding to link lifecycle management.
MCP Manifest Configuration Sample
This JSON snippet illustrates how to declare the service within an overall MCP configuration object:
{ "mcpServers": { "dubco_url_manager": { "command": "npx", "args": ["-y", "dubco-mcp-server"], "env": { "DUBCO_API_KEY": "your_api_key_here" }, "disabled": false, "autoApprove": [] } } }
Exposed Toolkit Methods
create_link
Initiates the creation of a new short link resource within the Dub.co system.
Arguments Schema:
{ "url": "string (required): The target destination URL.", "key": "string (optional): Desired custom path segment (slug).", "externalId": "string (optional): An identifier for external tracking.", "domain": "string (optional): The specific Dub.co domain to use for the link." }
Invocation Example:
{ "url": "https://repository.example.org/project-x", "key": "proj-x-shrt" }
update_link
Modifies the attributes of an already existing short link.
Arguments Schema:
{ "linkId": "string (required): The unique identifier assigned by Dub.co.", "url": "string (optional): The new destination URL.", "domain": "string (optional): A new domain to associate with the link.", "key": "string (optional): A new custom slug." }
Invocation Example:
{ "linkId": "clabcd987654", "url": "https://new-destination-site.net" }
delete_link
Removes a specific short link from the Dub.co registry.
Arguments Schema:
{ "linkId": "string (required): The identifier of the link to be erased." }
Invocation Example:
{ "linkId": "clabcd987654" }
🌐 Architectural Flow
The server operates as a translator between the abstract MCP calls and the concrete Dub.co REST interface. Upon method invocation:
- Input parameters undergo strict validation against defined schemas.
- The server constructs the necessary HTTP payload and directs the request to the appropriate Dub.co API endpoint, authenticating with the configured API key.
- The resulting API response is parsed and reformatted into a clear, structured output consumable by the calling AI assistant.
🧑💻 Development & Contribution
Local Build Process
To compile the project from source:
bash git clone https://github.com/gitmaxd/dubco-mcp-server-npm.git cd dubco-mcp-server-npm npm install npm run build
Runtime Execution (Development)
bash npm run dev
📜 Legal & Attribution
This module is distributed under the ISC License (refer to the LICENSE file for full terms).
External References
Community Engagement
Contributions are actively encouraged. Initiate development by forking the repository and submitting a Pull Request with your enhancements.
Origin Note
This utility was independently developed by GitMaxd as an exercise in implementing MCP server architectures. While there is no formal partnership with Dub.co, their API simplicity made it an excellent integration target. Feedback and improvements are welcomed via the repository.
