YggTorrent MCP server

Provides secure access to YggTorrent through an unofficial API wrapper, enabling torrent searching with category filtering, detailed metadata retrieval, and magnet link generation with automatic passkey injection for authenticated downloads.
Back to servers
Setup instructions
Provider
philogicae
Release date
Jun 06, 2025
Stats
11 stars

YggTorrent MCP Server is a Python wrapper that allows you to interact programmatically with the YggTorrent website, providing functionalities such as searching torrents, retrieving torrent details, and downloading torrent files through a standardized MCP (Model Context Protocol) interface.

Installation Options

Install from PyPI (Recommended)

  1. Install the package from PyPI:
pip install ygg-torrent-mcp
  1. Create a .env file in your working directory with your YggTorrent passkey:
YGG_PASSKEY=your_passkey_here
  1. Run the MCP server:
python -m ygg_torrent

Docker Installation

Using Docker helps bypass common DNS issues:

  1. Clone the repository:
git clone https://github.com/philogicae/ygg-torrent-mcp.git
cd ygg-torrent-mcp
  1. Create configuration file with your passkey:
cp .env.example .env
  1. Edit the .env file to add your passkey

  2. Build and run with Docker Compose:

docker-compose -f docker/compose.yaml up --build

Usage Examples

Python Wrapper

You can use the YggTorrent wrapper directly in your Python code:

from ygg_torrent import ygg_api

results = ygg_api.search_torrents('ubuntu')
for torrent in results:
    print(f"{torrent.filename} | {torrent.size} | {torrent.seeders} SE | {torrent.leechers} LE | {torrent.downloads} DL | {torrent.date}")

MCP Server

Run as an MCP server with different transport options:

from ygg_torrent import ygg_mcp

ygg_mcp.run(transport="sse")

FastAPI Server

For direct API calls or testing:

# Development mode
python -m ygg_torrent --fastapi

# Production mode
uvicorn ygg_torrent.fastapi_server:app

The FastAPI server exposes endpoints at http://<host>:<port> with interactive documentation at /docs.

Using with MCP Clients

The MCP server provides these tools:

  • search_torrents
  • get_torrent_details
  • get_magnet_link
  • download_torrent_file

Windsurf Client Configuration

Configure Windsurf to connect to the YggTorrent MCP server:

{
  "mcpServers": {
    "mcp-ygg-torrent": {
      "command": "uvx",
      "args": ["ygg-torrent-mcp"],
      "env": { "YGG_PASSKEY": "your_passkey_here" }
    }
  }
}

Or with SSE transport (requires separate installation):

{
  "mcpServers": {
    "mcp-ygg-torrent": {
      "serverUrl": "http://127.0.0.1:8000/sse"
    }
  }
}

Available Features

  • Search for torrents on YggTorrent
  • Get details for specific torrents
  • Retrieve magnet links
  • Download torrent files
  • Get torrent categories

Your YggTorrent passkey is injected locally into torrent files and magnet links, ensuring it's not exposed externally.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "ygg-torrent-mcp" '{"command":"uvx","args":["ygg-torrent-mcp"],"env":{"YGG_PASSKEY":"your_passkey_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "ygg-torrent-mcp": {
            "command": "uvx",
            "args": [
                "ygg-torrent-mcp"
            ],
            "env": {
                "YGG_PASSKEY": "your_passkey_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "ygg-torrent-mcp": {
            "command": "uvx",
            "args": [
                "ygg-torrent-mcp"
            ],
            "env": {
                "YGG_PASSKEY": "your_passkey_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later