YggTorrent MCP Server
This server enables programmatic interaction with YggTorrent through a standardized API interface. You can:
Search for torrents using keywords, with options for pagination, ordering, and category filters
Retrieve detailed information about a specific torrent by its ID, optionally including the magnet link
Obtain the magnet link for a specific torrent by its ID
Download the
.torrentfile for a specific torrent to a specified output directory
Provides containerized deployment of the YggTorrent MCP server with Docker and Docker Compose for easy setup and isolation.
Supports configuration through environment variables using .env files for storing sensitive information like the YggTorrent passkey.
Enables cloning the YggTorrent MCP repository directly from GitHub for local installation and development.
Allows installation of the YggTorrent MCP package directly via pip from the Python Package Index.
Supports direct integration with Python applications through a wrapper library that can be imported and used programmatically.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YggTorrent MCP Serversearch for the latest Marvel movies"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YggTorrent MCP Server & Wrapper
This repository provides a Python wrapper for the YggTorrent website and an MCP (Model Context Protocol) server to interact with it programmatically. This allows for easy integration of YggTorrent functionalities into other applications or services.
⚠️ DEPRECATED - This repository is no longer maintained
Please use one of the following alternatives instead:
Quickstart
How to use it with MCP Clients > Run it with Docker to bypass common DNS issues
Related MCP server: MCP Builder
Table of Contents
Features
API wrapper for YggAPI, an unofficial API for YggTorrent
Your Ygg passkey is injected locally into the torrent file/magnet link, ensuring it's not exposed externally
MCP server interface for standardized communication (stdio, sse, streamable-http)
FastAPI server interface for alternative HTTP access (e.g., for direct API calls or testing)
Tools:
Search for torrents on YggTorrent
Get details for a specific torrent
Retrieve magnet links
Retrieve torrent files
Retrieve torrent categories
Setup
Prerequisites
An active YggTorrent account and passkey.
Python 3.10+ (required for PyPI install).
uv(for local development)Docker and Docker Compose (for Docker setup)
Configuration
This application requires your YggTorrent passkey to interact with the API.
Find your Passkey: On the YggTorrent website, navigate to
Mon compte->PASSKEYfield.Set Environment Variable: The application reads the passkey from the
YGG_PASSKEYenvironment variable. The recommended way to set this is by creating a.envfile in your project's root directory. The application will load it automatically.
Installation
Choose one of the following installation methods.
Install from PyPI (Recommended)
This method is best for using the package as a library or running the server without modifying the code.
Install the package from PyPI:
pip install ygg-torrent-mcpCreate a
.envfile in the directory where you'll run the application and add your passkey:
YGG_PASSKEY=your_passkey_hereRun the MCP server (default: stdio):
python -m ygg_torrentFor Local Development
This method is for contributors who want to modify the source code.
Using uv:
Clone the repository:
git clone https://github.com/philogicae/ygg-torrent-mcp.git
cd ygg-torrent-mcpInstall dependencies using
uv:
uv sync --lockedCreate your configuration file by copying the example and add your passkey:
cp .env.example .envRun the MCP server (default: stdio):
uv run -m ygg_torrentFor Docker
This method uses Docker to run the server in a container.
compose.yaml is configured to bypass DNS issues (using quad9 DNS).
Clone the repository (if you haven't already):
git clone https://github.com/philogicae/ygg-torrent-mcp.git
cd ygg-torrent-mcpCreate your configuration file by copying the example and add your passkey:
cp .env.example .envBuild and run the container using Docker Compose (default port: 8000):
docker compose up --build -dAccess container logs:
docker logs ygg-torrent-mcp -fUsage
As Python Wrapper
from ygg_torrent import ygg_api
results = ygg_api.search_torrents('...')
for torrent in results:
print(f"{torrent.filename} | {torrent.size} | {torrent.seeders} SE | {torrent.leechers} LE | {torrent.downloads} DL | {torrent.date}")As MCP Server
from ygg_torrent import ygg_mcp
ygg_mcp.run(transport="sse")As FastAPI Server
This project also includes a FastAPI server as an alternative way to interact with the YggTorrent functionalities via a standard HTTP API. This can be useful for direct API calls, integration with other web services, or for testing purposes.
Running the FastAPI Server:
# With Python
python -m ygg_torrent --mode fastapi
# With uv
uv run -m ygg_torrent --mode fastapi--host <host>: Default:0.0.0.0.--port <port>: Default:8000.--reload: Enables auto-reloading when code changes (useful for development).--workers <workers>: Default:1.
The FastAPI server will then be accessible at http://<host>:<port>
Available Endpoints: The FastAPI server exposes similar functionalities to the MCP server. Key endpoints include:
/: A simple health check endpoint. Returns{"status": "ok"}./docs: Interactive API documentation (Swagger UI)./redoc: Alternative API documentation (ReDoc).
Environment variables (like YGG_PASSKEY) are configured the same way as for the MCP server (via an .env file in the project root).
Via MCP Clients
Usable with any MCP-compatible client. Available tools:
search_torrents: Search for torrents.get_torrent_details: Get details of a specific torrent.get_magnet_link: Get the magnet link for a torrent.download_torrent_file: Download the .torrent file for a torrent.
Example with Windsurf
Configuration:
{
"mcpServers": {
...
# with stdio (only requires uv installed)
"ygg-torrent-mcp": {
"command": "uvx",
"args": ["ygg-torrent-mcp"],
"env": { "YGG_PASSKEY": "your_passkey_here" }
}
# with sse transport (requires installation)
"ygg-torrent-mcp": {
"serverUrl": "http://127.0.0.1:8000/sse"
}
# with streamable-http transport (requires installation)
"ygg-torrent-mcp": {
"serverUrl": "http://127.0.0.1:8000/mcp" # not yet supported by every client
}
...
}
}Changelog
See CHANGELOG.md for a history of changes to this project.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
4 toolsdownload_torrent_fileC
Download the torrent file.
| Name | Required | Description | Default |
|---|---|---|---|
| output_dir | Yes | ||
| torrent_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states 'Download' which implies a write operation to local storage, but doesn't disclose behavioral traits like file overwriting, permissions needed, network usage, or error handling. This leaves significant gaps for a tool that likely involves I/O and external resources.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for the simple action described, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, 0% schema coverage, no output schema, and 2 parameters, the description is incomplete. It lacks details on what the tool does beyond the basic action, such as return values, error cases, or how it interacts with siblings. For a download operation, this leaves too much unspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter details. The description adds no meaning beyond the tool name; it doesn't explain what 'torrent_id' or 'output_dir' represent, their formats, or constraints. For 2 undocumented parameters, this is inadequate compensation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the action ('Download') and resource ('the torrent file'), which is clear but vague. It doesn't specify what distinguishes this from sibling tools like 'get_magnet_link' or 'get_torrent_details', which might also involve torrent file access. The purpose is understandable but lacks differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_magnet_link' for magnet links or 'get_torrent_details' for metadata. There's no mention of prerequisites, such as needing a valid torrent ID or output directory, or any context for selection among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_magnet_linkC
Get the magnet link for a specific torrent.
| Name | Required | Description | Default |
|---|---|---|---|
| torrent_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] the magnet link', implying a read-only operation, but doesn't disclose any behavioral traits such as error conditions, rate limits, authentication needs, or what happens if the torrent_id is invalid. The description is minimal and lacks essential context for safe and effective use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every word earns its place in conveying the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (a read operation with one parameter) and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects, parameter semantics, or return values, leaving significant gaps for the agent. The description alone is insufficient for reliable tool invocation without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no meaning beyond the input schema, which has 0% schema description coverage. It doesn't explain what 'torrent_id' represents, its format, or where to obtain it. With one parameter and low schema coverage, the description fails to compensate, but since there's only one parameter, the baseline is adjusted to 3 as the simplicity reduces the need for extensive param info.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and the resource 'magnet link for a specific torrent', making the purpose unambiguous. It distinguishes from siblings like 'download_torrent_file' (which downloads a file) and 'get_torrent_details' (which provides broader details), though it doesn't explicitly name these alternatives. The description is specific but lacks explicit sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_torrent_details' or 'download_torrent_file'. It implies usage for retrieving magnet links but offers no context on prerequisites, exclusions, or specific scenarios where this tool is preferred over others. This leaves the agent without clear usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_torrent_detailsC
Get details about a specific torrent.
| Name | Required | Description | Default |
|---|---|---|---|
| torrent_id | Yes | ||
| with_magnet_link | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), but doesn't cover aspects like authentication requirements, rate limits, error handling, or what details are included in the response. This leaves significant gaps for an agent to understand how to use it effectively.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, straightforward sentence with no unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is insufficient for a tool with 2 parameters. It doesn't explain what 'details' are returned, how to interpret the torrent ID, or the implications of the boolean parameter. For a tool that likely returns structured data, more context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The description mentions 'specific torrent' which hints at the 'torrent_id' parameter, but doesn't explain what this ID is or how to obtain it. It also doesn't address the 'with_magnet_link' parameter at all, leaving its purpose unclear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('details about a specific torrent'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_magnet_link' or 'search_torrents', which might also retrieve torrent information in different ways.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_magnet_link' or 'search_torrents'. It doesn't specify prerequisites, such as needing a torrent ID, or clarify use cases like retrieving metadata versus links.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_torrentsC
Search for torrent files.
| Name | Required | Description | Default |
|---|---|---|---|
| categories | No | ||
| limit | No | ||
| order_by | No | seeders | |
| page | No | ||
| per_page | No | ||
| query | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('Search') without any information about rate limits, authentication needs, pagination behavior (implied by parameters but not described), or what the search returns. This is inadequate for a tool with 6 parameters and no output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It's appropriately sized for a basic search tool, though this brevity contributes to the lack of detail in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (6 parameters, 0% schema coverage, no output schema, no annotations), the description is severely incomplete. It doesn't explain the search scope, result format, behavioral traits, or parameter usage, making it inadequate for an AI agent to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, meaning parameters like 'categories', 'order_by', 'limit', 'page', and 'per_page' are undocumented in the schema. The description adds no meaning beyond the schema—it doesn't explain what these parameters do, their formats, or examples. For a tool with 6 parameters, this is a significant gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the basic action ('Search for torrent files') which is clear but vague. It doesn't specify what kind of search (e.g., across which platforms, with what criteria) or how it differs from sibling tools like 'get_torrent_details'. The purpose is understandable but lacks specificity and differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'download_torrent_file' or 'get_torrent_details'. The description doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
download_torrent_file - First observed
get_magnet_link - First observed
get_torrent_details - First observed
search_torrents
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: search_torrents finds torrents, get_torrent_details retrieves metadata, get_magnet_link provides a magnet link, and download_torrent_file downloads the file. An agent can easily distinguish between these operations.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., search_torrents, get_torrent_details). The naming is predictable and readable throughout the set.
With 4 tools, the server is well-scoped for torrent operations, covering search, details retrieval, magnet links, and downloads. Each tool earns its place without being overly sparse or bloated.
The toolset provides complete coverage for torrent interaction: search, view details, get magnet links, and download files. There are no obvious gaps in the workflow for this domain.
Related MCP Connectors
A simple MCP server built with FastMCP and python
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Related MCP Servers
- FlicenseCqualityDmaintenanceThis is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.1-
- AlicenseBqualityFmaintenanceA Python-based server that helps users easily install and configure other MCP servers across different platforms.23MIT
- FlicenseAqualityFmaintenanceA Python-based MCP server that integrates with Plex Media Server API to search for movies and manage playlists in your Plex media library.96-
- AlicenseAqualityAmaintenanceA Python MCP server that allows programmatic interaction to find torrents programmatically on ThePirateBay, Nyaa and YggTorrent.6288 PyPI30PythonMIT