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/mcpClaude 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:
| Tool | Description |
|---|---|
generate-stack | Generate a complete Docker Compose stack from a list of services. Returns all files (docker-compose.yml, .env, README, scripts, configs). |
list-services | List all available services in the catalog with their categories, ports, and descriptions. |
get-service | Get detailed information about a specific service by ID (ports, volumes, health checks, dependencies). |
search-services | Search services by keyword across names, descriptions, and tags. |
suggest-services | Get service suggestions from a natural language description (e.g. "I need a research assistant with vector search"). |
list-presets | List all available presets (curated service combinations for common use cases). |
get-preset | Get full details of a specific preset by ID. |
list-skill-packs | List all skill packs (bundles of OpenClaw skills). |
resolve-deps | Resolve the dependency graph for a set of services (shows what gets auto-added). |
validate-stack | Validate a stack configuration for errors (port conflicts, missing dependencies, resource estimates). |
Available Resources
MCP resources provide read-only data that clients can browse:
| Resource | URI | Description |
|---|---|---|
| Services | openclaw://services | Complete service catalog as JSON |
| Presets | openclaw://presets | All available preset configurations |
| Skills | openclaw://skills | All 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 graphDevelopment
# 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 devNext Steps
- MCP Tools Reference — detailed docs for every tool
- Service Catalog — browse all available services
- CLI Reference — the command-line equivalent of MCP tools