Skip to content

reklis/kutt-mcp

Repository files navigation

Kutt MCP Server

Docker Python 3.12+ FastMCP License: MIT

A Model Context Protocol (MCP) server that provides AI agents with the ability to shorten URLs using Kutt.it - the modern, open-source URL shortener.

┌─────────────────┐      ┌─────────────────┐      ┌─────────────────┐
│   AI Agent      │ ──── │   Kutt MCP      │ ──── │   Kutt.it API   │
│  (Claude, etc)  │ MCP  │   Server        │ HTTP │                 │
└─────────────────┘      └─────────────────┘      └─────────────────┘

Features

  • Full Kutt API Coverage - Create, list, update, and delete short links
  • Link Analytics - Get detailed statistics on link visits
  • Custom Domains - Manage your own branded short domains
  • Password Protection - Create secure, password-protected links
  • Link Expiration - Set automatic expiry times
  • n8n Compatible - Middleware handles extra args from n8n MCP client

Quick Start

Using Docker (Recommended)

docker run -d \
  -p 8000:8000 \
  -e KUTT_API_KEY=your-api-key \
  ghcr.io/OWNER/kutt-mcp:latest

Using Docker Compose

# Copy environment template
cp .env.example .env

# Edit .env with your API key
vim .env

# Start the server
docker compose up -d

Using uv (Local Development)

# Install dependencies
uv sync

# Set your API key
export KUTT_API_KEY=your-api-key

# Run the server
uv run python server.py

Configuration

Variable Required Default Description
KUTT_API_KEY Yes - Your Kutt.it API key
KUTT_BASE_URL No https://kutt.it/api/v2 Kutt API endpoint (for self-hosted)
MCP_HOST No 0.0.0.0 Server bind address
MCP_PORT No 8000 Server port

Get your API key from kutt.it/settings or your self-hosted instance.

Available Tools

Tool Description
health_check Check Kutt API health status
list_links List your shortened links with pagination
create_link Create a new short link
update_link Update an existing link
delete_link Delete a link
get_link_stats Get visit statistics for a link
create_domain Add a custom domain
delete_domain Remove a custom domain
get_user_info Get authenticated user details

Example: Create a Short Link

{
  "tool": "create_link",
  "arguments": {
    "target": "https://example.com/very/long/url",
    "customurl": "my-link",
    "description": "My awesome link",
    "expire_in": "7 days"
  }
}

Example: Get Link Statistics

{
  "tool": "get_link_stats",
  "arguments": {
    "link_id": "uuid-of-your-link"
  }
}

Connecting to MCP Clients

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "kutt": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

n8n

Use the MCP Client node with:

  • Transport: HTTP
  • URL: http://your-server:8000/mcp

Self-Hosted Kutt

If you're running your own Kutt instance, just point to your API:

KUTT_BASE_URL=https://your-kutt-instance.com/api/v2

Development

# Clone the repo
git clone https://github.com/OWNER/kutt-mcp.git
cd kutt-mcp

# Install dependencies
uv sync

# Run locally
uv run python server.py

License

MIT

About

Kutt api mcp wrapper for n8n

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors