mcp-shlink
Enables AI assistants to interact with a Shlink URL shortening instance, allowing creation, listing, retrieval, and deletion of short URLs, as well as tag management.
README
mcp-shlink
A Model Context Protocol (MCP) server for Shlink link shortening service. This server exposes Shlink's URL shortening, management, and tagging capabilities as MCP tools for AI assistants.
Features
- Create shortened URLs with custom slugs, tags, and expiration
- List all shortened URLs with pagination info
- Get details of specific URLs by short code
- Delete shortened URLs
- List and manage tags
- Full type safety with Pydantic models
- Built with the official MCP Python SDK
Requirements
- Python >= 3.10
- A Shlink instance with API access
Installation
pip install mcp-shlink
Configuration
Set these environment variables before running the server:
| Variable | Description | Required |
|---|---|---|
SHLINK_BASE_URL |
Your Shlink instance base URL (e.g., https://shlink.example.com) |
Yes |
SHLINK_API_KEY |
Your Shlink API key | Yes |
Generate an API key in Shlink:
shlink api-key:generate --name=my_api_key
Usage
Running as a standalone MCP server
SHLINK_BASE_URL=https://shlink.example.com SHLINK_API_KEY=your-key python -m mcp_shlink.server
Installing into Claude Desktop
uv run mcp install src/mcp_shlink/server.py --name "shlink"
Running with MCP Inspector
SHLINK_BASE_URL=https://shlink.example.com SHLINK_API_KEY=your-key uv run mcp dev src/mcp_shlink/server.py
Available Tools
| Tool | Description |
|---|---|
create_short_url |
Create a new shortened URL |
list_short_urls |
List all shortened URLs |
get_short_url |
Get details of a URL by short code |
delete_short_url |
Delete a shortened URL |
list_tags |
List all tags |
Development
# Clone the repository
git clone https://github.com/magnus919/mcp-shlink
cd mcp-shlink
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Lint and format
ruff check .
ruff format .
# Type check
mypy src/
# Full verification
ruff check . && ruff format . --check && mypy src/ && pytest
Project Structure
src/mcp_shlink/
├── server.py # FastMCP server entry point
├── client.py # Shlink API client
├── tools.py # MCP tool definitions
└── models.py # Pydantic models for API requests/responses
tests/
├── test_tools.py # Unit tests for MCP tools
└── test_client.py # Unit tests for Shlink client
License
Apache 2.0. See LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.