io.github.cyanheads/tmdb-mcp-server
Search, detail, and discovery for movies, TV, and people on The Movie Database (TMDB).
ماذا يمكنك أن تفعل مع io.github.cyanheads/tmdb-mcp-server؟
- 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
- 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
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
@cyanheads/tmdb-mcp-serverclaude mcp add tmdb-mcp-server -e 'TMDB_API_KEY=<your tmdb_api_key>' -e 'TMDB_LANGUAGE=en-US' -e 'TMDB_DEFAULT_REGION=US' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/tmdb-mcp-server@0.1.5
{
"mcpServers": {
"tmdb-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/tmdb-mcp-server@0.1.5"
],
"env": {
"TMDB_API_KEY": "<your tmdb_api_key>",
"TMDB_LANGUAGE": "en-US",
"TMDB_DEFAULT_REGION": "US",
"MCP_LOG_LEVEL": "info"
}
}
}
}
متغيرات البيئة
TMDB_API_KEYإلزامي سري TMDB v4 API Read Access Token (JWT). Sent as 'Authorization: Bearer'. Create one at https://www.themoviedb.org/settings/api.TMDB_LANGUAGEDefault response language as ISO 639-1, optionally with region (e.g. 'en-US'). Per-call language overrides it.TMDB_DEFAULT_REGIONISO 3166-1 country example in discovery missing-watch_region errors; never a query default.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
@cyanheads/tmdb-mcp-serverclaude mcp add tmdb-mcp-server -e 'TMDB_API_KEY=<your tmdb_api_key>' -e 'TMDB_LANGUAGE=en-US' -e 'TMDB_DEFAULT_REGION=US' -e 'MCP_HTTP_HOST=127.0.0.1' -e 'MCP_HTTP_PORT=3010' -e 'MCP_HTTP_ENDPOINT_PATH=/mcp' -e 'MCP_AUTH_MODE=none' -e 'MCP_LOG_LEVEL=info' -e 'MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE>' -- npx -y @cyanheads/tmdb-mcp-server@0.1.5
{
"mcpServers": {
"tmdb-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/tmdb-mcp-server@0.1.5"
],
"env": {
"TMDB_API_KEY": "<your tmdb_api_key>",
"TMDB_LANGUAGE": "en-US",
"TMDB_DEFAULT_REGION": "US",
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_HTTP_PORT": "3010",
"MCP_HTTP_ENDPOINT_PATH": "/mcp",
"MCP_AUTH_MODE": "none",
"MCP_LOG_LEVEL": "info",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
}
}
}
}
متغيرات البيئة
TMDB_API_KEYإلزامي سري TMDB v4 API Read Access Token (JWT). Sent as 'Authorization: Bearer'. Create one at https://www.themoviedb.org/settings/api.TMDB_LANGUAGEDefault response language as ISO 639-1, optionally with region (e.g. 'en-US'). Per-call language overrides it.TMDB_DEFAULT_REGIONISO 3166-1 country example in discovery missing-watch_region errors; never a query default.MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').MCP_TRANSPORT_TYPESelects the HTTP transport.
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
المحتويات
@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 • 3 Resources
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
| Tool | Description |
|---|---|
tmdb_search_titles | Search movies, TV, and people by name. The required first step — resolves a name to the integer id the detail tools consume. |
tmdb_get_movie | Full movie detail in one call — synopsis, runtime, genres, US certification, budget/revenue, cast, crew, trailers, recommendations, keywords, external ids. |
tmdb_get_show | Full TV show detail — overview, air dates, status, season/episode counts, creators, networks, season summaries, cast, trailers, content rating. |
tmdb_get_season | Episode list for one season — names, air dates, runtimes, vote averages, stills, per-episode guest stars, plus the season's regular cast. |
tmdb_get_person | Person detail and full filmography — biography, vital dates, the combined_credits cast/crew lists, and cross-platform external ids. |
tmdb_discover_titles | Filtered, 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_trending | Trending movies, TV, or people for the day or week. |
tmdb_get_watch_providers | Region-scoped streaming availability (JustWatch) — flatrate/rent/buy/ads/free provider lists plus the TMDB link. A region code is required. |
Resources
| Resource | Description |
|---|---|
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. |
Capability reference
tmdb_search_titles tool
multimode (default) mixes movies, shows, and people, tagged withmedia_type;movie,tv, orpersonrestrict to one type- Optional
year(movie/tv modes),language,include_adult, andpage; 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
appendarray (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
appendoptions astmdb_get_movie, withcontent_ratings(US TV rating) in place ofrelease_dates - Adds season summaries, creators, networks, and the last/next episode to air
- Pass a
season_numberfromseasons[]totmdb_get_seasonfor 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_idis 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_creditssplit intocast_creditsandcrew_credits, newest first;credits_page(default 1) returns up to 50 of each, with full totals on every page- Follow
next_credits_pagefor more; pages past the end return empty lists
tmdb_discover_titles tool
- Filter by
with_genres/without_genres,yearor arelease_date_gte/ltewindow,vote_averagerange,vote_count_gte,with_cast/with_crew(movie),with_networks(tv),with_watch_providers+watch_region,with_original_language, andruntimerange - Sort by popularity, revenue, vote average, vote count, or release date; pair
vote_average.descwithvote_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_providerswithoutwatch_regionreturnsregion_required
tmdb_get_trending tool
media_type:all(default) mixes movies, shows, and people; or restrict to one typetime_window:dayorweek(default)- Up to 20 results per page, with
pagefor 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_providersintmdb_discover_titles
tmdb://movie/{movie_id} resource
- Same record as
tmdb_get_movie—application/json movie_idcomes fromtmdb_search_titlesortmdb_discover_titles- Typed
movie_not_founderror when TMDB returns 404 for the id
tmdb://tv/{series_id} resource
- Same record as
tmdb_get_show—application/json series_idcomes fromtmdb_search_titlesortmdb_discover_titles- Typed
show_not_founderror 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; usetmdb_get_personfor further pages person_idcomes fromtmdb_search_titles(mode "person")- Typed
person_not_founderror when TMDB returns 404 for the id
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 the following to your MCP client configuration file.
{
"mcpServers": {
"tmdb-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/tmdb-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"TMDB_API_KEY": "your-tmdb-read-access-token"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"tmdb-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/tmdb-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"TMDB_API_KEY": "your-tmdb-read-access-token"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"tmdb-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "TMDB_API_KEY=your-tmdb-read-access-token",
"ghcr.io/cyanheads/tmdb-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 TMDB_API_KEY=... bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- A TMDB API Read Access Token (v4 JWT) — free from your TMDB API settings.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/tmdb-mcp-server.git
- Navigate into the directory:
cd tmdb-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env and set TMDB_API_KEY
Configuration
All configuration is validated at startup via Zod schemas. Key environment variables:
| Variable | Description | Default |
|---|---|---|
TMDB_API_KEY | Required. TMDB v4 API Read Access Token (JWT). | — |
TMDB_LANGUAGE | Default response language (e.g. en-US); a per-call language overrides it. | en-US |
TMDB_DEFAULT_REGION | Region shown in the missing-watch_region hint; never applied to queries. | US |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | Port for the HTTP server. | 3010 |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (RFC 5424). | info |
LOG_TOOL_FAILURE_PAYLOADS | Log 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_TYPE | Storage backend. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry instrumentation (spans, metrics, completion logs). | false |
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | OTLP log endpoint. | — |
See .env.example for the full list of optional overrides.
Running the server
Local development
- Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:http - Run checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t tmdb-mcp-server .
docker run --rm -e TMDB_API_KEY=your-token -p 3010:3010 tmdb-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/tmdb-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and resources. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts) — the eight TMDB tools. |
src/mcp-server/resources | Resource definitions (*.resource.ts) — movie, TV, and person detail. |
src/services/tmdb | TMDB v3 REST client. |
tests/ | Unit and integration tests mirroring src/. |
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/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools and resources via the barrels in
src/mcp-server/*/definitions/index.ts
Attribution
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:
bun run devcheck
bun run test
License
Apache-2.0 — see LICENSE for details.
الأسئلة الشائعة
ما هو io.github.cyanheads/tmdb-mcp-server؟
Search, detail, and discovery for movies, TV, and people on The Movie Database (TMDB).
كيف أثبّت io.github.cyanheads/tmdb-mcp-server؟
يعمل على جهازك. في Claude Code: claude mcp add tmdb-mcp-server -e 'TMDB_API_KEY=<your tmdb_api_key>' -e 'TMDB_LANGUAGE=en-US' -e 'TMDB_DEFAULT_REGION=US' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/tmdb-mcp-server@0.1.5. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج io.github.cyanheads/tmdb-mcp-server إلى مفتاح API؟
نعم. يتطلب TMDB_API_KEY، وتضبطها في إعداداته.
هل io.github.cyanheads/tmdb-mcp-server مفتوح المصدر؟
نعم. شيفرته متاحة على GitHub بترخيص Apache-2.0.
من يصون io.github.cyanheads/tmdb-mcp-server؟
ينشره cyanheads. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.