This server provides programmatic access to search and download torrents from French providers (LaCale and YggTorrent). It offers:
Core Tools:
search_torrents- Advanced search with intelligent query optimization for TV shows (episodes, seasons, series) and movies. Results are automatically filtered and ranked by quality (1080p preferred), codec efficiency (x265/HEVC), health (seeders/leechers), and size. Returns top 3 recommendations with detailed metadata and reasoning.get_torrent- Retrieve magnet link or torrent file path by IDget_magnet_link- Extract magnet link for a specific torrentdownload_torrent_file- Download .torrent file to a specified directory
Deployment Options:
MCP server with multiple transports (stdio, SSE, streamable-http)
FastAPI HTTP server with REST endpoints
Docker container (bypasses DNS issues)
Python wrapper library for direct integration
Configuration: Requires environment variables for provider authentication (YggTorrent username/password, LaCale passkey). Compatible with MCP clients like Windsurf.
FR Torrent MCP Server & Wrapper
This repository provides a Python wrapper for the FR Torrent websites and an MCP (Model Context Protocol) server to interact with them programmatically. This allows for easy integration of FR Torrent functionalities into other applications or services.
Quickstart
How to use it with MCP Clients > Run it with Docker to bypass common DNS issues
Related MCP server: Torrent Search MCP Server
Table of Contents
Features
API aggregator for multiple French torrent providers:
LaCale: Native support.
YggTorrent: Support via local bridge (e.g., YggAPI).
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 across all providers
Get torrent
Get magnet link
Download torrent file
Setup
Prerequisites
Active account (for YggTorrent).
Passkey (for LaCale).
Python 3.10+ (required for PyPI install).
uv(for local development)Docker and Docker Compose (for Docker setup)
Configuration
The application requires configuration for the supported providers.
Set Environment Variables: The application reads configuration from environment variables. The recommended way is by creating a
.envfile in your project's root directory.
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:
Create a
.envfile in the directory where you'll run the application and add your configuration:
Run the MCP server (default: stdio):
For Local Development
This method is for contributors who want to modify the source code.
Using uv:
Clone the repository:
Install dependencies using
uv:
Create your configuration file by copying the example and add your passkey:
Run the MCP server (default: stdio):
For 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):
Create your configuration file by copying the example and add your passkey:
Build and run the container using Docker Compose (default port: 8000):
Access container logs:
Usage
As Python Wrapper
As MCP Server
As FastAPI Server
This project also includes a FastAPI server as an alternative way to interact with the FR Torrent 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:
--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:
GET /: Health check endpoint. Returns{"status": "ok"}.POST /torrent/search: Search for torrents (params:query,max_items).GET /torrent/{torrent_id}: Get torrent (returns magnet link or .torrent file).GET /torrent/{torrent_id}/magnet: Get magnet link for a torrent.GET /torrent/{torrent_id}/file: Download .torrent file.GET /docs: Interactive API documentation (Swagger UI).GET /redoc: Alternative API documentation (ReDoc).
Environment variables are configured the same way as for the MCP server.
Via MCP Clients
Usable with any MCP-compatible client. Available tools:
search_torrents: Search for torrents.get_torrent: Get torrent data (magnet or file).get_magnet_link: Get the magnet link for a torrent.download_torrent_file: Download the .torrent file for a torrent.
Example with Windsurf
Configuration:
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.