YOURLS-MCP acts as a personal bridge between Claude Desktop and a self-hosted YOURLS installation, allowing the AI to manage web links directly. In simple terms, it gives an LLM the ability to shorten long, messy URLs into neat, branded links without the user ever leaving the chat interface. By integrating this tool, anyone running their own URL shortening service can simply ask Claude to "make this link shorter" or "create a custom link for this page," and the AI handles the technical communication with the server instantly. Beyond basic shortening, this MCP server unlocks a suite of administrative tools for link management. It supports retrieving click statistics, expanding shortened links back to their original destinations, and checking global database health. For users focused on data, it features unique capabilities like duplicate URL handling—allowing multiple short links to point to the same destination—and a specialized tool for generating links pre-configured with Google Analytics UTM parameters for seamless marketing campaign tracking. For developers and system administrators, the tool is highly extensible, offering deep integration with popular YOURLS plugins. When the corresponding plugins are active, the AI can perform advanced operations such as updating existing destination URLs, changing keywords on the fly, and even generating QR codes for physical marketing materials. Because it supports both signature-based and password authentication through environment variables, it provides a secure way for developers to give LLMs controlled access to their private link infrastructure, turning a static database into a dynamic, AI-powered asset management system.
Category: CRM, ERP & E-commerce
Tags: analytics, link-management, marketing, url-shortener, yourls
bash # Clone the repository git clone https://github.com/kesslerio/yourls-mcp.git cd yourls-mcp # Install dependencies npm install~/Library/Application Support/Claude/config.json - Windows: %APPDATA%\Claude\config.json - Linux: ~/.config/Claude/config.json JSON Configuration: json { "mcpServers": { "yourls": { "command": "node", "args": [ "/full/path/to/yourls-mcp/yourls-mcp.js" ], "env": { "YOURLS_API_URL": "https://your-yourls-domain.com/yourls-api.php", "YOURLS_AUTH_METHOD": "signature", "YOURLS_SIGNATURE_TOKEN": "your-secret-signature-token" } } } } Environment Variables: | Variable | Description | Required | | --- | --- | --- | | YOURLS_API_URL | URL to your YOURLS API endpoint | Yes | | YOURLS_AUTH_METHOD | Authentication method (signature or password) | No (Default: signature) | | YOURLS_SIGNATURE_TOKEN | Secret token for signature-based auth | Yes (if using signature) | | YOURLS_USERNAME | Username for password-based auth | Yes (if using password) | | YOURLS_PASSWORD | Password for password-based auth | Yes (if using password) |url, keyword, title) * expand_url: Expands a short URL to the original long URL. (Params: shorturl) * url_stats: Gets statistics for a shortened URL. (Params: shorturl) * db_stats: Gets global statistics for the YOURLS instance. * create_custom_url: Creates a custom short URL with a specific keyword. (Params: url, keyword, title, bypass_shortshort, force_url_modification) * shorten_with_analytics: Shortens a URL with Google Analytics UTM parameters. (Params: url, source, medium, campaign, term, content, keyword, title)shorten_with_analytics tool, the user can describe their campaign once, and Claude will generate professional, branded short links for every platform required. Example: "Claude, I'm launching a 'Summer Sale' campaign for my product. Generate three branded short links for the URL `myshop.comproduct-page` with UTM parameters for Twitter, Facebook, and our Email Newsletter. Use keywords 'summer-tw', 'summer-fb', and 'summer-news'."
update_url and change_keyword tools, a developer can manage their YOURLS instance directly through the Claude sidebar. They can quickly redirect existing branded links to point to the latest resources without leaving their workflow. Example: "The documentation for our API has moved from v1.docs.com to v2.docs.com. Please update our short link `bysha.peapi-docs` to point to the new URL and keep the same title."
generate_qr_code tool allows Claude to create a shortened tracking link and immediately provide the QR code parameters. This ensures that every physical asset is automatically tracked via the user’s own YOURLS instance. Example: "Create a short URL for our event registration page `my-event.comregister-2025` with the keyword 'fest25'. Then, generate a high-resolution SVG QR code for it so I can put it on the printed invitations."
Part of MCP Servers