mcp-server-tmdb
このTMDB MCPサーバーは、The Movie Database APIと統合されており、映画情報、検索機能、推薦機能を提供します。Node.jsとTypeScriptを使用して構築されており、映画関連のアプリケーション開発に役立ちます。
GitHubスター
50
ユーザー評価
未評価
お気に入り
0
閲覧数
17
フォーク
16
イシュー
3
インストール方法
難易度
中級推定所要時間
10-20 分
必要な環境
Node.js 18.0.0以上
npm 8.0.0以上
+1 more
インストール方法
インストール方法
前提条件
必要なソフトウェアとバージョンを明記してください。Node.js: 18.0.0以上
npm: 8.0.0以上
Claude Desktop: 最新版
インストール手順
1. リポジトリのクローン
bash
git clone https://github.com/Laksh-star/mcp-server-tmdb
cd mcp-server-tmdb
2. 依存関係のインストール
bash
npm install
3. Claude Desktop設定
claude_desktop_config.json
を編集してMCPサーバーを追加:
json
{
"mcpServers": {
"mcp-server-tmdb": {
"command": "node",
"args": ["server.js"]
}
}
}
4. サーバーの起動
bash
npm start
トラブルシューティング
よくある問題
問題: サーバーが起動しない 解決策: Node.jsのバージョンを確認し、依存関係を再インストールしてください。 問題: Claude Desktopで認識されない 解決策: 設定ファイルのパスと構文を確認してください。設定方法
設定方法
基本設定
Claude Desktop設定
~/.config/claude-desktop/claude_desktop_config.json
(macOS/Linux)または
%APPDATA%\Claude\claude_desktop_config.json
(Windows)を編集:
json
{
"mcpServers": {
"mcp-server-tmdb": {
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
環境変数
必要に応じて以下の環境変数を設定:bash
export API_KEY="your-api-key"
export DEBUG="true"
詳細設定
セキュリティ設定
APIキーは環境変数または安全な設定ファイルに保存
ファイルアクセス権限の適切な設定
ログレベルの調整
パフォーマンス調整
タイムアウト値の設定
同時実行数の制限
キャッシュ設定
設定例
基本的な設定
json
{
"mcpServers": {
"mcp-server-tmdb": {
"command": "node",
"args": ["server.js"],
"env": {
"PORT": "3000",
"LOG_LEVEL": "info"
}
}
}
}
高度な設定
json
{
"mcpServers": {
"advanced-mcp": {
"command": "python",
"args": ["-m", "server"],
"cwd": "/path/to/server",
"env": {
"PYTHONPATH": "/path/to/modules",
"CONFIG_FILE": "/path/to/config.json"
}
}
}
}
使用例
使用例
基本的な使用方法
MCPサーバーの基本的な使用方法を以下に示します:Claude Desktopでの使用
1MCPサーバーの起動確認
Claude Desktopを開き、設定が正しく読み込まれていることを確認してください。
2基本コマンドの実行
Available tools from this MCP server:
- search_movies: Search for movies by title or keywords
- get_recommendations: Get movie recommendations based on a movie ID
- get_trending: Get trending movies for a specified time window
プログラムでの使用
javascript
// JavaScript例(Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// ツールの実行
const result = await client.callTool('search_movies', {
query: 'space exploration'
});
console.log(result);
応用例
自動化スクリプト
bash
#!/bin/bash
バッチ処理の例
for file in *.txt; do
mcp-tool process "$file"
done
API統合
python
Python例
import requests
import json
def call_mcp_tool(tool_name, params):
response = requests.post(
'http://localhost:3000/mcp/call',
json={
'tool': tool_name,
'parameters': params
}
)
return response.json()
使用例
result = call_mcp_tool('get_recommendations', {
'movieId': '550'
})
使用ケース
映画のタイトルやキーワードを入力して、関連する映画を検索する。
特定の映画IDを使用して、ユーザーにおすすめの映画を表示する。
今日のトレンド映画を取得し、映画レビューサイトに表示する。
映画データを基にしたアプリケーションを開発する際に、TMDB APIから情報を取得する。