该项目是Model Context Protocol (MCP)的一个实现,提供了与The Movie Database (TMDB)交互的工具。
<img src=https://www.themoviedb.org/assets/2/v4/logos/v2/blue_short-8e7b30f73a4020692ccca9c88bafe5dcb6f8a62a4c6bc55cd9ba82bb2cd95f6c.svg alt="TMDB logo" width="100%"></img>
The Movie Database (TMDB)是一个流行的、用户可编辑的电影和电视节目数据库。它提供了一个全面的API,允许开发者访问电影和电视节目的数据,包括:
TMDB API是免费使用的,但需要一个API密钥。您可以通过以下步骤获取您的API密钥:
API具有以下速率限制:
有关API的更多信息,请访问TMDB API文档。
git clone https://github.com/leonardogilrodriguez/mcp-tmdb.git
cd mcp-tmdb
pnpm install
.env文件,并添加您的TMDB API密钥:TMDB_API_KEY=your_api_key_here
搜索两个演员共同出现在屏幕上的电影。
参数:
actor1:第一个演员的名字actor2:第二个演员的名字language:(可选)结果语言(默认:"en")搜索两个在任何角色上合作的人的电影。
参数:
person1:第一个人的名字job1:第一个人的工作。可能值:cast, crewperson2:第二个人的名字job2:第二个人的工作。可能值:cast, crewlanguage:(可选)结果语言(默认:"en")搜索在两部电影中以任何角色工作的人。
参数:
movie1:第一部电影的名字year1:(可选)第一部电影的年份movie2:第二部电影的名字year2:(可选)第二部电影的年份language:(可选)结果语言(默认:"en")搜索某人在特定类型中的演员作品。
参数:
person:演员的名字genre:(可选)类型名称language:(可选)结果语言(默认:"en")搜索某人在特定类型中的剧组成员作品。
参数:
person:某人的名字job:(可选)工作名称genre:(可选)类型名称language:(可选)结果语言(默认:"en")提供可用于filmography_crew_genre工具的工作列表。
要运行MCP服务器:
pnpm inspector
要在调试模式下运行:
pnpm dev:debug
mcp-tmdb/
├── API/ # API函数和实用程序
├── interfaces/ # 类型和接口定义
├── tools/ # 工具实现
├── main.ts # 主入口点
├── package.json # 项目配置
└── .env # 环境变量(创建)
要在Claude Desktop中配置此MCP:
"tmdb": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "tsx",
"args": [
"complete_path_to_mcp-tmdb\\main.ts"
],
"env": {
"TMDB_API_KEY": "your_api_key_here"
}
}
当搜索Cary Grant和Katharine Hepburn共同出演的电影时的示例输出:
[
{
"id": 31866,
"title": "Sylvia Scarlett",
"year": 1935,
"media_type": "movie"
},
{
"id": 900,
"title": "Bringing Up Baby",
"year": 1938,
"media_type": "movie"
},
{
"id": 16274,
"title": "Holiday",
"year": 1938,
"media_type": "movie"
},
{
"id": 981,
"title": "The Philadelphia Story",
"year": 1940,
"media_type": "movie"
}
]
当搜索Christopher Nolan和Hans Zimmer的合作时的示例输出:
[
{
"id": 272,
"title": "Batman Begins",
"year": 2005,
"media_type": "movie"
},
{
"id": 155,
"title": "The Dark Knight",
"year": 2008,
"media_type": "movie"
},
{
"id": 27205,
"title": "Inception",
"year": 2010,
"media_type": "movie"
}
...
]
当搜索在两部电影中工作的人:泰坦尼克号和指环王:王者归来时的示例输出:
[{
"id": 1369,
"name": "Bernard Hill",
"known_for_department": "Acting"
},
{
"id": 1327030,
"name": "Lora Hirschberg",
"job": "Sound Re-Recording Mixer",
"known_for_department": "Sound"
},
{
"id": 900,
"name": "Christopher Boyes",
"job": "Sound Re-Recording Mixer",
"known_for_department": "Sound"
},
{
"id": 1378696,
"name": "Ethan Van der Ryn",
"job": "Sound Effects Editor",
"known_for_department": "Sound"
},
{
"id": 1425978,
"name": "Gary Summers",
"job": "Sound Re-Recording Mixer",
"known_for_department": "Sound"
}
]
当搜索Tom Hanks的恐怖电影时的示例输出:
[{
"title": "He Knows You're Alone",
"character": "Elliot",
"media_type": "movie",
"year": 1980
},
{
"title": "The 'Burbs",
"character": "Ray Peterson",
"media_type": "movie",
"year": 1989
},
{
"title": "Vault of Horror I",
"character": "Baxter",
"media_type": "movie",
"year": 1994
}
]
当搜索Steven Spielberg作为导演的喜剧电影时的示例输出:
[{
"title": "The Sugarland Express",
"media_type": "movie",
"year": 1974,
"jobs": [
"Director"
]
},
{
"title": "1941",
"media_type": "movie",
"year": 1979,
"jobs": [
"Director"
]
},
{
"title": "Amazing Stories",
"media_type": "tv",
"year": 1985,
"jobs": [
"Director"
]
},
{
"title": "Hook",
"media_type": "movie",
"year": 1991,
"jobs": [
"Director"
]
},
{
"title": "The Terminal",
"media_type": "movie",
"year": 2004,
"jobs": [
"Director"
]
}
]
可用工作的示例输出:
{
"jobs": [
"Director",
"Producer",
"Screenplay",
"Director of Photography",
"Editor",
"Production Design",
"Art Direction",
"Set Decoration",
"Costume Design",
"Makeup",
"Sound",
"Visual Effects",
"Original Music Composer"
]
}
MIT