putio-mcp-server

putio-mcp-server

For interacting with put.io, an MCP (presumably meaning "Media Center Platform" or similar) server could be implemented in a few ways. Here are a few options, ranging from simple to more complex, along with considerations for each: **1. Simple Scripting with API Calls (Python, Bash, etc.)** * **Concept:** Use a scripting language like Python or Bash to directly interact with the put.io API. This is the most basic approach. * **How it Works:** * Use `curl`, `wget`, or a Python library like `requests` to make HTTP requests to the put.io API endpoints. * Authenticate using your put.io API key (obtained from your put.io account settings). * Implement functions to: * List files/folders. * Start downloads (by adding torrents or URLs). * Check download status. * Potentially stream files (if your MCP supports direct URL playback). * Expose these functions through a simple command-line interface or a very basic web interface. * **Pros:** * Simple to set up. * Good for basic automation. * Low resource usage. * **Cons:** * Requires scripting knowledge. * Limited features. * Not very user-friendly. * No built-in media management. * **Example (Python):** ```python import requests import json API_KEY = "YOUR_PUTIO_API_KEY" BASE_URL = "https://api.put.io/v2" def list_files(parent_id=0): url = f"{BASE_URL}/files/list?oauth_token={API_KEY}&parent_id={parent_id}" response = requests.get(url) response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx) data = response.json() return data['files'] def add_transfer(url): url = f"{BASE_URL}/transfers/add?oauth_token={API_KEY}&url={url}" response = requests.post(url) response.raise_for_status() data = response.json() return data # Example usage files = list_files() for file in files: print(f"{file['name']} (ID: {file['id']})") # Add a transfer transfer_result = add_transfer("magnet:?xt=urn:btih:YOUR_MAGNET_LINK") print(f"Transfer added: {transfer_result}") ``` **2. Integration with Existing Media Server Software (Plex, Emby, Jellyfin)** * **Concept:** Use the API of an existing media server to manage and stream files downloaded by put.io. This is a more robust and user-friendly approach. * **How it Works:** * **Download Automation:** Use a script (like the one above, or a more sophisticated tool like Sonarr/Radarr) to automatically download files to a specific folder on your server. * **Media Server Configuration:** Configure Plex, Emby, or Jellyfin to monitor that folder. They will automatically scan and index the new files. * **Streaming:** Use the Plex/Emby/Jellyfin client apps to browse and stream your media. * **Pros:** * Excellent user experience. * Automatic media organization and metadata retrieval. * Streaming to a wide range of devices. * **Cons:** * Requires setting up and configuring a media server. * More resource intensive than a simple script. * Relies on the media server's API and functionality. * **Key Tools:** * **Plex:** Popular, proprietary media server. * **Emby:** Open-source media server with a premium option. * **Jellyfin:** Completely free and open-source media server. * **Sonarr/Radarr:** Tools for automating TV show and movie downloads. They can be configured to use put.io as a download client. **3. Custom Web Application (Flask, Django, Node.js)** * **Concept:** Build a custom web application that provides a user interface for interacting with the put.io API and managing your media. * **How it Works:** * **Backend:** Use a framework like Flask (Python), Django (Python), or Node.js (JavaScript) to create a web server. * **API Integration:** Use the put.io API to implement features like: * Browsing files. * Adding transfers. * Monitoring transfer status. * Deleting files. * **Frontend:** Create a user interface using HTML, CSS, and JavaScript (potentially with a framework like React, Vue.js, or Angular). * **Media Streaming:** Implement direct streaming from put.io (more complex) or rely on downloading files to a local directory and using a media server (like Plex) for streaming. * **Pros:** * Highly customizable. * Can integrate with other services. * Can provide a unique user experience. * **Cons:** * Requires significant development effort. * More complex to set up and maintain. * **Example (Conceptual Flask):** ```python from flask import Flask, render_template, request, redirect, url_for import requests import json app = Flask(__name__) API_KEY = "YOUR_PUTIO_API_KEY" BASE_URL = "https://api.put.io/v2" def list_files(parent_id=0): # ... (same as before) ... def add_transfer(url): # ... (same as before) ... @app.route("/") def index(): files = list_files() return render_template("index.html", files=files) @app.route("/add_transfer", methods=["POST"]) def add_transfer_route(): url = request.form["url"] add_transfer(url) return redirect(url_for("index")) if __name__ == "__main__": app.run(debug=True) ``` **Choosing the Right Approach:** * **Simple Scripting:** Best for basic automation and command-line users. * **Media Server Integration:** Best for a seamless media streaming experience. * **Custom Web Application:** Best for maximum flexibility and control, but requires the most development effort. **Important Considerations:** * **API Key Security:** Never hardcode your API key directly into your code if you plan to share it. Use environment variables or a configuration file. * **Error Handling:** Implement robust error handling to gracefully handle API errors and network issues. * **Rate Limiting:** Be aware of put.io's API rate limits and implement appropriate throttling in your code. * **Authentication:** For a web application, implement proper user authentication and authorization. * **Storage:** Consider where you will store downloaded files if you are not streaming directly from put.io. * **Legal:** Ensure you are using put.io and downloading content legally. **Translation to Chinese:** Here's a translation of the above information into Chinese: **与 put.io 交互的 MCP 服务器** 为了与 put.io 交互,可以采用几种方法来实现 MCP(可能意味着“媒体中心平台”或类似的东西)服务器。 以下是一些选项,从简单到复杂,以及每个选项的注意事项: **1. 简单的脚本编写与 API 调用 (Python, Bash 等)** * **概念:** 使用像 Python 或 Bash 这样的脚本语言直接与 put.io API 交互。 这是最基本的方法。 * **工作原理:** * 使用 `curl`、`wget` 或像 `requests` 这样的 Python 库向 put.io API 端点发出 HTTP 请求。 * 使用您的 put.io API 密钥进行身份验证(从您的 put.io 帐户设置中获取)。 * 实现以下功能的函数: * 列出文件/文件夹。 * 启动下载(通过添加种子或 URL)。 * 检查下载状态。 * 可能流式传输文件(如果您的 MCP 支持直接 URL 播放)。 * 通过简单的命令行界面或非常基本的 Web 界面公开这些功能。 * **优点:** * 设置简单。 * 适用于基本自动化。 * 资源占用低。 * **缺点:** * 需要脚本编写知识。 * 功能有限。 * 不是很用户友好。 * 没有内置的媒体管理。 * **示例 (Python):** ```python import requests import json API_KEY = "YOUR_PUTIO_API_KEY" BASE_URL = "https://api.put.io/v2" def list_files(parent_id=0): url = f"{BASE_URL}/files/list?oauth_token={API_KEY}&parent_id={parent_id}" response = requests.get(url) response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx) data = response.json() return data['files'] def add_transfer(url): url = f"{BASE_URL}/transfers/add?oauth_token={API_KEY}&url={url}" response = requests.post(url) response.raise_for_status() data = response.json() return data # 示例用法 files = list_files() for file in files: print(f"{file['name']} (ID: {file['id']})") # 添加一个传输 transfer_result = add_transfer("magnet:?xt=urn:btih:YOUR_MAGNET_LINK") print(f"传输已添加: {transfer_result}") ``` **2. 与现有媒体服务器软件集成 (Plex, Emby, Jellyfin)** * **概念:** 使用现有媒体服务器的 API 来管理和流式传输 put.io 下载的文件。 这是一种更强大且用户友好的方法。 * **工作原理:** * **下载自动化:** 使用脚本(如上面的脚本,或更复杂的工具,如 Sonarr/Radarr)自动将文件下载到服务器上的特定文件夹。 * **媒体服务器配置:** 配置 Plex、Emby 或 Jellyfin 来监视该文件夹。 它们将自动扫描和索引新文件。 * **流式传输:** 使用 Plex/Emby/Jellyfin 客户端应用程序浏览和流式传输您的媒体。 * **优点:** * 出色的用户体验。 * 自动媒体组织和元数据检索。 * 流式传输到各种设备。 * **缺点:** * 需要设置和配置媒体服务器。 * 比简单的脚本更消耗资源。 * 依赖于媒体服务器的 API 和功能。 * **关键工具:** * **Plex:** 流行的专有媒体服务器。 * **Emby:** 具有高级选项的开源媒体服务器。 * **Jellyfin:** 完全免费和开源的媒体服务器。 * **Sonarr/Radarr:** 用于自动化电视节目和电影下载的工具。 可以配置它们以使用 put.io 作为下载客户端。 **3. 自定义 Web 应用程序 (Flask, Django, Node.js)** * **概念:** 构建一个自定义 Web 应用程序,该应用程序提供一个用户界面,用于与 put.io API 交互并管理您的媒体。 * **工作原理:** * **后端:** 使用像 Flask (Python)、Django (Python) 或 Node.js (JavaScript) 这样的框架来创建 Web 服务器。 * **API 集成:** 使用 put.io API 来实现以下功能: * 浏览文件。 * 添加传输。 * 监控传输状态。 * 删除文件。 * **前端:** 使用 HTML、CSS 和 JavaScript(可能使用像 React、Vue.js 或 Angular 这样的框架)创建一个用户界面。 * **媒体流式传输:** 实现从 put.io 的直接流式传输(更复杂)或依赖于将文件下载到本地目录并使用媒体服务器(如 Plex)进行流式传输。 * **优点:** * 高度可定制。 * 可以与其他服务集成。 * 可以提供独特的用户体验。 * **缺点:** * 需要大量的开发工作。 * 设置和维护更复杂。 * **示例 (概念性 Flask):** ```python from flask import Flask, render_template, request, redirect, url_for import requests import json app = Flask(__name__) API_KEY = "YOUR_PUTIO_API_KEY" BASE_URL = "https://api.put.io/v2" def list_files(parent_id=0): # ... (与之前相同) ... def add_transfer(url): # ... (与之前相同) ... @app.route("/") def index(): files = list_files() return render_template("index.html", files=files) @app.route("/add_transfer", methods=["POST"]) def add_transfer_route(): url = request.form["url"] add_transfer(url) return redirect(url_for("index")) if __name__ == "__main__": app.run(debug=True) ``` **选择正确的方法:** * **简单脚本编写:** 最适合基本自动化和命令行用户。 * **媒体服务器集成:** 最适合无缝的媒体流式传输体验。 * **自定义 Web 应用程序:** 最适合最大的灵活性和控制,但需要最多的开发工作。 **重要注意事项:** * **API 密钥安全:** 如果您计划共享您的代码,切勿将您的 API 密钥直接硬编码到您的代码中。 使用环境变量或配置文件。 * **错误处理:** 实施强大的错误处理,以优雅地处理 API 错误和网络问题。 * **速率限制:** 请注意 put.io 的 API 速率限制,并在您的代码中实施适当的限制。 * **身份验证:** 对于 Web 应用程序,实施适当的用户身份验证和授权。 * **存储:** 如果您不直接从 put.io 流式传输,请考虑将下载的文件存储在哪里。 * **法律:** 确保您合法地使用 put.io 并下载内容。 This translation should be helpful. Remember to replace `"YOUR_PUTIO_API_KEY"` and `"magnet:?xt=urn:btih:YOUR_MAGNET_LINK"` with your actual API key and magnet link. Good luck!

putdotio

开发者工具
访问服务器

README

putio-mcp-server

用于与 put.io 交互的 MCP 服务器

功能

  • 列出活跃的传输
  • 通过 URL 或磁力链接添加新的传输
  • 取消现有的传输
  • 获取已完成传输的浏览器链接

前提条件

设置

将以下配置放入您的 claude_desktop_config.json 中。

不要忘记将 <your-putio-api-token> 替换为您自己的 API 令牌。

{
  "mcpServers": {
    "putio": {
      "command": "uvx",
      "args": [
        "putio-mcp-server"
      ],
      "env": {
        "PUTIO_TOKEN": "<your-putio-api-token>"
      }
    }
  }
}

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。

精选
本地
JavaScript
MCP Package Docs Server

MCP Package Docs Server

促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。

精选
本地
TypeScript
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript
Linear MCP Server

Linear MCP Server

一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

精选
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Curri MCP Server

Curri MCP Server

通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。

官方
本地
JavaScript