The DWZ Short URL MCP Server provides comprehensive short URL management capabilities for AI assistants through MCP protocol integration with a dwz-server backend.
Core Capabilities:
Create Short URLs - Generate shortened links with custom domains, titles, descriptions, optional custom codes, and expiration dates
Batch Operations - Create up to 50 short URLs simultaneously for improved efficiency
Retrieve URL Information - Get detailed data for specific short URLs, including original URLs, click statistics, and creation timestamps
List and Search URLs - Browse paginated lists with filtering by domain and keyword search across URLs, titles, and descriptions
Delete URLs - Permanently remove specific short URLs by ID
Manage Domains - List all available domains with configuration details, activation status, and usage statistics
Track Analytics - Access click statistics and usage data for shortened URLs
Secure Operations - API authentication via Bearer Token with comprehensive validation and error handling
Error Handling - Automatic retry mechanisms for reliable operations
Runtime environment used to execute the MCP server
Package manager used for installing dependencies and distributing the MCP server
Mliev Short URL MCP Client
A short URL management client based on MCP (Model Context Protocol) protocol, providing complete short URL generation, management, and statistics functionality for AI assistants. This MCP server is implemented based on the API interface of the dwz-server project.
ποΈ Server Architecture
This MCP client calls the short URL service API based on the dwz-server project. dwz-server is a high-performance short URL service developed in Go language, providing complete short URL generation, management, and statistics functionality.
Deploy dwz-server with Docker
It is recommended to deploy dwz-server using Docker as the backend service for the MCP client:
Start the service:
After the service starts, the API address will be http://localhost:8080. Configure it in the MCP client:
β¨ Features
π Short URL Creation: Support custom domains, short codes, titles, and descriptions
π Batch Operations: Create multiple short URLs at once to improve efficiency
π Search & Filter: Support domain filtering and keyword search
π Statistics & Analytics: Get detailed click statistics information
π‘οΈ Error Handling: Comprehensive error handling and retry mechanisms
π Security Authentication: API authentication based on Bearer Token
π Quick Start
Prerequisites
Node.js >= 18.0.0
npm or yarn
Direct MCP Usage
Install Dependencies
Configure Environment Variables
Copy the environment variable template and configure:
Edit the .env file:
Start Service
π MCP Tool List
1. create_short_url
Create a new short URL
Parameters:
original_url(required): Original URL addressdomain(required): Short URL domaintitle(required): Web page titlecustom_code(optional): Custom short codedescription(optional): Description informationexpire_at(optional): Expiration time
Example:
2. get_url_info
Get detailed information about a short URL
Parameters:
id(required): Short URL ID
Example:
3. list_short_urls
List short URLs with pagination and search support
Parameters:
page(optional): Page number, default 1page_size(optional): Items per page, default 10domain(optional): Domain filterkeyword(optional): Search keyword
Example:
4. delete_short_url
Delete a short URL
Parameters:
id(required): Short URL ID
Example:
5. batch_create_short_urls
Batch create short URLs
Parameters:
urls(required): URL array (maximum 50)domain(required): Short URL domain
Example:
6. list_domains
Get list of all available domains
Parameters: None required
Example:
Return Information:
Domain basic information: ID, domain, protocol
Website information: website name, registration information
Configuration information: activation status, parameter pass-through settings
Statistics information: total count, active count, inactive count
ποΈ Project Structure
π§ Development Guide
Available Scripts
Adding New Tools
Create a new tool file in the
src/mcp/tools/directoryImplement the tool object, including
name,description,inputSchema, andhandlerRegister the new tool in
src/mcp/server.js
Error Handling
The project uses a unified error handling mechanism:
ErrorHandler.asyncWrapper(): Wrap async functions, automatically handle errorsCustomError: Custom error base classValidationError: Parameter validation errorNetworkError: Network request error
π API Specification
Response Format
All API responses follow a unified format:
Error Response
π Configuration Instructions
Environment Variables
Variable Name | Description | Default Value | Required |
| Remote server address | - | β |
| API key | - | β |
| API version | v1 | β |
| Request timeout (ms) | 10000 | β |
| Maximum retry count | 3 | β |
| Log level | info | β |
Domain Configuration
Ensure that the domains used are correctly configured in the remote short URL service.
π¨ Troubleshooting
Common Issues
Connection Failed
Check
REMOTE_BASE_URLandREMOTE_API_KEYconfigurationConfirm network connection is normal
Verify remote service status
Authentication Failed
Confirm API key is correct
Check if the key has sufficient permissions
Parameter Validation Failed
Check if parameter format is correct
Confirm all required parameters are provided
Log Debugging
Set log level to debug to view detailed information:
π€ Contributing Guide
Fork the project
Create feature branch (
git checkout -b feature/AmazingFeature)Commit changes (
git commit -m 'Add some AmazingFeature')Push to branch (
git push origin feature/AmazingFeature)Open a Pull Request
π License
This project is open source under the MIT License - see the LICENSE file for details.
π Support
If you encounter problems or have suggestions, please:
Check the Troubleshooting section
Search existing Issues
Create a new Issue describing the problem
π Version History
v1.0.0 - Initial version
Basic short URL management functionality
MCP protocol support
Complete error handling mechanism