MCP Server

better-openclaw ships with a built-in Model Context Protocol (MCP) server. This lets AI agents — like Claude, Cursor, Windsurf, or any MCP-compatible client — generate Docker Compose stacks, browse the service catalog, and validate infrastructure through natural language.

What is MCP?

The Model Context Protocol is an open standard (created by Anthropic) that connects AI models to external tools and data sources. Think of it as a universal plugin system for AI: instead of building custom integrations, any MCP-compatible client can discover and use tools exposed by an MCP server.

The @better-openclaw/mcp package exposes the full stack-generation pipeline — the same engine that powers the CLI and web builder — as MCP tools and resources.

Quick Setup

Install

# Global install
npm install -g @better-openclaw/mcp

# Or use npx (no install)
npx @better-openclaw/mcp

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "better-openclaw": {
      "command": "npx",
      "args": ["-y", "@better-openclaw/mcp"]
    }
  }
}

Cursor / VS Code

Add to your .cursor/mcp.json or VS Code MCP settings:

{
  "mcpServers": {
    "better-openclaw": {
      "command": "npx",
      "args": ["-y", "@better-openclaw/mcp"]
    }
  }
}

Available Tools

The MCP server exposes 10 tools that AI agents can call:

ToolDescription
generate-stackGenerate a complete Docker Compose stack from a list of services. Returns all files (docker-compose.yml, .env, README, scripts, configs).
list-servicesList all available services in the catalog with their categories, ports, and descriptions.
get-serviceGet detailed information about a specific service by ID (ports, volumes, health checks, dependencies).
search-servicesSearch services by keyword across names, descriptions, and tags.
suggest-servicesGet service suggestions from a natural language description (e.g. "I need a research assistant with vector search").
list-presetsList all available presets (curated service combinations for common use cases).
get-presetGet full details of a specific preset by ID.
list-skill-packsList all skill packs (bundles of OpenClaw skills).
resolve-depsResolve the dependency graph for a set of services (shows what gets auto-added).
validate-stackValidate a stack configuration for errors (port conflicts, missing dependencies, resource estimates).

Available Resources

MCP resources provide read-only data that clients can browse:

ResourceURIDescription
Servicesopenclaw://servicesComplete service catalog as JSON
Presetsopenclaw://presetsAll available preset configurations
Skillsopenclaw://skillsAll skill packs with their bindings

Example Conversations

Generate a stack from a description

User: "I want to build a self-hosted research assistant with 
       vector search, web scraping, and local LLM support"

Agent calls: suggest-services("research assistant vector search web scraping local LLM")
  → Returns: qdrant, searxng, browserless, ollama, open-webui, redis

Agent calls: generate-stack({
  projectName: "research-assistant",
  services: ["qdrant", "searxng", "browserless", "ollama", "open-webui", "redis"],
  monitoring: true
})
  → Returns: docker-compose.yml, .env, README.md, scripts/, configs/

Validate before deploying

User: "Check if this stack will work on a 4GB server"

Agent calls: validate-stack({
  services: ["postgresql", "redis", "n8n", "ollama"]
})
  → Returns: warnings about memory (Ollama alone needs ~4GB), 
    port conflicts, and dependency graph

Development

# Clone the repo
git clone https://github.com/bidewio/better-openclaw.git
cd better-openclaw

# Install dependencies
pnpm install

# Run the MCP server in development mode
pnpm --filter @better-openclaw/mcp dev

Next Steps