Navigation
MCP URL Shortener: Secure Links & Seamless Engagement - MCP Implementation

MCP URL Shortener: Secure Links & Seamless Engagement

Effortlessly shorten URLs with MCP’s CleanURI server—generate pristine, secure links for seamless digital engagement!

Developer Tools
4.0(66 reviews)
99 saves
46 comments

This tool saved users approximately 11166 hours last month!

About MCP URL Shortener

What is MCP URL Shortener: Secure Links & Seamless Engagement?

MCP URL Shortener is a tool designed to shorten URLs securely using the CleanURI API, integrated as a FastMCP server. It simplifies URL management while ensuring robust error handling and secure link distribution. Ideal for developers and automation workflows, this tool runs via standard input/output (stdio) for seamless integration with AI agents or tool-based systems.

How to Use MCP URL Shortener: Secure Links & Seamless Engagement?

  1. Install Dependencies: Ensure Python 3.10+, httpx, and fastmcp are installed.
  2. Choose Your Setup:
    • Use npx -y @smithery/cli install @Talismanic/cleanuri-url-shortener-mcp --client claude for automated Smithery installation.
    • Or manually install via uv add httpx 'mcp[cli]'.
    • Alternatively, build with Docker using docker build -t url-shortener ..
  3. Run the Tool: Execute uv run main.py for local use or docker run for containerized setups.
  4. Integrate with Claude Desktop: Configure via JSON config files specifying commands for local CLI or Docker execution.

MCP URL Shortener Features

Key Features of MCP URL Shortener: Secure Links & Seamless Engagement?

  • API-Driven Shortening: Leverages CleanURI’s reliable URL shortening service.
  • FastMCP Compatibility: Exposes URL shortening as a callable tool via the FastMCP framework.
  • Reliable Error Handling: Built-in validation and error responses to ensure smooth operations.
  • Flexible Deployment: Supports stdio transport for easy integration into agent systems or CI/CD pipelines.

Use Cases of MCP URL Shortener: Secure Links & Seamless Engagement?

  • Social Media Management: Shrink lengthy URLs for cleaner social media posts.
  • Bot Automation: Embed short URLs dynamically in chatbots or AI-driven workflows.
  • Security-Centric Workflows: Generate trackable links for campaigns while maintaining user privacy.
  • API Integration: Seamlessly plug into existing apps via FastMCP’s tool-based architecture.

MCP URL Shortener FAQ

FAQ from MCP URL Shortener: Secure Links & Seamless Engagement?

Is this tool secure?

Yes. It uses CleanURI’s trusted API and includes error validation to prevent malformed inputs. Links are shortened without exposing sensitive metadata.

Does it work with Claude Desktop?

Absolutely. Follow the JSON config steps to link the tool with your agent environment via FastMCP.

Can I run it without Docker?

Yes. Local execution via Python and uv (MCP CLI) is fully supported.

What if the API is down?

The tool returns clear error codes, allowing your system to handle failures gracefully without crashing workflows.

Where can I report issues?

Reach out via the Smithery project page or open an issue on GitHub.

Content

URL Shortener MCP Tool

smithery badge

URL Shortener MCP server

This project provides a simple URL shortening tool using the CleanURI API and is designed to run as a FastMCP server tool.

✨ Features

  • Shortens any given URL using the CleanURI API.
  • Exposes the functionality as a tool via FastMCP.
  • Includes proper error handling and response validation.
  • Designed to run via stdio transport for integration with agent or tool-based systems.

🚀 Usage

1. Requirements

  • Python 3.10+
  • httpx
  • fastmcp

2. Installation

Installing via Smithery

To install URL Shortener Tool for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Talismanic/cleanuri-url-shortener-mcp --client claude

Manual Installation

uv add httpx 'mcp[cli]'

Docker Installation:

docker build -t url-shortener .

3. Running

uv run main.py

For docker based use, we dont need to do anything here.

4. Adding in Claude Desktop

With the uv

{
  "mcpServers": {
    "url-shortener": {
      "command": "/Users/{userName}/.local/bin/uv",
      "args": [
        "--directory",
        "{path_to_repo}/cleanuri-url-shortener-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

With Docker

{
  "mcpServers": {
    "url-shortener": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "-e",
        "DOCKER_CONTAINER=true",
        "url-shortener"
      ]
    }
  }
}

Related MCP Servers & Clients