mcpField
U
URL Shortener MCP Tool

URL Shortener MCP Tool

Local
github.com/TalismanicOther4Updated 68w ago

About URL Shortener MCP Tool

URL Shortener MCP Tool is a FastMCP server that shortens URLs through the CleanURI API. It is intended for agent- or tool-based systems and includes response validation and error handling.

Key features

  1. 01Shorten URLs through CleanURI
  2. 02Expose shortening as a FastMCP tool
  3. 03Validate responses
  4. 04Handle errors
  5. 05Run over stdio transport

Use cases

  1. 01Shorten a link during an agent workflow
  2. 02Provide URL shortening to a tool-based system

MCP support

It exposes URL shortening through a FastMCP tool for MCP clients, using stdio transport.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"cleanuri-url-shortener": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DOCKER_CONTAINER",
"url-shortener"
],
"env": {
"DOCKER_CONTAINER": "<DOCKER_CONTAINER>"
}
}
}
}
Run commanddocker run -i --rm -e DOCKER_CONTAINER url-shortener
Environment variables to set
DOCKER_CONTAINER

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ociurl-shortener

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MseeP.ai Security Assessment Badge

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"
      ]
    }
  }
}

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.