0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Desktop に Docker を使って MCP Server を構築する方法 ~③YouTubeTranscript編~

Posted at

以下は、YouTube Transcript MCP Server を Windows に Docker Desktop を使って構築する手順をまとめたものです。

1. ソフトウェアのインストールとClaude の開発者モードを有効化

未実施の場合は以下を参照してください。

Claude Desktop に Docker を使って MCP Server を構築する方法 ~①Systemfile編~

2. YouTube Transcript MCP Server のソースコードの取得

YouTube Transcript MCP Server のソースコードを取得します。

https://github.com/kimtaeyoon83/mcp-server-youtube-transcript
cd mcp-server-youtube-transcript

※私は以下のディレクトリで実行しました。
C:/Users/username/mcp_projects

3. YouTube Transcript MCP Server の Docker イメージのビルド

先ほど取得した YouTube Transcript MCP Server のソースの Dockerfile を編集します。

# Stage 1: Build the application
FROM node:18-alpine AS builder

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
+ RUN npm install --ignore-scripts

# Copy the rest of the application
COPY . .

# Build the application
RUN npm run build

# Stage 2: Create the production image
FROM node:18-alpine AS production

# Set working directory
WORKDIR /app

# Copy the built files from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package-lock.json /app/

# Install production dependencies only
+ RUN npm ci --omit=dev --ignore-scripts

# Specify the default command
ENTRYPOINT ["node", "dist/index.js"]

その後、ビルドし、Docker イメージを作成します。

docker build -t mcp-server-youtube-transcript:latest -f Dockerfile .

4. Claude Desktop用設定ファイルの編集

Claude Desktop が YouTube Transcript MCP Server をハンドリングできるように設定ファイルを変更します。

image.png

image.png

Claude Desktopの設定ファイル(例: claude_desktop_config.json)に以下を追記します。

{
  "mcpServers": {
    "filesystem": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount", "type=bind,src=<YOUR_LOCAL_PATH>,dst=/projects/<MOUNT_POINT>",
        "mcp/filesystem",
        "/projects"
      ]
    },
    "searxng": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SEARXNG_URL",
        "mcp-server-searxng:latest"
      ],
      "env": {
        "SEARXNG_URL": "http://host.docker.internal:8080"
      }
+    },
+    "youtube-transcript": {
+      "command": "docker",
+      "args": [
+        "run",
+        "-i",
+        "--rm",
+        "mcp-server-youtube-transcript:latest"
+      ]
    }
  }
}

5. 動作確認

Claude Desktopを再起動します。

※ ウィンドウを閉じるだけでなく、以下から完全に終了させます。

image.png

Claude Desktop 再起動時に、YouTube Transcript MCP Server のコンテナが自動で立ち上がります。

image.png

Claude に次のようなプロンプトを送って動作確認します:

[対象のYouTube動画のURL] の字幕を取得し、まとめて。

ツールを使用するか確認が入るので、許可して継続します。

image.png

まとめてくれたら成功です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?