@lonzzi/tmdb-mcp-server 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 lonzzi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -4,10 +4,12 @@ A Model Context Protocol (MCP) server that allows LLMs to search for movies and
4
4
 
5
5
  ## Features
6
6
 
7
- - **Search Movies**: Find movies by title and get metadata including ID, URL, release date, rating, and overview.
8
- - **Search TV Shows**: Find TV shows by title and get metadata including ID, URL, first air date, rating, and overview.
7
+ - **Search Movies**: Find movies by title with support for region and language.
8
+ - **Search TV Shows**: Find TV shows by title with language support.
9
+ - **Get Details**: Retrieve detailed metadata for movies and TV shows (runtime, budget, seasons, etc.).
10
+ - **Trending**: Discover today's or this week's trending movies and TV shows.
11
+ - **Search People**: Search for actors, directors, and other crew members.
9
12
  - **Direct Links**: Provides TMDb URLs for easy access to more details.
10
- - **Top Results**: Returns the top 5 most relevant results for each query.
11
13
 
12
14
  ## Prerequisites
13
15
 
@@ -28,7 +30,7 @@ To use this server with Claude Desktop, add it to your `claude_desktop_config.js
28
30
  "mcpServers": {
29
31
  "tmdb": {
30
32
  "command": "npx",
31
- "args": ["@lonzzi/tmdb-mcp-server"],
33
+ "args": ["-y", "@lonzzi/tmdb-mcp-server"],
32
34
  "env": {
33
35
  "TMDB_API_KEY": "your_api_key_here"
34
36
  }
@@ -39,12 +41,16 @@ To use this server with Claude Desktop, add it to your `claude_desktop_config.js
39
41
 
40
42
  ## Available Tools
41
43
 
44
+ All tools support an optional `language` argument (e.g., `en-US`, `zh-CN`, `fr-FR`) to get localized results. Default is `en-US`.
45
+
42
46
  ### `search_movies`
43
47
 
44
48
  Search for movies on TMDB by title.
45
49
 
46
50
  - **Arguments**:
47
51
  - `query` (string, required): The movie title to search for.
52
+ - `language` (string, optional): Language code (default: `en-US`).
53
+ - `region` (string, optional): ISO 3166-1 code to filter release dates (e.g., `US`, `KR`).
48
54
 
49
55
  ### `search_tv_shows`
50
56
 
@@ -52,6 +58,47 @@ Search for TV shows on TMDB by title.
52
58
 
53
59
  - **Arguments**:
54
60
  - `query` (string, required): The TV show title to search for.
61
+ - `language` (string, optional): Language code (default: `en-US`).
62
+
63
+ ### `get_movie_details`
64
+
65
+ Get detailed information about a specific movie.
66
+
67
+ - **Arguments**:
68
+ - `movieId` (number, required): The TMDB ID of the movie.
69
+ - `language` (string, optional): Language code (default: `en-US`).
70
+
71
+ ### `get_tv_show_details`
72
+
73
+ Get detailed information about a specific TV show.
74
+
75
+ - **Arguments**:
76
+ - `tvShowId` (number, required): The TMDB ID of the TV show.
77
+ - `language` (string, optional): Language code (default: `en-US`).
78
+
79
+ ### `get_trending_movies`
80
+
81
+ Get the daily or weekly trending movies.
82
+
83
+ - **Arguments**:
84
+ - `timeWindow` (string, optional): `day` or `week` (default: `week`).
85
+ - `language` (string, optional): Language code (default: `en-US`).
86
+
87
+ ### `get_trending_tv`
88
+
89
+ Get the daily or weekly trending TV shows.
90
+
91
+ - **Arguments**:
92
+ - `timeWindow` (string, optional): `day` or `week` (default: `week`).
93
+ - `language` (string, optional): Language code (default: `en-US`).
94
+
95
+ ### `search_person`
96
+
97
+ Search for people (actors, directors, etc.).
98
+
99
+ - **Arguments**:
100
+ - `query` (string, required): The name to search for.
101
+ - `language` (string, optional): Language code (default: `en-US`).
55
102
 
56
103
  ## Development
57
104
 
