MyTube MCP Server

MyTube MCP Server

MCP server that enables LLMs to interact with MyTube video platform through its HTTP API, supporting video management, search, collections, subscriptions, and more with API key or admin session authentication.

Category
访问服务器

README

MyTube MCP Server

中文

mytube-mcp is a standalone Model Context Protocol server for MyTube. It translates MCP tools, resources, and prompts into authenticated calls to MyTube’s existing /api/* HTTP API. It does not access MyTube’s database or filesystem directly.

Quick start

Requirements: Node.js 20 or newer and a reachable MyTube 1.10.x server.

After this package is published to npm, the shortest installation is:

npx -y mytube-mcp

To run the public repository immediately from source:

git clone https://github.com/franklioxygen/mytube-mcp.git
cd mytube-mcp
npm install
npm run build
npm start

Set the configuration in the MCP client process environment. The recommended least-privilege setup uses an API key:

{
  "mcpServers": {
    "mytube": {
      "command": "npx",
      "args": ["-y", "mytube-mcp"],
      "env": {
        "MYTUBE_BASE_URL": "https://mytube.example.com",
        "MYTUBE_AUTH_MODE": "api-key",
        "MYTUBE_API_KEY": "replace-with-your-mytube-api-key"
      }
    }
  }
}

For collection management, subscriptions, queue control, metadata edits, or uploads, use admin-session mode:

{
  "mcpServers": {
    "mytube": {
      "command": "npx",
      "args": ["-y", "mytube-mcp"],
      "env": {
        "MYTUBE_BASE_URL": "https://mytube.example.com",
        "MYTUBE_AUTH_MODE": "admin-session",
        "MYTUBE_ADMIN_PASSWORD": "replace-with-your-admin-password"
      }
    }
  }
}

The server keeps admin cookies and CSRF tokens in memory only. If MyTube has password login disabled, admin-session mode detects owner mode and proceeds without a password; otherwise MYTUBE_ADMIN_PASSWORD is required.

What is available

API-key mode exposes only the routes MyTube currently marks allowApiKey: true: download_video, list_videos, get_video, list_collections, and get_system_version. The current MyTube backend does not allow API-key access to /api/search, so search_videos is intentionally admin-only even though the design document’s MVP appendix listed it in the API-key catalog.

Admin-session mode adds search, URL inspection, progress/history, queue control, library mutations, uploads, collections, subscriptions, continuous-download tasks, maintenance, cloud signed URLs, resources, and prompts. Destructive tools are annotated and can be further restricted with MCP_ALLOWED_TOOLS.

download_video returns immediately by default. Set await_completion: true to poll MyTube’s active/queued/history endpoints and emit MCP notifications/progress when the client supplies a progress token. Polling is bounded by MYTUBE_DOWNLOAD_POLL_TIMEOUT_MS.

Configuration

Copy .env.example for the complete list. Important settings:

  • MYTUBE_BASE_URL is required. HTTPS is required for remote MyTube servers; local HTTP is allowed for localhost/127.0.0.1/*.local, or explicitly with MYTUBE_ALLOW_INSECURE_TLS=true.
  • MYTUBE_AUTH_MODE is api-key by default or admin-session.
  • MCP_TRANSPORT is stdio by default. Set it to http for Streamable HTTP.
  • MCP_UPLOAD_ROOTS must contain one or more directories before upload tools are enabled operationally. Symlink escapes are rejected.
  • MYTUBE_ALLOW_INTERNAL_URLS=true is required if trusted LAN/private URLs must be sent to MyTube.

Streamable HTTP

MCP_TRANSPORT=http \
MCP_HTTP_BIND=127.0.0.1 \
MCP_HTTP_PORT=3100 \
MCP_HTTP_BEARER_TOKEN='use-a-long-random-token' \
npx -y mytube-mcp

The endpoint is POST /mcp and the health check is GET /healthz. Bind to loopback by default. For remote access, put the server behind TLS termination and set MCP_HTTP_BEARER_TOKEN; non-loopback binds without a bearer token are rejected. See docs/transport.md.

Docker

A multi-arch image (linux/amd64, linux/arm64) is published to the GitHub Container Registry on every release:

docker pull ghcr.io/franklioxygen/mytube-mcp:latest

Run it in Streamable HTTP mode (Docker only makes sense for the HTTP transport, not stdio):

docker run --rm -p 127.0.0.1:3100:3100 \
  -e MYTUBE_BASE_URL=https://mytube.example.com \
  -e MYTUBE_AUTH_MODE=api-key \
  -e MYTUBE_API_KEY=replace-with-your-mytube-api-key \
  -e MCP_TRANSPORT=http \
  -e MCP_HTTP_BIND=0.0.0.0 \
  -e MCP_HTTP_PORT=3100 \
  -e MCP_HTTP_BEARER_TOKEN=use-a-long-random-token \
  ghcr.io/franklioxygen/mytube-mcp:latest

Tags follow semantic versioning (0, 0.1, 0.1.0) plus latest. See examples/docker-compose.streamable-http.yml for a Compose setup, or build locally with docker build -t mytube-mcp ..

Development

npm install
npm run build
npm run lint
npm test

See SECURITY.md for the threat model and docs/tools.md for the tool catalog.

Compatibility note

The implementation was compared with MyTube v1.10.11 at the time of this release. MyTube returns raw arrays/objects on several legacy-compatible endpoints, so the client accepts both those responses and the documented { success, data } envelope. It uses MyTube’s actual mytube_auth_session and mytube_csrf cookie names and X-CSRF-Token header.

License

MIT. See LICENSE if this repository is distributed with a license file.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选