🎯 Objective & Overview
Expose new Model Context Protocol (MCP) AI tools in LocalLlmMcpTools.cs so external AI agents and IDEs (Antigravity, Claude Desktop, Open WebUI) can trigger video generation, speech synthesis, and audio generation via JSON-RPC.
📂 Files & Components to Touch
- MCP Tools Class (
Services/LocalLlmMcpTools.cs):
- Add
[McpServerTool, Description("Generate video from text prompt or image using ComfyUI DiT pipelines (Wan 2.2, LTX-2.5).")]
public async Task<string> GenerateVideoAsync(string prompt, string workflow = "wan2.2_t2v", int width = 832, int height = 480, int frames = 49)
- Add
[McpServerTool, Description("Synthesize speech audio from text using local Kokoro / AllTalk TTS engine.")]
public async Task<string> SynthesizeSpeechAsync(string text, string voice = "af_heart", string format = "mp3")
- Add
[McpServerTool, Description("Generate sound effects or ambient musical loops from a prompt.")]
public async Task<string> GenerateAudioAsync(string prompt, int durationSeconds = 15)
- Integration Tests (
LocalLLMServerManager.Tests/McpServerIntegrationTests.cs):
- Add test cases verifying MCP tool registration, parameter validation, and mock execution over SSE/HTTP.
🔌 MCP Tool Signatures
{
"name": "generate_video",
"description": "Generate video from text prompt using local ComfyUI",
"inputSchema": {
"type": "object",
"properties": {
"prompt": { "type": "string" },
"workflow": { "type": "string", "enum": ["wan2.2_t2v", "ltx2.5_t2v", "hunyuanvideo1.5_t2v"] },
"frames": { "type": "integer", "default": 49 }
},
"required": ["prompt"]
}
}
🛠️ Step-by-Step Implementation Guide
- Inject
IWorkflowService / HttpClient into LocalLlmMcpTools.cs.
- Implement tool methods with full argument descriptions and error handling.
- Return JSON containing output media URLs and status info.
- Update MCP integration tests and documentation.
🧪 Verification
dotnet test --filter Category!=LiveExternal
npm run lint & npx tsc --noEmit
🎯 Objective & Overview
Expose new Model Context Protocol (MCP) AI tools in
LocalLlmMcpTools.csso external AI agents and IDEs (Antigravity, Claude Desktop, Open WebUI) can trigger video generation, speech synthesis, and audio generation via JSON-RPC.📂 Files & Components to Touch
Services/LocalLlmMcpTools.cs):[McpServerTool, Description("Generate video from text prompt or image using ComfyUI DiT pipelines (Wan 2.2, LTX-2.5).")]public async Task<string> GenerateVideoAsync(string prompt, string workflow = "wan2.2_t2v", int width = 832, int height = 480, int frames = 49)[McpServerTool, Description("Synthesize speech audio from text using local Kokoro / AllTalk TTS engine.")]public async Task<string> SynthesizeSpeechAsync(string text, string voice = "af_heart", string format = "mp3")[McpServerTool, Description("Generate sound effects or ambient musical loops from a prompt.")]public async Task<string> GenerateAudioAsync(string prompt, int durationSeconds = 15)LocalLLMServerManager.Tests/McpServerIntegrationTests.cs):🔌 MCP Tool Signatures
{ "name": "generate_video", "description": "Generate video from text prompt using local ComfyUI", "inputSchema": { "type": "object", "properties": { "prompt": { "type": "string" }, "workflow": { "type": "string", "enum": ["wan2.2_t2v", "ltx2.5_t2v", "hunyuanvideo1.5_t2v"] }, "frames": { "type": "integer", "default": 49 } }, "required": ["prompt"] } }🛠️ Step-by-Step Implementation Guide
IWorkflowService/HttpClientintoLocalLlmMcpTools.cs.🧪 Verification
dotnet test --filter Category!=LiveExternalnpm run lint&npx tsc --noEmit