Skip to content

Conversation

@ntoledo319
Copy link

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

  • 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

Usage

golem-cli --serve --serve-port 1232
MCP Methods Supported
initialize - Initialize MCP session
tools/list - List available CLI commands as tools
tools/call - Execute a CLI command
resources/list - List discovered golem.yaml manifests
resources/read - Read manifest contents
Testing
Manual testing performed with curl. E2E tests available:

bash
cargo test -p golem-cli mcp_e2e -- -

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
Copilot AI review requested due to automatic review settings January 15, 2026 21:31
Copy link

Copilot AI left a 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 mcp module 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 rmcp and axum crates
  • 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));
Copy link

Copilot AI Jan 15, 2026

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.

Copilot uses AI. Check for mistakes.
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.

1 participant