-
Notifications
You must be signed in to change notification settings - Fork 160
Feat/mcp serve cli #2596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/mcp serve cli #2596
Conversation
Implements issue golemcloud#1926 - MCP Server for Golem CLI - Add --serve and --serve-port flags to enable MCP server mode - Expose all CLI leaf commands as MCP tools - Expose golem.yaml manifests as MCP resources - Use rmcp crate with HTTP Streamable transport - Add E2E tests for MCP functionality - Update README with MCP usage documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements MCP (Model Context Protocol) server functionality for the Golem CLI, enabling AI agents to interact with Golem programmatically through HTTP-based JSON-RPC communication.
Changes:
- Added new
mcpmodule exposing CLI commands as MCP tools and golem.yaml manifests as MCP resources - Added comprehensive E2E tests for MCP server functionality
- Updated dependencies to include
rmcpandaxumcrates - Added MCP usage documentation to README
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/golem-cli/src/mcp.rs | New MCP server implementation exposing CLI commands as tools and manifests as resources |
| cli/golem-cli/tests/mcp_e2e.rs | Comprehensive E2E tests for MCP server functionality |
| cli/golem-cli/src/lib.rs | Added mcp module to public exports |
| cli/golem-cli/Cargo.toml | Added rmcp and axum dependencies |
| README.md | Added MCP server mode documentation with usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| let result = client | ||
| .call_tool(name, serde_json::json!({"args": ["--help"]})) | ||
| .expect(&format!("Failed to call tool: {}", name)); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using expect with a formatted string is inefficient because the string is allocated even when the Result is Ok. Replace with unwrap_or_else or use expect with a static string and include the error context in the panic message using the error's Display implementation.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Implements #1926 - MCP Server for Golem CLI
This PR adds an MCP (Model Context Protocol) server mode to the Golem CLI, enabling AI agents and tools to interact with Golem programmatically.
Changes
--serveand--serve-portflags to enable MCP server modegolem.yamlmanifests as MCP resourcesrmcpcrate with HTTP Streamable transportUsage