AI-Native Interface

MCP Server

Expose your ClawButler instance as an MCP (Model Context Protocol) server so AI assistants like Claude, Cursor, and Windsurf can manage your agents directly.

Current status#

Current status
V0.1 — 40 tools across 9 domains + 4 resource URIs. Covers agent management, cost tracking, config safety, audit, connectors, intelligence analytics, runbooks, operations, and runtime-host discovery plus attach-mode session sync. Authentication via Bearer token (same as CLI). Runtime-host tools for Hermes / Claude Code / Codex are operational, but still not provider-native parity with OpenClaw connectors.

How it works#

The MCP Server is a thin protocol bridge between your AI assistant and the ClawButler API. It translates natural language intent into structured API calls, so you can manage your agent fleet from any MCP-compatible client.

text
┌──────────────────┐     stdio / HTTP     ┌─────────────────┐     REST API     ┌──────────────────┐
│   AI Assistant   │ ◄──────────────────► │  MCP Server     │ ◄─────────────► │  ClawButler API  │
│  (Claude, etc.)  │       MCP Protocol   │  (clawbutler-   │   Bearer Token  │  (FastAPI)       │
│                  │                      │   mcp)          │                 │                  │
└──────────────────┘                      └─────────────────┘                 └──────────────────┘

Setup#

The MCP server is a standalone Python package that connects to your ClawButler API. Install it and configure your AI assistant to use it.

bash
# Install from PyPI
pip install clawbutler-mcp

# Or run directly with uvx (zero install)
uvx clawbutler-mcp

# Set environment variables
export CLAWBUTLER_API_URL=https://your-instance.clawbutler.cc
export CLAWBUTLER_TOKEN=your-bearer-token

IDE Configuration#

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "clawbutler": {
      "command": "uvx",
      "args": ["clawbutler-mcp"],
      "env": {
        "CLAWBUTLER_API_URL": "https://your-instance.clawbutler.cc",
        "CLAWBUTLER_TOKEN": "your-token"
      }
    }
  }
}

Claude Code

Add to your project's .mcp.json:

