dubco-tool-adapter-for-ai
Provides an interface for conversational agents to provision, modify, and retire URL shorteners hosted via the Dub.co service through its dedicated API.
Author

Gitmaxd
Quick Info
Actions
Tags
Dub.co Link Management Adapter (MCP Server)
This implementation functions as an unofficial Model Context Protocol (MCP) server designed to abstract the operations available through the Dub.co URL shortening platform's Application Programming Interface (API). It standardizes link lifecycle management (creation, modification, erasure) for consumption by advanced Artificial Intelligence (AI) assistants.
🌟 Core Capabilities
This adapter facilitates the following actions via the Dub.co backend:
- Link Fabrication: Generate novel, concise URLs utilizing user-specified domains.
- Record Modification: Alter parameters of extant short links.
- Link Invalidation: Permanently remove specified short links.
- Protocol Compliance: Ensures smooth, protocol-adherent interaction with AI orchestration layers.
🧰 Requirements
To successfully deploy and operate this server, the following prerequisites must be satisfied:
- Execution environment must support Node.js version 16.0.0 or newer.
- Access credentials for a registered Dub.co account are mandatory.
- A valid API authentication token obtained from the Dub.co developer settings portal is required.
📥 Deployment Methods
Installation via Smithery Utility
For automated setup integrated with supported AI clients (like Claude Desktop) using the Smithery ecosystem:
npx -y @smithery/cli install @Gitmaxd/dubco-mcp-server-npm --client claude
System-Wide Installation
npm install -g dubco-mcp-server
Local Project Inclusion
npm install dubco-mcp-server
Immediate Execution (npx)
npx dubco-mcp-server
🔐 Configuration Directives
The server's operation is gated by the requirement for a valid Dub.co authorization token. This token must be supplied to the environment.
Set the required token via an environment variable:
export DUBCO_API_KEY=your_secure_api_key
For enduring configuration across sessions, append the export command to your shell initialization file (e.g., .bashrc or .zshrc):
echo 'export DUBCO_API_KEY=your_secure_api_key' >> ~/.zshrc
🖥️ Integration with Cursor IDE
Cursor IDE offers built-in functionality for utilizing MCP services. Ensure you are running version 0.4.5.9 or later.
Phase 1: Tool Acquisition
If not already present, acquire and install the Cursor IDE application.
Phase 2: Accessing Settings
- Launch Cursor IDE.
- Navigate to configuration via the settings icon (bottom-left) or shortcut (
Cmd+,/Ctrl+,). - Locate and select the 'Features' pane.
- Scroll to the dedicated 'MCP Servers' management section.
Phase 3: Registering the Service
- Initiate the addition process by clicking "+ Add new MCP server".
- Populate the configuration dialogue as follows:
- Name: Define a recognizable identifier, such as "Dub.co Link Service".
- Type: Specify "command".
- Command: Input the execution string, substituting the placeholder key:
env DUBCO_API_KEY=your_actual_key npx -y dubco-mcp-server - Finalize by clicking "Save".
Phase 4: Status Validation
A successful connection is indicated by a green status marker adjacent to the server's entry. If connectivity issues arise (yellow or red status), perform these diagnostics:
- Reconfirm the accuracy of the supplied API credential.
- Initiate a restart of the Cursor IDE instance.
- Verify the correct installation and availability of Node.js (v16+).
Phase 5: Operationalizing the Adapter
Once linked, the tools become accessible within Cursor's advanced interaction modes (Composer or Agent):
- Activate either Composer or Agent functionality.
- Explicitly prompt the AI to invoke the Dub.co toolset (e.g.,
create_link,update_link,delete_link). - Approve the subsequent tool utilization suggestions presented by the system.
🛠️ Model Context Protocol Utilization
This adapter exposes capabilities for any MCP-compliant orchestration layer. To integrate it, incorporate the server definition into your primary MCP configuration structure.
Configuration Snippet Example
{
"mcpServers": {
"dubco": {
"command": "npx",
"args": ["-y", "dubco-mcp-server"],
"env": {
"DUBCO_API_KEY": "your_secure_api_key"
},
"disabled": false,
"autoApprove": []
}
}
}
Defined Interface Functions
create_link
Initiates the generation of a novel short alias via Dub.co.
Parameters Schema:
{
"url": "https://target-destination.org",
"key": "optional-custom-slug",
"externalId": "optional-tracking-identifier",
"domain": "optional-assigned-domain"
}
Invocation Example:
{
"url": "https://github.com/gitmaxd/dubco-mcp-server-npm",
"key": "mcp-adapter"
}
update_link
Applies modifications to an existing resource identifier.
Parameters Schema:
{
"linkId": "identifier-to-modify",
"url": "https://new-endpoint.net",
"domain": "revised-domain-slug",
"key": "revised-slug"
}
Invocation Example:
{
"linkId": "clwxyz123456",
"url": "https://github.com/gitmaxd/dubco-mcp-server-npm/releases/latest"
}
delete_link
Decommissions a specific short link resource.
Parameters Schema:
{
"linkId": "identifier-to-remove"
}
Invocation Example:
{
"linkId": "clwxyz123456"
}
🧠 Operational Flow
The adapter establishes a secure connection to the Dub.co API utilizing the provided secret key. It exposes a structured function set for AI agents. Upon tool invocation:
- Input arguments undergo validation against the defined schema.
- The corresponding API call is constructed and dispatched to Dub.co.
- The resultant data from Dub.co is parsed and transformed into a standardized output format consumable by the invoking AI agent.
🏗️ Maintenance and Building
Source Code Compilation
To build the necessary artifacts from the source repository:
git clone https://github.com/gitmaxd/dubco-mcp-server-npm.git
cd dubco-mcp-server-npm
npm install
npm run build
Running in Debug Mode
npm run dev
📄 Legal Notice
This software component is distributed under the terms of the ISC License. Refer to the associated LICENSE file for comprehensive licensing details.
🌐 Related Resources
- Dub.co Platform - The primary URL shortening infrastructure.
- Dub.co API Reference - Official API documentation.
- Model Context Protocol Specification - Details on the interaction standard.
🤝 Community Contributions
We welcome enhancements and bug fixes! To contribute:
- Fork the repository.
- Branch out for new work (
git checkout -b feature/contribution-name). - Commit changes clearly (
git commit -m 'feat: Added feature X'). - Push the changes (
git push origin feature/contribution-name). - Submit a Pull Request for review.
👤 Author Information
This unauthorized Dub.co adapter for MCP was engineered by GitMaxd (Find me on X as @gitmaxd).
This project was initiated as a practical exercise in mastering the Model Context Protocol specification and developing compatible server integrations. Dub.co was selected due to its clean API design and direct utility, making it an excellent subject for protocol implementation practice.
Though I maintain no official partnership with Dub.co, their service is highly recommended for both manual and automated link management workflows, thanks to their accessible API documentation. Feedback, suggestions, or contributions are greatly appreciated via the repository.