package/build/index.js CHANGED
@@ -23,10 +23,15 @@ server.registerTool("search_movies", {
23
23
  description: "Search for movies on TMDB by title to get metadata like overview, release date, and rating",
24
24
  inputSchema: zod_1.z.object({
25
25
  query: zod_1.z.string().describe("The movie title to search for"),
26
+ language: zod_1.z
27
+ .string()
28
+ .optional()
29
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
30
+ region: zod_1.z.string().optional().describe("Region code (e.g. 'US', 'FR')"),
26
31
  }),
27
- }, async ({ query }) => {
32
+ }, async ({ query, language, region }) => {
28
33
  try {
29
- const result = await (0, tmdb_1.searchMovies)(API_KEY, query);
34
+ const result = await (0, tmdb_1.searchMovies)(API_KEY, query, language, region);
30
35
  return {
31
36
  content: [
32
37
  {
@@ -52,10 +57,185 @@ server.registerTool("search_tv_shows", {
52
57
  description: "Search for TV shows on TMDB by title to get metadata like overview, first air date, and rating",
53
58
  inputSchema: zod_1.z.object({
54
59
  query: zod_1.z.string().describe("The TV show title to search for"),
60
+ language: zod_1.z
61
+ .string()
62
+ .optional()
63
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
55
64
  }),
56
- }, async ({ query }) => {
65
+ }, async ({ query, language }) => {
57
66
  try {
58
- const result = await (0, tmdb_1.searchTvShows)(API_KEY, query);
67
+ const result = await (0, tmdb_1.searchTvShows)(API_KEY, query, language);
68
+ return {
69
+ content: [
70
+ {
71
+ type: "text",
72
+ text: JSON.stringify(result, null, 2),
73
+ },
74
+ ],
75
+ };
76
+ }
77
+ catch (error) {
78
+ return {
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: error.message || "Unknown error occurred",
83
+ },
84
+ ],
85
+ isError: true,
86
+ };
87
+ }
88
+ });
89
+ server.registerTool("get_movie_details", {
90
+ description: "Get detailed information about a specific movie by its ID",
91
+ inputSchema: zod_1.z.object({
92
+ movieId: zod_1.z.number().describe("The ID of the movie"),
93
+ language: zod_1.z
94
+ .string()
95
+ .optional()
96
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
97
+ }),
98
+ }, async ({ movieId, language }) => {
99
+ try {
100
+ const result = await (0, tmdb_1.getMovieDetails)(API_KEY, movieId, language);
101
+ return {
102
+ content: [
103
+ {
104
+ type: "text",
105
+ text: JSON.stringify(result, null, 2),
106
+ },
107
+ ],
108
+ };
109
+ }
110
+ catch (error) {
111
+ return {
112
+ content: [
113
+ {
114
+ type: "text",
115
+ text: error.message || "Unknown error occurred",
116
+ },
117
+ ],
118
+ isError: true,
119
+ };
120
+ }
121
+ });
122
+ server.registerTool("get_tv_show_details", {
123
+ description: "Get detailed information about a specific TV show by its ID",
124
+ inputSchema: zod_1.z.object({
125
+ tvShowId: zod_1.z.number().describe("The ID of the TV show"),
126
+ language: zod_1.z
127
+ .string()
128
+ .optional()
129
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
130
+ }),
131
+ }, async ({ tvShowId, language }) => {
132
+ try {
133
+ const result = await (0, tmdb_1.getTvShowDetails)(API_KEY, tvShowId, language);
134
+ return {
135
+ content: [
136
+ {
137
+ type: "text",
138
+ text: JSON.stringify(result, null, 2),
139
+ },
140
+ ],
141
+ };
142
+ }
143
+ catch (error) {
144
+ return {
145
+ content: [
146
+ {
147
+ type: "text",
148
+ text: error.message || "Unknown error occurred",
149
+ },
150
+ ],
151
+ isError: true,
152
+ };
153
+ }
154
+ });
155
+ server.registerTool("get_trending_movies", {
156
+ description: "Get a list of trending movies",
157
+ inputSchema: zod_1.z.object({
158
+ timeWindow: zod_1.z
159
+ .enum(["day", "week"])
160
+ .optional()
161
+ .describe("Time window for trending content (default: week)"),
162
+ language: zod_1.z
163
+ .string()
164
+ .optional()
165
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
166
+ }),
167
+ }, async ({ timeWindow = "week", language }) => {
168
+ try {
169
+ const result = await (0, tmdb_1.getTrendingMovies)(API_KEY, timeWindow, language);
170
+ return {
171
+ content: [
172
+ {
173
+ type: "text",
174
+ text: JSON.stringify(result, null, 2),
175
+ },
176
+ ],
177
+ };
178
+ }
179
+ catch (error) {
180
+ return {
181
+ content: [
182
+ {
183
+ type: "text",
184
+ text: error.message || "Unknown error occurred",
185
+ },
186
+ ],
187
+ isError: true,
188
+ };
189
+ }
190
+ });
191
+ server.registerTool("get_trending_tv", {
192
+ description: "Get a list of trending TV shows",
193
+ inputSchema: zod_1.z.object({
194
+ timeWindow: zod_1.z
195
+ .enum(["day", "week"])
196
+ .optional()
197
+ .describe("Time window for trending content (default: week)"),
198
+ language: zod_1.z
199
+ .string()
200
+ .optional()
201
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
202
+ }),
203
+ }, async ({ timeWindow = "week", language }) => {
204
+ try {
205
+ const result = await (0, tmdb_1.getTrendingTvShows)(API_KEY, timeWindow, language);
206
+ return {
207
+ content: [
208
+ {
209
+ type: "text",
210
+ text: JSON.stringify(result, null, 2),
211
+ },
212
+ ],
213
+ };
214
+ }
215
+ catch (error) {
216
+ return {
217
+ content: [
218
+ {
219
+ type: "text",
220
+ text: error.message || "Unknown error occurred",
221
+ },
222
+ ],
223
+ isError: true,
224
+ };
225
+ }
226
+ });
227
+ server.registerTool("search_person", {
228
+ description: "Search for people (actors, directors, etc.) on TMDB",
229
+ inputSchema: zod_1.z.object({
230
+ query: zod_1.z.string().describe("The name of the person to search for"),
231
+ language: zod_1.z
232
+ .string()
233
+ .optional()
234
+ .describe("Language code (e.g. 'en-US', 'zh-CN')"),
235
+ }),
236
+ }, async ({ query, language }) => {
237
+ try {
238
+ const result = await (0, tmdb_1.searchPeople)(API_KEY, query, language);
59
239
  return {
60
240
  content: [
61
241
  {
package/build/tmdb.js CHANGED
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.searchTvShows = exports.searchMovies = void 0;
6
+ exports.searchPeople = exports.getTrendingTvShows = exports.getTrendingMovies = exports.getTvShowDetails = exports.getMovieDetails = exports.searchTvShows = exports.searchMovies = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
- const searchMovies = async (apiKey, query) => {
8
+ const searchMovies = async (apiKey, query, language = "en-US", region) => {
9
9
  if (!query) {
10
10
  throw new Error("Query argument is required");
11
11
  }
@@ -14,7 +14,8 @@ const searchMovies = async (apiKey, query) => {
14
14
  params: {
15
15
  api_key: apiKey,
16
16
  query: query,
17
- language: "en-US",
17
+ language: language,
18
+ ...(region && { region }),
18
19
  page: 1,
19
20
  },
20
21
  });
@@ -28,7 +29,7 @@ const searchMovies = async (apiKey, query) => {
28
29
  }
29
30
  };
30
31
  exports.searchMovies = searchMovies;
31
- const searchTvShows = async (apiKey, query) => {
32
+ const searchTvShows = async (apiKey, query, language = "en-US") => {
32
33
  if (!query) {
33
34
  throw new Error("Query argument is required");
34
35
  }
@@ -37,7 +38,7 @@ const searchTvShows = async (apiKey, query) => {
37
38
  params: {
38
39
  api_key: apiKey,
39
40
  query: query,
40
- language: "en-US",
41
+ language: language,
41
42
  page: 1,
42
43
  },
43
44
  });
@@ -51,3 +52,98 @@ const searchTvShows = async (apiKey, query) => {
51
52
  }
52
53
  };
53
54
  exports.searchTvShows = searchTvShows;
55
+ const getMovieDetails = async (apiKey, movieId, language = "en-US") => {
56
+ try {
57
+ const response = await axios_1.default.get(`https://api.themoviedb.org/3/movie/${movieId}`, {
58
+ params: {
59
+ api_key: apiKey,
60
+ language: language,
61
+ },
62
+ });
63
+ return response.data;
64
+ }
65
+ catch (error) {
66
+ if (axios_1.default.isAxiosError(error)) {
67
+ throw new Error(`TMDB API Error: ${error.message}`);
68
+ }
69
+ throw error;
70
+ }
71
+ };
72
+ exports.getMovieDetails = getMovieDetails;
73
+ const getTvShowDetails = async (apiKey, tvShowId, language = "en-US") => {
74
+ try {
75
+ const response = await axios_1.default.get(`https://api.themoviedb.org/3/tv/${tvShowId}`, {
76
+ params: {
77
+ api_key: apiKey,
78
+ language: language,
79
+ },
80
+ });
81
+ return response.data;
82
+ }
83
+ catch (error) {
84
+ if (axios_1.default.isAxiosError(error)) {
85
+ throw new Error(`TMDB API Error: ${error.message}`);
86
+ }
87
+ throw error;
88
+ }
89
+ };
90
+ exports.getTvShowDetails = getTvShowDetails;
91
+ const getTrendingMovies = async (apiKey, timeWindow = "week", language = "en-US") => {
92
+ try {
93
+ const response = await axios_1.default.get(`https://api.themoviedb.org/3/trending/movie/${timeWindow}`, {
94
+ params: {
95
+ api_key: apiKey,
96
+ language: language,
97
+ },
98
+ });
99
+ return response.data.results.slice(0, 10);
100
+ }
101
+ catch (error) {
102
+ if (axios_1.default.isAxiosError(error)) {
103
+ throw new Error(`TMDB API Error: ${error.message}`);
104
+ }
105
+ throw error;
106
+ }
107
+ };
108
+ exports.getTrendingMovies = getTrendingMovies;
109
+ const getTrendingTvShows = async (apiKey, timeWindow = "week", language = "en-US") => {
110
+ try {
111
+ const response = await axios_1.default.get(`https://api.themoviedb.org/3/trending/tv/${timeWindow}`, {
112
+ params: {
113
+ api_key: apiKey,
114
+ language: language,
115
+ },
116
+ });
117
+ return response.data.results.slice(0, 10);
118
+ }
119
+ catch (error) {
120
+ if (axios_1.default.isAxiosError(error)) {
121
+ throw new Error(`TMDB API Error: ${error.message}`);
122
+ }
123
+ throw error;
124
+ }
125
+ };
126
+ exports.getTrendingTvShows = getTrendingTvShows;
127
+ const searchPeople = async (apiKey, query, language = "en-US") => {
128
+ if (!query) {
129
+ throw new Error("Query argument is required");
130
+ }
131
+ try {
132
+ const response = await axios_1.default.get("https://api.themoviedb.org/3/search/person", {
133
+ params: {
134
+ api_key: apiKey,
135
+ query: query,
136
+ language: language,
137
+ page: 1,
138
+ },
139
+ });
140
+ return response.data.results.slice(0, 5);
141
+ }
142
+ catch (error) {
143
+ if (axios_1.default.isAxiosError(error)) {
144
+ throw new Error(`TMDB API Error: ${error.message}`);
145
+ }
146
+ throw error;
147
+ }
148
+ };
149
+ exports.searchPeople = searchPeople;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lonzzi/tmdb-mcp-server",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "MCP server for searching movies on TMDB",
5
5
  "main": "build/index.js",
6
6
  "bin": {
@@ -15,9 +15,9 @@
15
15
  "files": [
16
16
  "build"
17
17
  ],
18
- "keywords": [],
18
+ "keywords": ["tmdb", "mcp", "modelcontextprotocol", "movie", "tv show", "search"],
19
19
  "author": "",
20
- "license": "ISC",
20
+ "license": "MIT",
21
21
  "homepage": "https://github.com/lonzzi/tmdb-mcp-server",
22
22
  "repository": {
23
23
  "type": "git",