Skip to content

feat(mcp): expose video and audio generation tools to MCP server - #16

Closed
spelech wants to merge 2 commits into
mainfrom
feat/mcp-video-audio-tools-9183404126910508512
Closed

feat(mcp): expose video and audio generation tools to MCP server#16
spelech wants to merge 2 commits into
mainfrom
feat/mcp-video-audio-tools-9183404126910508512

Conversation

@spelech

@spelech spelech commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Exposed video generation, speech synthesis, and audio generation tools to the MCP server in Services/LocalLlmMcpTools.cs. Added unit/integration test coverage in LocalLLMServerManager.Tests/McpServerIntegrationTests.cs and type declarations for Playwright test tooling.

Fixes #14


PR created automatically by Jules for task 9183404126910508512 started by @spelech

Expose GenerateVideoAsync, SynthesizeSpeechAsync, and GenerateAudioAsync tools in LocalLlmMcpTools for Model Context Protocol (MCP) JSON-RPC clients. Include comprehensive integration test coverage for tool registration, parameter validation, and HTTP dispatching.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@spelech

spelech commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

Pull Request Review: PR #16 (origin/feat/mcp-video-audio-tools-9183404126910508512)

📋 Overview & Verdict

The changes in this PR cleanly expose video generation, speech synthesis, and audio generation tools to the MCP server in accordance with the Issue #14 specifications. All tool schemas, parameter types, default values, error handling, and test fixtures are fully implemented, passing all unit/integration tests and static analysis.


🔍 Detailed Assessment

1. MCP Tool Implementations (Services/LocalLlmMcpTools.cs)

  • GenerateVideoAsync (generate_video):
    • Correctly attributed with [McpServerTool] and descriptions for AI client discovery.
    • Implements default parameter values: workflow = "wan2.2_t2v", width = 832, height = 480, frames = 49.
    • Performs input validation (prompt null/whitespace check) before issuing HTTP requests.
    • Targets ComfyUI backend endpoint http://127.0.0.1:8188/prompt with proper JSON payload and returns queued media metadata.
  • SynthesizeSpeechAsync (synthesize_speech):
    • Correctly attributed with [McpServerTool] and descriptions.
    • Implements defaults: voice = "af_heart", format = "mp3".
    • Cleans format extension (e.g. trimming leading periods) and handles null/whitespace validation.
    • Dispatches to TTS backend http://127.0.0.1:7851/api/tts.
  • GenerateAudioAsync (generate_audio):
    • Correctly attributed with [McpServerTool] and descriptions.
    • Implements default: durationSeconds = 15.
    • Dispatches to audio engine endpoint http://127.0.0.1:7860/api/audio/generate.
  • Fault Tolerance:
    • All methods safely catch and wrap exceptions into { success = false, error = ex.Message } JSON payloads, preventing JSON-RPC transport drops if backend engines are offline.

2. Test Suite & Verification (LocalLLMServerManager.Tests/McpServerIntegrationTests.cs)

  • Added comprehensive unit and integration tests for all three new tools:
    • Valid prompt/text execution returning expected JSON structure and status.
    • Null, empty, and whitespace input validation returning error JSON.
    • Network exception / offline backend handling returning graceful error responses.
    • Reflection and attribute assertions updated from 8 to 11 expected methods, validating that all parameters have [Description] attributes for MCP discovery.
  • Added Playwright custom matcher type declarations in tests/types.d.ts.

💡 Non-Blocking Suggestions & Future Enhancements

  • Dynamic Port Configuration: Currently, the backend ports (8188, 7851, 7860) use standard defaults. In future iterations, consider reading these endpoints from AppSettings or IAiEngineManager so custom user port configurations are automatically respected.
  • ComfyUI Execution Polling: The video generator creates a reference output URL upon queuing (/output/video_{mediaId}.mp4). Downstream integration could optionally correlate ComfyUI prompt_id WebSocket progress for real-time completion callbacks.

🏁 Conclusion

The implementation is clean, robust, well-tested, and fully satisfies all criteria for Issue #14. Ready to merge!

Expose GenerateVideoAsync, SynthesizeSpeechAsync, and GenerateAudioAsync tools in LocalLlmMcpTools for Model Context Protocol (MCP) JSON-RPC clients. Include comprehensive integration test coverage for tool registration, parameter validation, and HTTP dispatching.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@spelech

spelech commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

Integrated and merged into main as part of release v3.7.0.

@spelech spelech closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): Expose video and audio generation tools to Model Context Protocol (MCP) server

1 participant