MCP 使用样例

初始化连接

POST /mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": { "capabilities": {} }
}

列出工具

POST /mcp
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list"
}

调用工具 — 视频翻译

POST /mcp
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "translate_video",
    "arguments": {
      "videoPath": "/Users/test/demo.mp4",
      "sourceLanguage": "en",
      "targetLanguage": "zh",
      "title": "MCP 翻译任务"
    }
  }
}

调用工具 — 字幕抹除

POST /mcp
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "remove_subtitles",
    "arguments": {
      "inputPath": "/Users/test/demo.mp4"
    }
  }
}

调用工具 — 视频加工

POST /mcp
{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "tools/call",
  "params": {
    "name": "process_video",
    "arguments": {
      "inputPath": "/Users/test/demo.mp4",
      "codec": "h265",
      "bitrate": "5M"
    }
  }
}