Skip to content

Conversation

@merchantmoh-debug
Copy link

Summary
Implements a fully functional Model Context Protocol (MCP) server within golem-cli, resolving Issue #1926. This allows AI agents (Claude, Cursor, etc.) to natively discover and control Golem resources.

Architecture

  • Transport: Axum-based SSE (Server-Sent Events) on /sse.
  • Protocol: Full JSON-RPC 2.0 via /messages.
  • State: Thread-safe Arc<Context> integration for async command handling.

Key Features

  • Real Logic: Tools utilize internal ComponentHandler and WorkerService (no mocks).
  • Safety: Implements 30s execution timeouts to prevent zombie processes.
  • Security: Input sanitization and structured error handling.
  • Limitations: args for golem_worker_launch are currently parsed but not fully supported by the underlying SDK signature (noted in code).

Verification
Tested with mcp-inspector and Claude Desktop. Handshake and tool execution verified against golem-client.

/claim #1926

google-labs-jules bot and others added 3 commits January 6, 2026 06:14
- Added `serve` command to Golem CLI.
- Implemented MCP router with SSE transport and Axum.
- Added `mcp` module with `router` and `tools` submodules.
- Mocked `golem_new_project` and `golem_worker_launch` tools.
- Updated `Context` to store `Arc<GolemClients>` to allow sharing with router state.
- Added dependencies: `async-stream`, `tower-http`, `futures`, `axum` (moved to deps).

Ref: golemcloud#1926
- Replaced mocked tools with actual implementation using Golem CLI logic.
- Implemented `golem_new_component` using `ComponentHandler`.
- Implemented `golem_worker_launch` using `WorkerClient`.
- Updated `Context` to store `Arc<GolemClients>` for safe sharing.
- Updated MCP router to use `Arc<Context>`.
- Added necessary dependencies and imports.
…50202780346890193

Incorporate MCP Server into Golem CLI
@merchantmoh-debug
Copy link
Author

@algora-pbc /claim #1926

@merchantmoh-debug
Copy link
Author

@vigoo @jdegoes Checking in.

This implementation is feature-complete (wires up the real WorkerService and ComponentHandler rather than mocks) and passes all CI checks.

I've verified the SSE transport and tool execution locally with mcp-inspector. Ready for final review/merge whenever you have a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant