Tmdb Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.2.0更新於 Oct 30, 2026

Search, detail, and discovery for movies, TV, and people on The Movie Database (TMDB).

概覽

AI 產生的概覽

從 The Movie Database(TMDB)查詢電影、影集與人物資料,包含演職員、評分、預告片和各區串流上架資訊。

可以做什麼
  • 依名稱搜尋電影、影集與人物,並把名稱解析成 TMDB 編號
  • 讀取電影與影集完整詳情:簡介、演職員、預告片、評分、關鍵字、推薦
  • 讀取季分集清單,以及人物傳記與可分頁的作品年表
  • 依類型、日期、評分、演員、播出頻道、串流平台或片長篩選探索作品,並查看熱門排行
  • 查詢指定地區的串流上架情況(訂閱、租借、購買、廣告、免費),資料來自 JustWatch
  • 以資源形式提供電影、影集與人物紀錄,並附一份代理使用指南技能
適用情境
適合需要可靠影視資料來做推薦、片單、冷知識或研究的場合,也適合依條件篩選作品並確認某地區的觀看管道。
執行需求
透過 npx 以 stdio 在本機執行(需 Node.js),也可用 Docker 映像或原始碼建置(Bun 1.4.0+ 或 Node.js 24+)。需要免費的 TMDB 帳號與 TMDB v4 API Read Access Token,透過 TMDB_API_KEY 提供。選用設定包含語言、傳輸方式、HTTP 埠號、驗證模式與日誌。
安裝前請注意
必須提供 TMDB API Read Access Token(TMDB_API_KEY),並以 bearer 權杖形式傳送給 TMDB。開啟 LOG_TOOL_FAILURE_PAYLOADS 會記錄失敗的工具參數與結果,其中可能含機密資訊。請求與結果會送往 TMDB 及 JustWatch 來源的資料;伺服器為唯讀,不會修改資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tmdb Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@cyanheads/tmdb-mcp-server

Search movies, TV, and people on The Movie Database (TMDB) — credits, ratings, trailers, images, recommendations, and region-aware streaming availability via MCP. STDIO or Streamable HTTP.

8 Tools • 4 Resources • 1 Skill


Overview

Movie and TV metadata powered by The Movie Database (TMDB). Search titles and people by name, pull full credits and filmographies, discover titles by filtered criteria, track trending content, and check where to stream in your region.

Tools

ToolDescription
tmdb_search_titlesSearch movies, TV, and people by name. The required first step — resolves a name to the integer id the detail tools consume.
tmdb_get_movieFull movie detail in one call — synopsis, runtime, genres, US certification, budget/revenue, cast, crew, trailers, recommendations, keywords, external ids.
tmdb_get_showFull TV show detail — overview, air dates, status, season/episode counts, creators, networks, season summaries, cast, trailers, content rating.
tmdb_get_seasonEpisode list for one season — names, air dates, runtimes, vote averages, stills, per-episode guest stars, plus the season's regular cast.
tmdb_get_personPerson detail and full filmography — biography, vital dates, the combined_credits cast/crew lists, and cross-platform external ids.
tmdb_discover_titlesFiltered, sorted discovery across movies or TV — the power-query: genre, date/vote ranges, vote-count floor, cast/crew/network, watch providers, runtime, sort.
tmdb_get_trendingTrending movies, TV, or people for the day or week.
tmdb_get_watch_providersRegion-scoped streaming availability (JustWatch) — flatrate/rent/buy/ads/free provider lists plus the TMDB link. A region code is required.

Resources

ResourceDescription
tmdb://movie/{movie_id}Movie detail by id, as injectable context — the same enriched record as tmdb_get_movie.
tmdb://tv/{series_id}Show detail by id — the same enriched record as tmdb_get_show.
tmdb://person/{person_id}Person detail with the first 50 cast and 50 crew credits and full totals; use tmdb_get_person for further pages.
skill://tmdb-guide/SKILL.mdAgent guide for regional watchlists, directing credits, filmography paging, and season traversal.

Capability reference

tmdb_search_titles tool

  • multi mode (default) mixes movies, shows, and people, tagged with media_type; movie, tv, or person restrict to one type
  • Optional year (movie/tv modes), language, include_adult, and page; empty results return normally with recovery guidance
  • Each result carries id, media_type, title/name, release_year, overview, vote_average, genre_names, and a poster or profile URL

tmdb_get_movie tool

  • Returns credits, videos, recommendations, similar, keywords, external ids, and release dates in one call; trim the append array (e.g. ["credits"]) to shrink the payload
  • Includes US certification, top-billed cast, key crew, and YouTube trailers with watch URLs
  • No streaming availability; use tmdb_get_watch_providers

tmdb_get_show tool

  • Same append options as tmdb_get_movie, with content_ratings (US TV rating) in place of release_dates
  • Adds season summaries, creators, networks, and the last/next episode to air
  • Pass a season_number from seasons[] to tmdb_get_season for episodes

tmdb_get_season tool

  • Per-episode names, air dates, runtimes, vote averages, still URLs, and guest stars
  • Also returns the season's regular cast
  • series_id is echoed from the input; season 0 is "Specials"

tmdb_get_person tool

  • Biography, vital dates, place of birth, known-for department, aliases, gender, and external ids (IMDb, Wikidata, social handles)
  • combined_credits split into cast_credits and crew_credits, newest first; credits_page (default 1) returns up to 50 of each, with full totals on every page
  • Follow next_credits_page for more; pages past the end return empty lists