json
{
  "mcpServers": {
    "clawbutler": {
      "command": "uvx",
      "args": ["clawbutler-mcp"],
      "env": {
        "CLAWBUTLER_API_URL": "https://your-instance.clawbutler.cc",
        "CLAWBUTLER_TOKEN": "your-token"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

json
{
  "mcpServers": {
    "clawbutler": {
      "command": "uvx",
      "args": ["clawbutler-mcp"],
      "env": {
        "CLAWBUTLER_API_URL": "https://your-instance.clawbutler.cc",
        "CLAWBUTLER_TOKEN": "your-token"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{
  "mcpServers": {
    "clawbutler": {
      "command": "uvx",
      "args": ["clawbutler-mcp"],
      "env": {
        "CLAWBUTLER_API_URL": "https://your-instance.clawbutler.cc",
        "CLAWBUTLER_TOKEN": "your-token"
      }
    }
  }
}

Streamable HTTP (remote deployment)

For containerized or remote deployments, use HTTP transport:

bash
clawbutler-mcp --transport http --port 8080

Available Tools#

40 tools across 9 domains. Click any tool to see its parameters.

Agents (5 tools)

list_agents, get_agent, enable_agent, disable_agent, get_agent_config

Full agent lifecycle — view status, enable or disable, and inspect configuration.

Cost & Budgets (4 tools)

get_cost_summary, get_cost_by_agent, get_cost_trend, list_budgets

Cost tracking with date ranges, per-agent breakdown, trend analysis, and budget monitoring.

Config Safety (5 tools)

list_config_snapshots, take_config_snapshot, diff_config_snapshots, preview_rollback, execute_rollback

Config versioning — browse snapshots, create manual save points, semantic diff, dry-run rollback, and execute rollback.

Audit & Activity (3 tools)

search_audit_events, get_audit_event, get_recent_activity

Audit trail with flexible filters and recent activity stream for investigation.

Connectors (4 tools)

list_connectors, get_connector_detail, test_connector, diagnose_connector

Gateway connector management — list, inspect, test connectivity, and run diagnostics.

Intelligence (4 tools)

get_root_cause_analysis, get_reliability_scores, get_agent_reliability, get_value_comparison

Root-cause analysis, reliability scoring, and value comparison.

Operations (6 tools)

get_killswitch_status, activate_killswitch, deactivate_killswitch, check_health, get_trust_status, get_dashboard

Kill switch, health checks, trust status, and dashboard KPI summary.

Runbooks (4 tools)

list_runbooks, get_runbook, execute_runbook, get_runbook_run

Runbook automation — browse, execute with inputs, and track one run timeline.

Runtime Hosts (5 tools)

list_runtime_hosts, get_runtime_host_detail, discover_runtime_host, batch_add_runtime_host_instances, sync_runtime_host_sessions

Pair machines, discover Hermes / Claude Code / Codex / OpenClaw instances, batch-add connectors, and sync attach-mode sessions.

Tool Reference#

Complete parameter reference for all 40 tools. Click a tool to expand its parameters. Parameters marked with * are required.

Agents

Cost & Budgets

Config Safety

Audit & Activity

Connectors

Intelligence

Operations

Runbooks

Runtime Hosts

Output Examples#

Tools return formatted Markdown strings. Here are examples of what your AI assistant will receive:

list_agents"List all my agents"
markdown
- **coordinator** (id: aaa-bbb-…) [on] health=healthy platform=openclaw
- **researcher** (id: fff-ggg-…) [off] health=error platform=openclaw
- **writer** (id: ccc-ddd-…) [on] health=warning platform=codex
get_cost_summary"What's my cost for the last week?"
markdown
**Cost Summary** (2026-03-10 → 2026-03-17)
- Total cost: $42.5678
- Input tokens: 1,234,567
- Output tokens: 654,321
- Records: 150
diff_config_snapshots"Compare config version 3 and 4 for agent coordinator"
markdown
**Config Diff** v3 → v4
Summary: Model changed
- [modified] `model.primary`: claude-sonnet-4-5 → claude-sonnet-4-6
- [added] `tools.web_search`: — → enabled
- [removed] `skills.deprecated_skill`: active → —
check_health"Run a health check"
markdown
**Health Check**
- Status: ready
- Version: 0.1.0
- Dependencies:
  - postgres: ok
  - valkey: ok
- Worker: running (mode=embedded)
get_dashboard"Show me the dashboard"
markdown
**Dashboard Summary**
- Agents: 12 online / 14 total
- Today's cost: $8.4321
- Events today: 67
- Pending approvals: 2
- Unread notifications: 5

MCP Resources#

Resources provide read-only snapshots that AI assistants can use as context before calling tools.

clawbutler://dashboard

Dashboard summary — agent count, today's cost, events, pending approvals.

clawbutler://agents

Compact agent list with ID, name, status, and platform.

clawbutler://cost/today

Today's cost snapshot.

clawbutler://health

System readiness and dependency health.

Example Workflows#

Morning ops check

Ask your AI assistant to give you a morning briefing on your agent fleet.

bash
"Check my ClawButler dashboard — how many agents are online,
what's today's cost, and any pending approvals?"

Cost investigation

Drill into a cost spike without leaving your editor.

bash
"Show me cost by agent for the last 7 days.
Which agent had the highest spend?"

Emergency response

AI-assisted incident response with kill switch and audit trail.

bash
"Agent coordinator is behaving unexpectedly.
Check its health, then activate the kill switch with reason
'unexpected behavior — investigating'."

Config rollback

Review and roll back a bad config change.

bash
"List the last 5 config snapshots for agent coordinator.
Diff version 3 vs 4, then preview a rollback to version 3."

Audit investigation

Search audit events to trace who changed what and when.

bash
"Search audit events for risk_level=high in the last 3 days.
Show me the full details of the most recent one."

Connector diagnosis

Diagnose a connectivity issue with your gateway.

bash
"List my connectors. The OpenClaw gateway seems slow —
run a diagnosis on it and tell me what's wrong."

Runtime host discovery and session sync

Discover Hermes / Claude Code / Codex / OpenClaw instances on a paired machine, add only the ones you want governed, then project attach-mode sessions into ClawButler.

bash
"List my runtime hosts. Discover the paired MacBook,
add the Codex and Claude Code instances as connectors,
then sync the latest attach-mode sessions for investigation."

Coverage Comparison#

MCP supports

  • - Agent CRUD and toggle
  • - Cost summary, by-agent, trends, budgets
  • - Config snapshots, manual save points, semantic diff, rollback
  • - Audit event search and activity stream
  • - Connector listing, test, diagnosis
  • - Intelligence analytics (root cause, reliability, value)
  • - Kill switch (activate / deactivate)
  • - Health check and trust status
  • - Dashboard KPIs
  • - Runbook execution and tracking
  • - Runtime host list/detail/discover/batch-add/sync for Hermes / Claude Code / Codex / OpenClaw attach-mode intake

Not yet in MCP (V2)

  • - User registration / org management / RBAC
  • - Federation peer management
  • - Template gallery full lifecycle
  • - Report generation and export
  • - Notification management
  • - Provider-native approvals, cost attribution, timelines, and managed control for Hermes / Claude Code / Codex runtime hosts
Design decisions
  • - Destructive operations (kill switch, rollback) are clearly marked in tool descriptions so AI assistants confirm before executing.
  • - Token authentication — same Bearer token as CLI. Do not commit .mcp.json with tokens to git.
  • - Read-heavy design — most tools are read operations; write operations require explicit parameters.
  • - Runtime-host sync is currently attach-mode projection. It does not imply full provider-native governance parity for Hermes / Claude Code / Codex.

Troubleshooting#

"Tool not found" or no tools appear in IDE

Ensure clawbutler-mcp is installed and the command path is correct. Run `uvx clawbutler-mcp --help` to verify. Check your IDE's MCP log for connection errors.

401 Unauthorized / authentication errors

Verify CLAWBUTLER_TOKEN is set correctly. Tokens are the same as the CLI — generate one from Settings > API Tokens in the web dashboard.

Connection refused / timeout

Check CLAWBUTLER_API_URL points to your running ClawButler instance. For self-hosted setups, ensure the API is accessible from the machine running the MCP server.

Tools work but return empty data

This usually means the API returned an empty data array — your instance may not have agents/costs/connectors configured yet. Try get_dashboard first to verify connectivity.

How to use with Docker / remote servers?

Use HTTP transport: `clawbutler-mcp --transport http --port 8080`. This starts a Streamable HTTP server that any MCP client can connect to over the network.

Security#

  • - Never commit tokens to version control. Add `.mcp.json` to `.gitignore` if it contains credentials.
  • - Use environment variables or a secrets manager for token storage — avoid hardcoding tokens in config files.
  • - The MCP server inherits the permissions of the token it uses. Use scoped tokens with minimal permissions for automated workflows.
  • - For shared environments, prefer HTTP transport with network-level access control (VPN, firewall rules) rather than exposing the server publicly.

Suggested Screenshots#

Screenshot Placeholder
Claude Desktop with ClawButler
Claude Desktop calling list_agents and get_dashboard tools
Screenshot Placeholder
Claude Code integration
Claude Code running cost summary and health check in editor
Screenshot Placeholder
Kill switch activation
AI assistant confirming before activating kill switch
Screenshot Placeholder
Config diff in chat
Semantic config diff displayed in AI assistant conversation
Screenshot Placeholder
Runbook execution
AI assistant executing a runbook and tracking its progress
Screenshot Placeholder
Runtime host discovery
AI assistant discovering Codex / Claude Code / Hermes instances and syncing attach-mode sessions
Screenshot Placeholder
MCP resources
AI assistant reading clawbutler://dashboard resource for context
MCP Server — ClawButler