Skip to main content
Glama
ShubhanshuSondhiya

TMDB MCP Server

TMDB MCP 服务器

该项目实现了一个与电影数据库 (TMDB) API 集成的模型上下文协议 (MCP) 服务器。它使像 Claude 这样的 AI 助手能够与电影数据交互,提供搜索、检索详细信息以及生成与电影相关的内容的功能。

特征

资源

  • 静态资源:

    • tmdb://info - 有关 TMDB API 的信息

    • tmdb://trending - 当前热门电影

  • 资源模板:

    • tmdb://movie/{id} - 有关特定电影的详细信息

提示

  • 电影评论:生成具有指定风格和评级的定制电影评论

  • 电影推荐:根据类型和心情获得个性化的电影推荐

工具

  • 搜索电影:按标题或关键字查找电影

  • 获取热门电影:检索当天或当周的热门电影

  • 获取类似电影:查找与指定电影相似的电影

Related MCP server: TMDB MCP Server

设置说明

先决条件

  • Node.js(v16 或更高版本)

  • npm 或 yarn

  • TMDB API 密钥

安装

  1. 克隆此存储库

    git clone https://github.com/your-username/tmdb-mcp.git
    cd tmdb-mcp
  2. 安装依赖项

    npm install
  3. 配置您的 TMDB API 密钥

    • 在项目根目录中创建一个.env文件(或者:直接编辑src/config.ts )

    • 添加您的 TMDB API 密钥: TMDB_API_KEY=your_api_key_here

  4. 构建项目

    npm run build
  5. 启动服务器

    npm start

Claude Desktop 的设置

  1. 打开 Claude 桌面

  2. 前往“设置”>“开发者”选项卡

  3. 点击“编辑配置”打开配置文件

  4. 将以下内容添加到您的配置中:

{
  "mcpServers": {
    "tmdb-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/your/tmdb-mcp/build/index.js"]
    }
  }
}
  1. 重启Claude桌面

使用示例

使用静态资源

  • “TMDB 是什么?”

  • “显示当前热门电影”

使用资源模板

  • “获取 ID 为 550 的电影的详细信息”(搏击俱乐部)

  • “跟我讲讲 ID 为 155 的电影吧”(《黑暗骑士》)

使用提示

  • “为《盗梦空间》撰写一份详细的评论,评分为 9/10”

  • “推荐一些适合沉思的科幻电影”

使用工具

  • “搜索有关太空探索的电影”

  • “今天热门的电影有哪些?”

  • “查找与《黑客帝国》类似的电影”

发展

项目结构

tmdb-mcp/
├── src/
│   ├── index.ts                # Main server file
│   ├── config.ts               # Configuration and API keys
│   ├── handlers.ts             # Request handlers
│   ├── resources.ts            # Static resources
│   ├── resource-templates.ts   # Dynamic resource templates
│   ├── prompts.ts              # Prompt definitions
│   ├── tools.ts                # Tool implementations
│   └── tmdb-api.ts             # TMDB API wrapper
├── package.json
├── tsconfig.json
└── README.md

测试

在开发过程中使用 MCP 检查器测试您的服务器:

npx @modelcontextprotocol/inspector node build/index.js

执照

麻省理工学院

致谢

Available Tools

4 tools
get-movie-detailsC

Get detailed information about a specific movie

ParametersJSON Schema
NameRequiredDescriptionDefault
movieIdYesID of the movie to get details for

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves details but doesn't mention whether it's a read-only operation, potential rate limits, error conditions, or what 'detailed information' entails. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, potential response formats, or behavioral traits like safety or performance. For a tool with no structured context, this leaves critical gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'movieId' parameter. The description adds no additional parameter semantics beyond implying the tool requires a specific movie, which is already covered by the schema. This meets the baseline of 3 when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('detailed information about a specific movie'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get-similar' or 'search-movies', which might also retrieve movie information in different contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search-movies' or 'get-similar'. It lacks context about prerequisites (e.g., needing a movie ID) or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-similarC

Get similar movies to a given movie

ParametersJSON Schema
NameRequiredDescriptionDefault
movieIdYesID of the movie to find similar movies for

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't describe response format, error handling, rate limits, or other behavioral traits beyond the basic operation, which is insufficient for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, making it appropriately sized and front-loaded. Every word contributes directly to the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns a list of movies. It doesn't explain what 'similar' means (e.g., genre, director, ratings), the return format, or any limitations, leaving significant gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents the 'movieId' parameter fully. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, resulting in the baseline score for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('similar movies'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'search-movies' or 'get-trending' beyond the basic concept of similarity, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search-movies' or 'get-trending'. It lacks explicit context, exclusions, or prerequisites, leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-moviesC

Search for movies by title or keywords

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
pageNoPage number for results

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches for movies but doesn't mention key behaviors like whether it's read-only (likely, but not confirmed), how results are returned (e.g., format, pagination details beyond the 'page' parameter), or any limitations (e.g., rate limits, authentication needs). This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose and avoids redundancy, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search functionality with pagination), no annotations, and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., read-only status, result format), usage context relative to siblings, and output expectations, leaving the agent with incomplete guidance for proper invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('query' and 'page') documented in the schema. The description adds minimal value beyond the schema by implying the 'query' parameter is for title/keyword searches, but it doesn't provide additional context like search syntax, result ordering, or default behaviors. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Search') and resource ('movies'), and specifies the search criteria ('by title or keywords'). However, it doesn't explicitly differentiate from sibling tools like 'get-trending' or 'get-similar', which might also involve movie discovery but through different mechanisms.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get-trending' (for popular movies) or 'get-similar' (for recommendations based on a known movie). It mentions the search criteria but doesn't clarify scenarios where this is preferred over sibling tools, leaving usage context implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updates
    • First observedget-movie-details
    • First observedget-similar
    • First observedget-trending
    • First observedsearch-movies

TDQS

B3.3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get-movie-details retrieves specific movie information, get-similar finds related movies, get-trending lists popular movies, and search-movies performs keyword-based queries. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency5/5

All tools follow a consistent verb-noun pattern using kebab-case (e.g., get-movie-details, get-similar, get-trending, search-movies). The naming is uniform and predictable, with 'get' for retrieval operations and 'search' for querying, enhancing readability and usability.

Tool Count4/5

With 4 tools, the server is well-scoped for basic movie discovery and information retrieval. While it covers core functions like details, similarity, trends, and search, it might feel slightly thin for a full movie database API, but it is reasonable and focused.

Completeness3/5

The tool set covers key read operations for movie data, including details, similarity, trends, and search. However, there are notable gaps such as no update, delete, or creation tools (if applicable to the domain), and missing operations for TV shows, actors, or reviews, which could limit agent workflows in broader contexts.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search and retrieve movie information from The Movie Database (TMDB) API through the Model Context Protocol interface.
    50 npm
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides integration with The Movie Database (TMDB) API for searching movies, TV shows, and people, accessing detailed information, and discovering popular and trending content. Enables AI assistants to access comprehensive movie and television metadata including ratings, cast, crew, and overviews.
    50 npm
    1
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides access to The Movie Database (TMDB) API for searching movies, retrieving movie details, cast information, and browsing current, upcoming, popular, and top-rated films, as well as searching for actors and directors.
    50 npm
    -
  • A
    license
    A
    quality
    D
    maintenance
    Provides access to The Movie Database (TMDB) API, enabling users to search for movies, TV shows, and people, get detailed information, discover content with advanced filters, and retrieve recommendations.
    13
    50 npm
    5
    MIT