正在检查账户…
all posts

Video Download MCP: Add a Download Tool to Your Agent

A practical guide to the video download MCP server: what the six tools return, how the async job model works, and how to connect Claude Code, Cursor, or Codex.

Videodownload team

The short answer

A video download MCP server gives an AI agent the same capability a person has in a browser: paste a public link, choose a format, and save the file. The Videodownload server exposes six tools over streamable HTTP, runs yt-dlp and ffmpeg on a hosted worker, and returns a signed URL that expires after 15 minutes.

The agent never installs Python, never bundles an extractor, and never sees a platform cookie. It calls a tool, polls a job, and hands the user a link.

Why not put yt-dlp inside the agent?

A local wrapper is tempting. yt-dlp is Unlicense, supports many public platforms and receives extractor updates. But an agent that runs on a user's machine has three problems a hosted tool does not:

  1. Install surface. Python, the binary, and ffmpeg have to exist on every machine. A remote MCP client or a web agent has no shell to install them.
  2. Update drift. Platforms change their pages constantly. Every user can end up on a different yt-dlp version, and the agent has no way to know which one works.
  3. Resource control. A loop that downloads a two-hour video can fill a disk. A hosted worker can cap duration, file size, and concurrency before the download starts.

The hosted model moves those concerns to one place. The tradeoff is that the URL and job metadata leave the machine, and the worker is a shared service. For a team agent or a product feature, that is usually the right trade.

The six tools

  • resolve_video: title, duration, thumbnail, platform, formats. Free.
  • list_formats: the format list only. Free.
  • download_video: create an MP4, audio, or GIF job. One credit.
  • get_download: status, progress, and the signed file URL. Free.
  • cancel_download: stop a job and refund the credit. Free.
  • extract_audio: create an MP3 job. One credit.

The split matters. An agent should resolve first, show the user what it found, and only then spend a credit. A resolve call is also the cheapest way to check whether a platform is currently readable.

The job model

download_video returns a job id rather than a finished file. The following is an illustrative REST envelope, not a live job. MCP tools put the job data in structuredContent and JSON text in content:

{
  "code": 0,
  "data": {
    "job_id": "<returned job id>",
    "status": "queued",
    "credits_charged": 1
  }
}

Poll get_download every two seconds. The status moves through queued, resolving, downloading, processing, and then ready, failed, canceled, or expired. When it is ready, the response contains a signed URL, a MIME type, a size, and an expiry time.

Keep the returned job id and poll that same job. Creating another job is not an idempotent retry: every create call starts a separate job and may reserve another credit. If a response times out after you received a job id, poll it before considering another create. Failed and canceled jobs refund; a new download after expiry can cost another credit. Polling does not extend the 15-minute file lifetime.

Provide the key privately

Create a dedicated API key in your account. In a Bash terminal, use a hidden prompt rather than putting its value in chat, the skill file, a shared configuration or shell history:

read -rsp 'VideoDownload API key: ' VIDEODOWNLOAD_API_KEY
export VIDEODOWNLOAD_API_KEY

Save the client configuration below, preserving existing servers, then launch the client from this same environment. A variable set in a different terminal does not update an already-running app.

Connect Claude Code

Merge this entry into .mcp.json. Keep the variable reference literal:

{
  "mcpServers": {
    "videodownload": {
      "type": "http",
      "url": "https://videodownloadmcp.com/mcp",
      "headers": { "Authorization": "Bearer ${VIDEODOWNLOAD_API_KEY}" }
    }
  }
}

Launch Claude Code and run claude mcp list to confirm the connection. Ask for resolve_video first. A metadata result proves parsing, not that the file can finish downloading.

Connect Cursor

Merge into .cursor/mcp.json or ~/.cursor/mcp.json. Cursor uses the env: interpolation syntax:

{
  "mcpServers": {
    "videodownload": {
      "url": "https://videodownloadmcp.com/mcp",
      "headers": { "Authorization": "Bearer ${env:VIDEODOWNLOAD_API_KEY}" }
    }
  }
}

Fully close the existing Cursor process, launch cursor . from the key environment, and check the MCP server status before requesting a download.

Connect Codex

Use remote HTTP in ~/.codex/config.toml:

[mcp_servers.videodownload]
url = "https://videodownloadmcp.com/mcp"
bearer_token_env_var = "VIDEODOWNLOAD_API_KEY"

Launch codex from the environment containing the key. The optional Skill is installed separately under ~/.agents/skills/video-download/SKILL.md for current Codex.

Repository-only stdio

The source adapter is private and unpublished to npm. Authorized repository users with dependencies installed can run it from the repository root with the key in its process environment:

node packages/mcp-server/index.mjs

This source path is not a public package installation command. Public client setup uses the hosted HTTP endpoint above.

What the server refuses

The safe default is part of the product, not an afterthought:

  • Private accounts, follower-only posts, and age-restricted media return PRIVATE_CONTENT or LOGIN_REQUIRED.
  • DRM protected streams return DRM_PROTECTED.
  • Live streams are not supported.
  • Sources over 30 minutes are refused, including audio requests. The output cap is 500 MB; output size can be checked during download. Choosing MP3 does not bypass the duration cap.
  • Hosts outside the platform allowlist are rejected, and the worker resolves DNS before it fetches a page.

The hosted service does not accept platform cookies or bypass a login wall. Inspect isError and error.code in MCP results even if the transport returned HTTP 200.

A good agent prompt

The skill file does the heavy lifting, but a clear request helps:

Resolve this public TikTok link, show me the available MP4 qualities, and download the 1080p version if it exists. Give me the signed URL and tell me when it expires.

That prompt maps cleanly to resolve_video, a short confirmation, download_video, and get_download. Vague prompts like "download this" work too, but the agent has to guess at a quality.

Limits worth knowing

  • Resolve is limited to 20 calls per minute per key.
  • New jobs are limited to 8 per minute per key.
  • Files expire 15 minutes after they are ready.
  • Anonymous web downloads are limited to 3 per network per day.

Use dedicated keys to identify client usage, while credits remain associated with the owning account. Usage is available at /v1/me and in the dashboard.

Further reading

more posts