项目简介
entertainment-mcp 是一个实现了Model Context Protocol (MCP) 的服务器端应用,旨在让AI助手能够轻松访问OMDB和TMDB两大娱乐内容数据库,查询电影、电视剧、演员信息,获取流行趋势,并根据用户偏好提供个性化推荐。它通过标准化的JSON-RPC协议与LLM客户端通信,是构建智能娱乐助手的理想后端。
主要功能点
- 电影/电视剧详情查询: 根据标题获取电影、电视剧、剧集等详细信息(包括IMDb ID、评分、剧情、海报、上线平台等)。
- 热门/流行内容发现: 获取当前流行或趋势电影及电视剧列表。
- 类型过滤与推荐: 根据指定类型(如“电影”或“电视剧”)和体裁(如“动作片”、“喜剧片”)发现内容,并支持根据发布年份和最低IMDb评分进行推荐。
- 演员信息与作品查询: 搜索演员信息,并通过演员ID发现其参演的电影或电视剧。
- 电影收藏搜索与详情: 搜索电影系列(Collections)并获取其包含的所有电影详情。
安装步骤
- 克隆仓库:
git clone https://github.com/Rohit-KK15/entertainment-mcp.git - 进入项目目录:
cd entertainment-mcp - 安装依赖:
npm install - 编译TypeScript:
npm run build
服务器配置
MCP客户端需要以下信息来连接和使用此MCP服务器。您需要将以下JSON配置添加到您的MCP客户端设置中:
{ "name": "Entertainment MCP Server", "command": "node", "args": [ "./dist/index.js" ], "env": { "OMDB_API_KEY": "YOUR_OMDB_API_KEY", "TMDB_API_KEY": "YOUR_TMDB_API_KEY" }, "description": "连接到娱乐内容MCP服务器,获取电影、电视剧、演员和收藏等信息。", "tools": [ { "name": "GET_OMDB_INFO", "description": "获取电影、电视剧或剧集的详细信息(基于OMDB)。", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "要搜索的电影、电视剧或剧集的标题", "required": true }, "type": { "type": "string", "enum": ["movie", "series", "episode"], "description": "指定搜索类型:电影、剧集或剧集", "optional": true } } } }, { "name": "GET_TMDB_SEARCH_COLLECTIONS", "description": "按名称搜索电影收藏系列(基于TMDB)。", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "要搜索的收藏系列名称", "required": true } } } }, { "name": "GET_TMDB_COLLECTION_DETAILS", "description": "根据ID获取特定电影收藏系列的详细信息(基于TMDB)。", "parameters": { "type": "object", "properties": { "collectionId": { "type": "number", "description": "要获取详情的收藏系列ID", "required": true } } } }, { "name": "GET_TMDB_INFO", "description": "获取电影或电视剧的详细信息(基于TMDB)。", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "要搜索的电影或电视剧的标题", "required": true }, "type": { "type": "string", "enum": ["movie", "tv"], "description": "指定搜索类型:电影或电视剧", "required": true } } } }, { "name": "GET_TMDB_DISCOVER_BY_ACTOR", "description": "根据演员ID发现电影或电视剧(基于TMDB)。", "parameters": { "type": "object", "properties": { "actorId": { "type": "number", "description": "要发现娱乐内容的演员ID", "required": true }, "mediaType": { "type": "string", "enum": ["movie", "tv"], "description": "要发现的媒体类型:电影或电视剧", "required": true }, "releaseYear": { "type": "number", "description": "娱乐内容的发布年份", "optional": true } } } }, { "name": "GET_TMDB_BY_GENRE", "description": "根据类型和体裁获取电影或电视剧列表(基于TMDB)。", "parameters": { "type": "object", "properties": { "mediaType": { "type": "string", "enum": ["movie", "tv"], "description": "要搜索的媒体类型:电影或电视剧", "required": true }, "genre": { "type": "string", "description": "要搜索的体裁名称", "required": true } } } }, { "name": "GET_TMDB_POPULAR", "description": "获取热门电影或电视剧列表(基于TMDB)。", "parameters": { "type": "object", "properties": { "mediaType": { "type": "string", "enum": ["movie", "tv"], "description": "要搜索的媒体类型:电影或电视剧", "required": true } } } }, { "name": "GET_TMDB_SEARCH_MOVIE_BY_TITLE", "description": "通过标题搜索电影(基于TMDB)。", "parameters": { "type": "object", "properties": { "title": { "type": "string", "description": "要搜索的电影标题", "required": true } } } }, { "name": "GET_TMDB_PERSON_SEARCH", "description": "按名称搜索人物(演员)(基于TMDB)。", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "要搜索的人物(演员)名称", "required": true } } } }, { "name": "GET_TMDB_SEARCH_TV_BY_TITLE", "description": "通过标题搜索电视剧(基于TMDB)。", "parameters": { "type": "object", "properties": { "title": { "type": "string", "description": "要搜索的电视剧标题", "required": true } } } }, { "name": "GET_ENTERTAINMENT_SUGGESTIONS", "description": "根据体裁、发布年份和最低IMDb评分提供娱乐内容建议。", "parameters": { "type": "object", "properties": { "mediaType": { "type": "string", "enum": ["movie", "tv"], "description": "要建议的媒体类型:电影或电视剧", "required": true }, "genre": { "type": "string", "description": "要建议的娱乐体裁", "required": true }, "releaseYear": { "type": "number", "description": "娱乐内容的发布年份", "optional": true }, "minImdbRating": { "type": "number", "minimum": 1, "maximum": 10, "description": "最低IMDb评分(1-10)", "optional": true } } } }, { "name": "GET_TMDB_TRENDING", "description": "获取热门电影或电视剧列表(基于TMDB)。", "parameters": { "type": "object", "properties": { "mediaType": { "type": "string", "enum": ["all", "movie", "tv"], "description": "要搜索的媒体类型:全部、电影或电视剧", "required": true }, "timeWindow": { "type": "string", "enum": ["day", "week"], "description": "热门时间窗口:日或周", "required": true } } } } ] }
请注意:
- 'YOUR_OMDB_API_KEY' 和 'YOUR_TMDB_API_KEY' 必须替换为从 OMDB 和 TMDB 官方网站获取的有效API密钥。
- 'command' 和 'args' 定义了启动服务器的命令,通常MCP客户端会自动管理这个过程。
- 'tools' 部分列出了服务器提供的所有工具及其详细参数说明,LLM客户端将使用这些信息来了解如何调用这些功能。
基本使用方法
启动服务器后,它会通过标准输入/输出(stdio)等待MCP客户端的JSON-RPC请求。例如,一个LLM客户端可能会发送一个请求来调用 'GET_TMDB_INFO' 工具,以获取某部电影的详细信息。服务器将处理该请求,调用TMDB API,并将格式化的结果通过JSON-RPC响应返回给客户端。
信息
分类
网页与API