Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,39 @@ This repository contains Golem - a set of services enable you to run WebAssembly
## Getting started with Golem
See [Golem Cloud](https://golem.cloud) for more information, and [the Golem Developer Documentation](https://learn.golem.cloud) for getting started.

## MCP Server Mode

The Golem CLI can run as an MCP (Model Context Protocol) server, enabling AI agents and tools to interact with Golem programmatically.

### Starting the MCP Server

```bash
golem-cli --serve --serve-port 1232
```

### Features

- **Tools**: All CLI commands are exposed as MCP tools. AI agents can execute any CLI command by calling the corresponding tool with arguments.
- **Resources**: `golem.yaml` manifest files from the current directory, parent directories, and child directories are exposed as MCP resources.

### Example Usage

```bash
# Initialize MCP session
curl -X POST http://127.0.0.1:1232/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}'

# List available tools
curl -X POST http://127.0.0.1:1232/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

# Call a tool (e.g., get help for the `component` command)
curl -X POST http://127.0.0.1:1232/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"golem-cli.component","arguments":{"args":["--help"]}}}'
```

## Developing Golem
Find details in the [contribution guide](CONTRIBUTING.md) about how to compile the Golem services locally.
2 changes: 2 additions & 0 deletions cli/golem-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ wit-encoder = { workspace = true }
wit-parser = { workspace = true }
webbrowser = { workspace = true }
warp = { workspace = true }
rmcp = { workspace = true }
axum = { workspace = true }

[target.'cfg(not(any(target_os = "windows", target_vendor = "apple")))'.dependencies]
openssl = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions cli/golem-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mod error;
pub mod fs;
pub mod fuzzy;
pub mod log;
pub mod mcp;
pub mod model;
pub mod validation;
pub mod wasm_rpc_stubgen;
Expand Down
Loading