@lonzzi/tmdb-mcp-server 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -28,7 +28,7 @@ To use this server with Claude Desktop, add it to your `claude_desktop_config.js
28
28
  "mcpServers": {
29
29
  "tmdb": {
30
30
  "command": "npx",
31
- "args": ["@lonzzi/tmdb-mcp-server"],
31
+ "args": ["-y", "@lonzzi/tmdb-mcp-server"],
32
32
  "env": {
33
33
  "TMDB_API_KEY": "your_api_key_here"
34
34
  }
package/build/index.js CHANGED
@@ -78,6 +78,13 @@ server.registerTool("search_tv_shows", {
78
78
  }
79
79
  });
80
80
  const main = async () => {
81
+ try {
82
+ await (0, tmdb_1.validateApiKey)(API_KEY);
83
+ }
84
+ catch (error) {
85
+ console.error("Failed to validate TMDB_API_KEY:", error.message);
86
+ process.exit(1);
87
+ }
81
88
  const transport = new stdio_js_1.StdioServerTransport();
82
89
  await server.connect(transport);
83
90
  };
package/build/tmdb.js CHANGED
@@ -3,7 +3,7 @@ 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.validateApiKey = exports.searchTvShows = exports.searchMovies = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const searchMovies = async (apiKey, query) => {
9
9
  if (!query) {
@@ -51,3 +51,19 @@ const searchTvShows = async (apiKey, query) => {
51
51
  }
52
52
  };
53
53
  exports.searchTvShows = searchTvShows;
54
+ const validateApiKey = async (apiKey) => {
55
+ try {
56
+ await axios_1.default.get("https://api.themoviedb.org/3/configuration", {
57
+ params: {
58
+ api_key: apiKey,
59
+ },
60
+ });
61
+ }
62
+ catch (error) {
63
+ if (axios_1.default.isAxiosError(error) && error.response?.status === 401) {
64
+ throw new Error("Invalid TMDB_API_KEY. Please check your API key.");
65
+ }
66
+ throw error;
67
+ }
68
+ };
69
+ exports.validateApiKey = validateApiKey;
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.4",
4
4
  "description": "MCP server for searching movies on TMDB",
5
5
  "main": "build/index.js",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "files": [
16
16
  "build"
17
17
  ],
18
- "keywords": [],
18
+ "keywords": ["tmdb", "mcp", "modelcontextprotocol", "movie", "tv show", "search"],
19
19
  "author": "",
20
20
  "license": "ISC",
21
21
  "homepage": "https://github.com/lonzzi/tmdb-mcp-server",