imdb-mcp-server
IMDb MCP 服务器
一个使用 IMDb API 服务为电影和电视节目信息实现模型上下文协议 (MCP) 的 Python 服务器。
目录
Related MCP server: wizzy-mcp-tmdb
概述
该服务器提供了一套全面的工具,可通过 IMDb API 访问 IMDb 数据。它充当代理和 IMDb 数据库之间的桥梁,提供有关电影、电视节目、演员、导演等的详细信息。
特征
🎬 电影和电视节目搜索功能
📋 有关电影和电视节目的详细信息
👨👩👧👦演员和工作人员信息
🏆 最受好评和最热门的内容列表
💰 票房数据
🌍 特定国家的电影信息(特别关注印度电影)
🔜 即将发布
🔄 高效的响应缓存系统
配置
此服务器需要 RapidAPI 提供的 IMDb API 服务的 API 密钥:
工具
搜索工具
工具 | 描述 | 例子 |
搜索_imdb | 使用各种过滤选项搜索电影和电视节目 |
|
IMDb ID 工具
工具 | 描述 | 例子 |
获取 imdb 详细信息 | 检索有关电影或电视节目的详细信息 |
|
获取目录 | 检索电影导演 |
|
获取演员 | 检索电影演员表 |
|
获取写入器 | 检索电影编剧 |
|
配置工具
工具 | 描述 | 例子 |
获取类型 | 获取所有可用的内容类型 |
|
获取流派 | 获取所有可用的类型 |
|
获取国家 | 获取所有可用国家 |
|
获取语言 | 获取所有可用语言 |
|
电影工具
分页(每页 5 条结果)
工具 | 描述 | 例子 |
获取前 250 部电影 | 从 IMDb 获取排名前 250 的电影 |
|
获取美国票房榜单 | 创下美国票房纪录 |
|
获取最热门电影 | 获取最受欢迎的电影 |
|
电视节目工具
分页(每页 5 条结果)
工具 | 描述 | 例子 |
获取前 250 部电视节目 | 从 IMDb 获取排名前 250 的电视节目 |
|
获取最热门电视节目 | 获取最受欢迎的电视节目 |
|
即将发布的工具
分页(每页 5 条结果)
工具 | 描述 | 例子 |
获取即将发布的版本 | 按国家/地区获取即将上映的电影和电视节目 |
|
获取即将发布的可用国家/地区代码 | 获取即将发布的版本可用的国家/地区代码 |
|
印度聚焦工具(分页)
分页(每页 5 条结果)
工具 | 描述 | 例子 |
获取马拉雅拉姆语评分最高的电影 | 获取评分最高的 50 部马拉雅拉姆语电影 |
|
获取即将上映的印度电影 | 获取最受期待的即将上映的印度电影 |
|
获取热门泰米尔电影 | 获取热门泰米尔电影 |
|
获取热门泰卢固语电影 | 获取热门泰卢固语电影 |
|
获取最热门的泰米尔电影 | 获取评分最高的 50 部泰米尔电影 |
|
获取泰卢固语评分最高的电影 | 获取评分最高的 50 部泰卢固语电影 |
|
获取印度电影评分最高 | 获取评分最高的 250 部印度电影 |
|
提示和响应示例
近期将上映的 5 部动作片是什么?
我会帮你找到即将上映的动作片。
调用 MCP 工具get_upcoming_releases
现在我将从这些即将上映的动作片中寻找:
调用 MCP 工具get_upcoming_releases
根据搜索结果,以下是即将上映的 5 部动作片:
《我的世界》大电影(2025 年 4 月 4 日)
类型:动作、冒险、喜剧
描述:四个格格不入的人被拉过一个入口,进入一个立方体仙境,并与一位熟练的工匠一起踏上回家的旅程。
《怪诞故事》 (2025年4月4日)
类型:动作、冒险、喜剧
描述:四个相互关联的故事,背景设定在 1987 年的加利福尼亚州奥克兰,讲述了对音乐、电影、人物、地点和回忆的热爱。
醒来(2025年4月4日)
类型:动作、恐怖
描述:年轻的活动家闯入一家家具店抗议环境问题,却发现自己被一个痴迷于狩猎的夜间警卫困住了。
战争(2025年4月11日)
类型:动作、剧情、战争
描述:根据前海豹突击队员雷·门多萨在伊拉克战争期间的真实经历改编。
《业余爱好者》 (2025年4月11日)
类型:动作、惊悚
描述:一名中央情报局密码员勒索他的机构训练他追捕杀害他妻子的恐怖分子。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 IMDb 服务器:
npx -y @smithery/cli install @uzaysozen/imdb-mcp-server --client claude选项 1:使用 Docker(推荐)
克隆此存储库
git clone https://github.com/uzaysozen/imdb-mcp-server.git
cd imdb-mcp-server安装依赖项
pip install -r requirements.txt构建 Docker 镜像
docker build -t imdb_server .运行 Docker 容器(确保您的 API 密钥作为环境变量传递)
docker run -d -p 8000:8000 -e RAPID_API_KEY_IMDB=your_api_key_here --name imdb_server imdb_server将其添加到您的
claude_desktop_config.json中:
{
"mcpServers": {
"imdb_server": {
"command": "docker",
"args": [
"exec",
"-i",
"imdb_server",
"imdb-mcp-server"
],
"env": {
"RAPID_API_KEY_IMDB": "your_api_key_here"
}
}
}
}选项 2:直接执行 Python
克隆此存储库
git clone https://github.com/uzaysozen/imdb-mcp-server.git
cd imdb-mcp-server安装依赖项
pip install -r requirements.txt设置 API 密钥环境变量
export RAPID_API_KEY_IMDB=your_api_key_here将其添加到您的
claude_desktop_config.json中,根据需要调整 Python 路径:
{
"mcpServers": {
"imdb_server": {
"command": "/path/to/your/python",
"args": [
"/path/to/imdb_server.py"
],
"env": {
"RAPID_API_KEY_IMDB": "your_api_key_here"
}
}
}
}启动服务器
# Start the server directly
python imdb_server.py
# Or using MCP CLI
mcp run imdb_server.py
# Or if using Docker, the server starts automatically with the container
docker run -d -p 8000:8000 -e RAPID_API_KEY_IMDB=your_api_key_here --name imdb_server imdb_server添加您选择的配置后,重新启动 Claude Desktop 以加载 IMDb 服务器。之后,您就可以在与 Claude 的对话中使用所有电影和电视节目数据工具了。
技术细节
该服务器建立在:
通过 RapidAPI 实现的 IMDb API
MCP API接口
API 通信请求
用于服务器实现的 FastMCP
自定义内存缓存系统
智能分页将每个请求的结果限制为 5 个项目,以优化 AI 代理的使用
分页系统
所有数据检索工具都实现分页以增强 AI 代理的性能:
目的
AI 优化响应:将每个响应限制为 5 个项目,以防止处理数据的 AI 代理不堪重负
重点结果:帮助代理向用户提供更相关、更简洁的信息
改进处理能力:减少人工智能代理在分析电影和电视节目数据时的认知负荷
执行
每个分页端点接受一个
start参数(默认值:0)结果包括导航元数据(totalCount、hasMore、nextStart)
所有收集端点的页面大小均为一致的 5 项
带分页的示例请求:
get_top_250_movies(start=5)返回第 6-10 项
好处
更好的代理响应:防止 AI 代理同时接收过多数据
可管理信息:创建代理可以有效处理的可消化数据块
顺序访问:允许通过多个工具调用对大型数据集进行结构化探索
缓存系统
服务器实现了高效的缓存系统,以提高性能并减少 API 调用:
特征
内存缓存:将 API 响应存储在内存中以便快速检索
可配置的到期时间和大小:缓存条目在可自定义的时间段后过期(默认值:10 分钟),默认大小为 100 个缓存键
自动缓存清理:定期(默认值:5 分钟)删除过期条目,以使用后台线程管理内存使用情况
缓存键:根据 URL 和查询参数生成,以确保唯一性
好处
减少 API 使用:通过重复使用响应来帮助保持在 API 速率限制内
更快的响应时间:消除缓存查询的网络延迟
成本效率:最大限度地减少 API 调用次数,特别是对于热门或重复的查询
配置
可以在代码中调整缓存大小和过期时间:
# Default are 600 seconds (10 minutes) and 100 cache keys
response_cache = ResponseCache(expiry_seconds=120, max_size=50)限制
API 速率限制基于您的 RapidAPI 订阅
某些详细信息可能需要额外的 API 调用
每个请求的搜索结果可能会限制为一定数量的项目
服务器重启时内存缓存丢失
所有分页响应每页最多返回 5 个项目
故障排除
问题 | 解决方案 |
无法识别 API 密钥 | 确保 RAPID_API_KEY_IMDB 环境变量已正确设置 |
超出速率限制 | 检查您的 RapidAPI 订阅等级和限制 |
超时错误 | 服务器有 30 秒的超时时间;对于较大的请求,请尝试限制参数 |
空结果 | 尝试更广泛的搜索词或检查内容是否存在于 IMDb 数据库中 |
内存使用率高 | 如果长时间运行并有很多唯一查询,请偶尔重新启动服务器以清除缓存 |
执照
此 MCP 服务器在 MIT 许可下可用。
Available Tools
23 toolsget_castC
Get the cast of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get cast for. Returns: JSON object containing the cast of the movie.
Inputs: imdb_id (required). Returns: result
get_countriesB
Get all countries. Returns: JSON object containing all countries.
Inputs: no named parameters. Returns: result
get_country_codes_for_upcoming_releasesB
Get the available country codes for upcoming releases from IMDb. Returns: JSON object containing the available country codes for upcoming releases.
Inputs: no named parameters. Returns: result
get_directorsB
Get the directors of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get directors for. Returns: JSON object containing the directors of the movie.
Inputs: imdb_id (required). Returns: result
get_genresB
Get all genres. Returns: JSON object containing all genres.
Inputs: no named parameters. Returns: result
get_imdb_detailsB
Get more in depth details about a movie/series from IMDb. Args: imdbId: The IMDb ID of the movie/series to get details for. Returns: JSON object containing the movie/series details.
Inputs: imdb_id (required). Returns: result
get_languagesC
Get all languages. Returns: JSON object containing all languages.
Inputs: no named parameters. Returns: result
get_most_popular_moviesA
Get the most popular movies from IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 most popular movies starting from the specified index.
Inputs: start (required). Returns: result
get_most_popular_tv_showsA
Get the most popular TV shows from IMDb with pagination. Args: start: The starting index (0-based) to retrieve TV shows from. Returns: JSON object containing 5 most popular TV shows starting from the specified index.
Inputs: start (required). Returns: result
get_top_250_moviesA
Get the top 250 movies from IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top movies starting from the specified index.
Inputs: start (required). Returns: result
get_top_250_tv_showsA
Get the top 250 TV shows from IMDb with pagination. Args: start: The starting index (0-based) to retrieve TV shows from. Returns: JSON object containing 5 top TV shows starting from the specified index.
Inputs: start (required). Returns: result
get_top_box_office_usA
Get the top box office data for the US from IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top box office movies starting from the specified index.
Inputs: start (required). Returns: result
get_top_rated_indian_moviesA
Top 250 rated Indian movies on IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Indian movies starting from the specified index.
Inputs: start (required). Returns: result
get_top_rated_malayalam_moviesB
Top 50 Malayalam movies as rated by the IMDb users. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Malayalam movies starting from the specified index.
Inputs: start (required). Returns: result
get_top_rated_tamil_moviesB
Top 50 rated Tamil movies on IMDb. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Tamil movies starting from the specified index.
Inputs: start (required). Returns: result
get_top_rated_telugu_moviesB
Top 50 rated Telugu movies on IMDb. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Telugu movies starting from the specified index.
Inputs: start (required). Returns: result
get_trending_tamil_moviesA
Get the trending Tamil movies on IMDb. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 trending Tamil movies starting from the specified index.
Inputs: start (required). Returns: result
get_trending_telugu_moviesA
Get the trending Telugu movies on IMDb. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 trending Telugu movies starting from the specified index.
Inputs: start (required). Returns: result
get_typesC
Get all types. Returns: JSON object containing all types.
Inputs: no named parameters. Returns: result
get_upcoming_indian_moviesA
Get the most anticipated Indian movies on IMDb based on real-time popularity. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 most anticipated Indian movies starting from the specified index.
Inputs: start (required). Returns: result
get_upcoming_releasesB
Get the upcoming releases from IMDb with pagination. Args: country_code: The country code to get the upcoming releases for. type: The type of the upcoming releases to get. Possible values: "TV", "MOVIE". start: The starting index (0-based) to retrieve releases from. Returns: JSON object containing 5 upcoming releases starting from the specified index.
Inputs: country_code (required), type (required), start (required). Returns: result
get_writersB
Get the writers of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get writers for. Returns: JSON object containing the writers of the movie.
Inputs: imdb_id (required). Returns: result
search_imdbA
Search for movies on IMDb. First 5 results are returned. Args: original_title: The original title of the movie to search for. Searches the whole word. original_title_autocomplete: The autocomplete title of the movie to search for. Searches the partial word. primary_title: The primary title of the movie to search for. Searches the whole word. primary_title_autocomplete: The autocomplete primary title of the movie to search for. Searches the partial word. type: The type of the movie to search for. Get all possible types with get_types(). genre: The genre of the movie to search for. Get all possible genres with get_genres(). genres: The genres of the movie to search for. List of Genres. Get all possible genres with get_genres(). is_adult: Whether to include adult movies in the search results. average_rating_from: The minimum average rating of the movie to search for. average_rating_to: The maximum average rating of the movie to search for. num_votes_from: The minimum number of votes of the movie to search for. num_votes_to: The maximum number of votes of the movie to search for. start_year_from: The minimum start year of the movie to search for. start_year_to: The maximum start year of the movie to search for. countries_of_origin: The countries of origin of the movie to search for. In ISO 3166-1 alpha-2 format list of strings. Get all possible countries with get_countries(). spoken_languages: The spoken languages of the movie to search for. In ISO 639-1 format list of strings. Get all possible languages with get_languages(). sort_order: The order of the search results. Possible values: "ASC", "DESC". sort_field: The field to sort the search results by. Possible values: "id", "averageRating", "numVotes", "startYear". Returns: JSON object containing the first 5 search results.
Inputs: original_title, original_title_autocomplete, primary_title, primary_title_autocomplete, +14 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes, but there is some overlap in the 'get_top_rated_*' and 'get_trending_*' tools for regional movies, which could cause confusion when selecting between them. However, descriptions clarify the specific regions, reducing ambiguity.
All tool names follow a consistent 'get_*' verb_noun pattern with snake_case, making them predictable and easy to understand. There are no deviations in naming conventions across the 23 tools.
With 23 tools, the count is borderline high for an IMDb server, as it includes many specialized regional and category-specific tools that might be overkill. While comprehensive, it could feel heavy compared to a more streamlined set.
The tool set covers core IMDb functionalities like search, details, cast, directors, writers, genres, languages, and various rankings. Minor gaps include lack of update/delete operations (not typical for IMDb) and limited pagination control, but agents can work around these.
Maintenance
Related MCP Connectors
Unlock a world of television with the TV Maze MCP server. Effortlessly search for shows by name or
Movie and series ranking as MCP tools: top titles, search, lookup by IMDb id. Free, no key.
IMDB MCP — title metadata, ratings, episodes, and crew from IMDB's official non-commercial bulk…
OMDb MCP — IMDB-derived movie / TV / episode data (BYO key)
Related MCP Servers
- AlicenseDqualityDmaintenanceAn MCP server that allows users to search for movies, get detailed information, receive genre-based recommendations, and discover popular/trending films using OMDb and TMDb APIs.5MIT
- AlicenseAqualityDmaintenanceA MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.2311 npm4MIT
- FlicenseAqualityDmaintenanceAn MCP server that wraps The Movie Database (TMDB) API, enabling search for movies and TV shows, retrieval of movie details, recommendations, similar movies, trending content, streaming providers, and movie discovery.8-
- FlicenseAqualityDmaintenanceAn MCP server that wraps the TMDB API, enabling search of movies and TV shows, retrieval of details, trending titles, recommendations, and streaming provider information.8-