MCP(Model Context Protocol)で動画制作AIエージェントを作る方法

MCPで動画制作AIエージェントを構築

MCP(Model Context Protocol)はAnthropicが策定したオープン標準で、AIモデルと外部ツール・データソースを繋ぐためのプロトコルだ。ClaudeCodeがMCPを通じてAfterEffectsやYouTube APIに直接アクセスできるようになると、「Claudeが自律的に動画制作を進める」エージェントの構築が可能になる。

MCPとは何か:動画制作への応用視点

MCPを使うと、ClaudeやClaudeCodeが以下のようなことを自律的に実行できるようになる。

  • AfterEffectsプロジェクトを開いてレイヤーを操作する
  • YouTubeのアナリティクスデータを取得してパフォーマンスを分析する
  • Googleドライブから素材ファイルを読み込んで処理する
  • 完成した動画をYouTubeに自動投稿する

従来は各APIを個別に叩くコードを書く必要があったが、MCPサーバーを立てることでClaudeが自然言語の指示に従って自律的にツールを使えるようになる。

MCPのアーキテクチャ

Claude / ClaudeCode (Host)
  ↕ MCP Protocol (JSON-RPC over stdio/SSE)
MCP Server(自作またはサードパーティ)
  ├─ tools: 実行可能な操作の一覧
  ├─ resources: 読み取り可能なデータ
  └─ prompts: 再利用可能なプロンプトテンプレート

動画制作用MCPサーバーの実装:TypeScript

基本構造

// video-production-mcp/src/index.ts
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";

const server = new Server(
  { name: "video-production-server", version: "1.0.0" },
  { capabilities: { tools: {} } }
);

// ツール一覧を定義
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: "get_youtube_analytics",
      description: "YouTubeチャンネルの過去7日間のパフォーマンスデータを取得する",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: { type: "string", description: "YouTubeチャンネルID" }
        },
        required: ["channel_id"]
      }
    },
    {
      name: "generate_video_script",
      description: "動画テーマからナレーションスクリプトを生成して保存する",
      inputSchema: {
        type: "object",
        properties: {
          theme: { type: "string" },
          duration_sec: { type: "number" }
        },
        required: ["theme", "duration_sec"]
      }
    },
    {
      name: "upload_to_youtube",
      description: "指定のMP4ファイルをYouTubeにアップロードする",
      inputSchema: {
        type: "object",
        properties: {
          file_path: { type: "string" },
          title: { type: "string" },
          description: { type: "string" }
        },
        required: ["file_path", "title"]
      }
    }
  ]
}));

ツール実行ハンドラー

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  const { name, arguments: args } = request.params;

  if (name === "get_youtube_analytics") {
    const data = await fetchYouTubeAnalytics(args.channel_id);
    return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
  }

  if (name === "generate_video_script") {
    const script = await generateScript(args.theme, args.duration_sec);
    const filePath = await saveScript(script, args.theme);
    return { content: [{ type: "text", text: `スクリプト生成完了: ${filePath}` }] };
  }

  if (name === "upload_to_youtube") {
    const videoUrl = await uploadVideo(args.file_path, args.title, args.description);
    return { content: [{ type: "text", text: `アップロード完了: ${videoUrl}` }] };
  }

  throw new Error(`Unknown tool: ${name}`);
});

// サーバー起動
const transport = new StdioServerTransport();
await server.connect(transport);

ClaudeCodeへのMCPサーバー登録

~/.claude/settings.json または .claude/settings.local.json にMCPサーバーを登録する。

{
  "mcpServers": {
    "video-production": {
      "command": "node",
      "args": ["/path/to/video-production-mcp/build/index.js"],
      "env": {
        "YOUTUBE_API_KEY": "your-key",
        "ANTHROPIC_API_KEY": "your-key"
      }
    }
  }
}

実際にClaudeCodeで使う

MCPサーバーを登録すると、ClaudeCodeのセッション内でツールが使えるようになる。

// ClaudeCodeに以下のように指示するだけ
「先週のYouTubeパフォーマンスを確認して、再生数が低い動画のテーマを特定し、
改善版スクリプトを生成して保存してください」

ClaudeCodeは自律的に get_youtube_analytics → データ分析 → generate_video_script という流れを実行する。

公開されているMCPサーバーの活用

自作しなくても、コミュニティが公開しているMCPサーバーを使える。

  • @modelcontextprotocol/server-google-drive:Googleドライブへのアクセス
  • @modelcontextprotocol/server-youtube:YouTube操作
  • @modelcontextprotocol/server-slack:Slack通知・メッセージ取得
  • @modelcontextprotocol/server-filesystem:ローカルファイル操作

まとめ

MCPはClaudeを「チャットボット」から「自律的に動作するエージェント」に変える仕組みだ。動画制作フローにMCPを組み込むことで、Claudeがファイル取得→スクリプト生成→動画生成→投稿まで自律的に実行できるようになる。まずは公開されているMCPサーバーから試してほしい。

あわせて読みたい

ツール導入で終わらない「本当のDX」を、一緒に作りませんか

AE→Lottie→Remotionの動画自動生成から、業務プロセス全体の自動化まで。
自分で作って動かしている仕組みを、あなたのビジネスにも実装します。

プロダクト・サービス一覧開発実績を見る
タイトルとURLをコピーしました