tmdb_discover_titles tool

  • Filter by with_genres/without_genres, year or a release_date_gte/lte window, vote_average range, vote_count_gte, with_cast/with_crew (movie), with_networks (tv), with_watch_providers + watch_region, with_original_language, and runtime range
  • Sort by popularity, revenue, vote average, vote count, or release date; pair vote_average.desc with vote_count_gte (~100–1000) to keep low-vote titles out of the top
  • Filters that don't apply to the media type produce a notice; with_watch_providers without watch_region returns region_required

tmdb_get_trending tool

  • media_type: all (default) mixes movies, shows, and people; or restrict to one type
  • time_window: day or week (default)
  • Up to 20 results per page, with page for more; empty results return normally with recovery guidance

tmdb_get_watch_providers tool

  • Returns flatrate, rent, buy, ads, and free provider lists with logo URLs, plus the TMDB JustWatch link
  • watch_region (ISO 3166-1 alpha-2) is required; the response always states the region
  • An empty result means not streamable in that region; provider ids feed with_watch_providers in tmdb_discover_titles

tmdb://movie/{movie_id} resource

  • Same record as tmdb_get_movie — application/json
  • movie_id comes from tmdb_search_titles or tmdb_discover_titles
  • Typed movie_not_found error when TMDB returns 404 for the id

tmdb://tv/{series_id} resource

  • Same record as tmdb_get_show — application/json
  • series_id comes from tmdb_search_titles or tmdb_discover_titles
  • Typed show_not_found error when TMDB returns 404 for the id

tmdb://person/{person_id} resource

  • Person detail with the first 50 cast and 50 crew credits and full totals — application/json; use tmdb_get_person for further pages
  • person_id comes from tmdb_search_titles (mode "person")
  • Typed person_not_found error when TMDB returns 404 for the id

skill://tmdb-guide/SKILL.md resource

  • The tmdb-guide skill covers identifier sources, regional provider categories, directing-credit verification, and multi-step research gates
  • Available through MCP skill discovery and resource reads; included in plugin installs, npm, Docker, and MCPB bundles

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

TMDB-specific:

  • Typed client for the TMDB v3 REST API, authenticated with a v4 Read Access Token
  • Image paths resolved to full image URLs; missing paths omit the field
  • Genre ids resolved to genre names, so list results are readable without an extra call
  • Detail tools return credits, videos, recommendations, keywords, and external ids in one request
  • Region-aware streaming availability backed by JustWatch; region is always an explicit input

Agent-friendly output:

  • TMDB attribution on every response in enrichment.attribution
  • List responses carry total counts, page/total-pages, and a notice of the filters actually applied
  • Empty results return normally with recovery guidance, not as errors
  • Watch-provider results always state the region; capped filmographies disclose their full totals

Getting started

A TMDB API Read Access Token is required. Create a free TMDB account, then copy the API Read Access Token (a v4 JWT) from your API settings — this server authenticates v3 endpoints with Authorization: Bearer <token>, not the legacy ?api_key= query parameter.

Add it to Claude Code:

sh
claude mcp add tmdb-mcp-server -e TMDB_API_KEY=your-tmdb-read-access-token -- npx -y @cyanheads/tmdb-mcp-server

For other clients, add this to the MCP configuration file:

json
{  "mcpServers": {    "tmdb-mcp-server": {      "command": "npx",      "args": ["-y", "@cyanheads/tmdb-mcp-server"],      "env": {        "TMDB_API_KEY": "your-tmdb-read-access-token"      }    }  }}

For Docker or a source build, see Running the server.

Configuration

All configuration is validated at startup via Zod schemas. Key environment variables:

VariableDescriptionDefault
TMDB_API_KEYRequired. TMDB v4 API Read Access Token (JWT).—
TMDB_LANGUAGEDefault response language (e.g. en-US); a per-call language overrides it.en-US
TMDB_DEFAULT_REGIONRegion shown in the missing-watch_region hint; never applied to queries.US
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOG_TOOL_FAILURE_PAYLOADSLog failed tool arguments and results, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). Free-form values may contain secrets.false
STORAGE_PROVIDER_TYPEStorage backend.in-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOTLP log endpoint.—

See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4.0 or higher (or Node.js v24+).

sh
git clone https://github.com/cyanheads/tmdb-mcp-server.gitcd tmdb-mcp-server && bun installcp .env.example .env   # set TMDB_API_KEY
  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker run --rm -e TMDB_API_KEY=your-token -p 3010:3010 ghcr.io/cyanheads/tmdb-mcp-server:latest

The image defaults to HTTP transport, stateless sessions, and logs to /var/log/tmdb-mcp-server. For stdio, use docker run -i --rm -e MCP_TRANSPORT_TYPE=stdio -e TMDB_API_KEY=your-token ghcr.io/cyanheads/tmdb-mcp-server:latest. Build locally with docker build -t tmdb-mcp-server .; OpenTelemetry peers are included by default, or omitted with --build-arg OTEL_ENABLED=false.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools and resources.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts) — the eight TMDB tools.
src/mcp-server/resourcesResource definitions (*.resource.ts) — movie, TV, and person detail.
src/services/tmdbTMDB v3 REST client.
tests/Unit and integration tests mirroring src/.
skills/Published agent guide for calling the TMDB tools.

Development guide

See AGENTS.md (or CLAUDE.md, the same content) for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources via the barrels in src/mcp-server/*/definitions/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Attribution

[TMDB] This product uses the TMDB API but is not endorsed or certified by TMDB. Streaming availability data is provided by JustWatch via TMDB and is region-specific.

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 cb7efa6

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

5
  1. v0.2.0最新Oct 30, 2026
  2. v0.1.5Oct 18, 2026
  3. v0.1.4Oct 7, 2026
  4. v0.1.3Sep 21, 2026
  5. v0.1.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分