Golem CLI: add mcp server#1976
Conversation
|
@vigoo Hello, can you take a look if not busy |
|
@jdegoes Any updates? |
|
@vigoo Any updates on this? |
|
Hello @mschuwalow can you review this? |
|
This PR is obviously AI generated for many parts, which is not a problem, but it is not cleaned up at all or reviewed properly before it was submitted, which is a problem, some examples:
and so on. Even the description / implementation "details" in the PR description are making no sense:
|
…registry - Gate the HTTP server behind the `mcp-server` Cargo feature - Add graceful error when `--serve` is used without the feature - Keep server code isolated in `serve.rs` behind cfg(feature = "mcp-server") - Implement clean JSON-RPC response model (`RpcResponse`, `RpcError`) instead of raw literals - Wire `tools/list` directly to the central registry of tools - Restrict `tools/call` to only allowed/registered tools with typed input schema - Align manifest discovery with repo’s canonical algorithm (`golem.yaml` walk-up)
|
Hello again @noise64 |
|
Hello again @vigoo can you take a look at this??? |
|
Hello @mschuwalow @afsalthaj can someone provide feedbacks on this? |
|
Hello again @noise64 @vigoo @mschuwalow, any updates on this? |
|
@vigoo any updates on this? |
|
@noise64 I know you're busy, I've tried to fix mentioned issues, can you take a look? |
|
@mschuwalow can you review this? |
|
@afsalthaj can you review this? |
|
@noise64 I think the body/description looks good now. |
|
Can someone approve the workflows? |
|
This is still full of random unreviewed AI generated things, and most of the things were not corrected or done properly. |
I've tried to built it locally & works fine. |
Add MCP Server Mode to
golem-cliSummary of Changes
This PR introduces an MCP (Model Context Protocol) server mode to
golem-cli, allowing external tools (e.g. IDEs, LLMs, or orchestrators) to interact withgolemvia a standardized JSON-RPC 2.0 API over HTTP.🔨 Implementation Details
--serveand--serve-portflags to launchgolem-clias an MCP server.📡 MCP Endpoints Implemented
initialize— handshake and capability negotiation.tools/list— exposes available CLI tools (golem.run).tools/call— runs commands likegolem versionorgolem profile list, with:stdout/stderrintologsarray.exitCodeand final output in structured JSON.system,exec).resources/list— enumerates manifest files in current dir, ancestors, and immediate children.resources/read— returns file contents byfile://URI.🔬 Validation / Testing
A test plan was executed using
curlagainst the MCP endpoint:golem.run.golem version) returns logs + result.system exec).cwdargument for working directory override.-32601).-32602).🏁 Result
golem-clican now be run as a long-lived MCP server:https://youtu.be/BxJBLJkkV8Q
🤔 How to
1- Build/compile:
cd golem/cli/golem-cli cargo build --release2- Run:
cd ../.. RUST_LOG=debug ./target/release/golem-cli --serve --serve-port 12323- Test first request in other terminal run:
{ "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "...", "serverInfo": {"..."}, "capabilities": {"..."} } }See full implimented/available commands: https://github.com/BenraouaneSoufiane/golem/tree/mcp-server/cli/golem-cli
Algora.io
/claim #1926