> ## Documentation Index
> Fetch the complete documentation index at: https://bilt.me/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Setup

> Complete integration guide for OpenClaw on macOS, Windows, and Linux

## Overview

Connect Bilt MCP Server to OpenClaw for powerful AI-assisted development across all platforms. OpenClaw natively supports MCP with advanced features like background execution, tool discovery, and multi-agent workflows.

<Info>
  OpenClaw supports MCP out of the box with zero configuration required beyond adding servers.
</Info>

## Platform Support

<CardGroup cols={3}>
  <Card icon="apple">
    **macOS**

    Full support for macOS 11+
  </Card>

  <Card icon="windows">
    **Windows**

    Full support for Windows 10+
  </Card>

  <Card icon="linux">
    **Linux**

    Full support for all major distros
  </Card>
</CardGroup>

## Prerequisites

1. **OpenClaw installed** - Download from [openclaw.ai](https://openclaw.ai)
2. **Bilt API token** - Get one at [bilt.me/sign-up](https://bilt.me/sign-up)

***

## Quick Setup

### Step 1: Locate Config File

The OpenClaw config file location varies by platform:

<Tabs>
  <Tab title="macOS/Linux">
    ```
    ~/.openclaw/openclaw.json
    ```
  </Tab>

  <Tab title="Windows">
    ```
    %USERPROFILE%\.openclaw\openclaw.json
    ```
  </Tab>
</Tabs>

### Step 2: Edit Configuration

<Tabs>
  <Tab title="macOS/Linux">
    ```bash theme={null}
    # Create directory if needed
    mkdir -p ~/.openclaw

    # Edit config
    nano ~/.openclaw/openclaw.json
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={null}
    # Create directory if needed
    mkdir -Force "$env:USERPROFILE\.openclaw"

    # Edit config
    notepad "$env:USERPROFILE\.openclaw\openclaw.json"
    ```
  </Tab>
</Tabs>

### Step 3: Add Bilt Configuration

Add this to your `openclaw.json`:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer bilt_live_YOUR_TOKEN_HERE"
        }
      },
      "capabilities": ["tools"],
      "metadata": {
        "name": "Bilt",
        "description": "Build and deploy native mobile applications",
        "icon": "🏗️"
      }
    }
  }
}
```

Replace `YOUR_TOKEN_HERE` with your actual Bilt API token.

### Step 4: Restart OpenClaw

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    openclaw gateway restart
    ```
  </Tab>

  <Tab title="macOS Menu Bar">
    Click OpenClaw icon → Restart Gateway
  </Tab>

  <Tab title="Windows">
    Right-click system tray icon → Restart Gateway
  </Tab>
</Tabs>

### Step 5: Verify Connection

```bash theme={null}
openclaw status
```

You should see:

```
✓ MCP Server: bilt (7 tools)
  - bilt_list_projects
  - bilt_get_project
  - bilt_create_project
  - bilt_get_session
  - bilt_send_message
  - bilt_cancel_workflow
  - bilt_get_messages
```

***

## Configuration Options

### Basic Configuration

Minimal setup:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer bilt_live_YOUR_TOKEN"
        }
      }
    }
  }
}
```

### Advanced Configuration

With metadata and capabilities:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer bilt_live_YOUR_TOKEN"
        }
      },
      "capabilities": ["tools"],
      "metadata": {
        "name": "Bilt Application Builder",
        "description": "AI-powered native mobile app development and deployment",
        "icon": "🏗️",
        "version": "1.0.0"
      },
      "enabled": true,
      "autoStart": true
    }
  }
}
```

### Environment Variables

Use environment variables for tokens (recommended):

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer ${BILT_API_TOKEN}"
        }
      }
    }
  }
}
```

Then set the variable:

<Tabs>
  <Tab title="macOS/Linux">
    ```bash theme={null}
    # Add to ~/.zshrc or ~/.bashrc
    export BILT_API_TOKEN="bilt_live_YOUR_TOKEN"

    # Reload shell
    source ~/.zshrc

    # Restart OpenClaw
    openclaw gateway restart
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={null}
    # Set permanently
    [System.Environment]::SetEnvironmentVariable(
      "BILT_API_TOKEN",
      "bilt_live_YOUR_TOKEN",
      "User"
    )

    # Restart OpenClaw
    openclaw gateway restart
    ```
  </Tab>
</Tabs>

### Multiple Environments

Configure dev and production:

```json theme={null}
{
  "mcpServers": {
    "bilt-dev": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer ${BILT_DEV_TOKEN}"
        }
      },
      "metadata": {
        "name": "Bilt (Development)",
        "icon": "🔧"
      }
    },
    "bilt-prod": {
      "transport": {
        "type": "sse",
        "url": "https://mcp.bilt.me/mcp/sse",
        "headers": {
          "Authorization": "Bearer ${BILT_PROD_TOKEN}"
        }
      },
      "metadata": {
        "name": "Bilt (Production)",
        "icon": "🚀"
      }
    }
  }
}
```

***

## Using Bilt in OpenClaw

### Natural Language Commands

OpenClaw automatically discovers and uses Bilt tools:

```
You: "Use Bilt to create a todo app"

OpenClaw: [Discovers bilt_create_project tool]
[Executes tool with parameters]
"Created project: todo-app (550e8400-e29b-41d4-a716-446655440000)"

You: "Add authentication and dark mode"

OpenClaw: [Uses bilt_send_message]
"Building features... Progress: 45%"
```

### Direct Tool Invocation

You can also invoke tools directly:

```
You: "Call bilt_list_projects"

OpenClaw: [Returns JSON with all projects]
```

### Background Execution

OpenClaw supports background tool execution:

```
You: "Build my landing page in the background"

OpenClaw: [Starts bilt_send_message in background]
"Build started in background. I'll notify you when complete."

[5 minutes later]

OpenClaw: "Your landing page is ready! Deployed to: https://..."
```

***

## OpenClaw-Specific Features

### Tool Discovery

OpenClaw automatically:

1. Discovers all 8 Bilt tools
2. Parses parameter schemas
3. Suggests tools based on context

### Error Handling

OpenClaw provides enhanced error messages:

```
Error: 401 Unauthorized
Suggestion: Your Bilt API token may be invalid.
Try: openclaw config get mcpServers.bilt
```

### Session Management

OpenClaw maintains MCP sessions across restarts:

```bash theme={null}
# Check active sessions
openclaw sessions list

# View Bilt tool calls
openclaw logs --filter bilt
```

### Rate Limit Handling

OpenClaw automatically:

* Respects rate limits
* Retries with backoff
* Shows rate limit status

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Server not connecting">
    **Check status**:

    ```bash theme={null}
    openclaw status
    ```

    **View logs**:

    ```bash theme={null}
    openclaw logs --tail 50
    ```

    **Test connection**:

    ```bash theme={null}
    curl -H "Authorization: Bearer YOUR_TOKEN" \
      https://mcp.bilt.me/health
    ```
  </Accordion>

  <Accordion title="Tools not available">
    **Verify config**:

    ```bash theme={null}
    openclaw config get mcpServers.bilt
    ```

    **Restart gateway**:

    ```bash theme={null}
    openclaw gateway restart
    ```

    **Check logs for errors**:

    ```bash theme={null}
    openclaw logs --filter error
    ```
  </Accordion>

  <Accordion title="401 Unauthorized">
    **Check token format**:

    ```bash theme={null}
    openclaw config get mcpServers.bilt.transport.headers.Authorization
    ```

    Should return: `Bearer bilt_live_...`

    **Update token**:

    ```bash theme={null}
    openclaw config set mcpServers.bilt.transport.headers.Authorization \
      "Bearer bilt_live_NEW_TOKEN"

    openclaw gateway restart
    ```
  </Accordion>

  <Accordion title="Slow responses">
    **Check network**:

    ```bash theme={null}
    ping mcp.bilt.me
    ```

    **Monitor latency**:

    ```bash theme={null}
    openclaw stats --server bilt
    ```
  </Accordion>
</AccordionGroup>

***

## CLI Commands

### Configuration

```bash theme={null}
# View all MCP servers
openclaw config get mcpServers

# View Bilt config
openclaw config get mcpServers.bilt

# Update token
openclaw config set mcpServers.bilt.transport.headers.Authorization \
  "Bearer bilt_live_NEW_TOKEN"

# Enable/disable server
openclaw config set mcpServers.bilt.enabled true
```

### Monitoring

```bash theme={null}
# Check gateway status
openclaw gateway status

# View logs
openclaw logs --follow

# View specific server logs
openclaw logs --server bilt

# Check tool usage stats
openclaw stats --tool bilt_send_message
```

### Management

```bash theme={null}
# Restart gateway
openclaw gateway restart

# Stop gateway
openclaw gateway stop

# Start gateway
openclaw gateway start

# Update OpenClaw
openclaw update
```

***

## Advanced Usage

### Webhook Integration

OpenClaw can trigger webhooks on Bilt events:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": { "..." },
      "webhooks": {
        "onSuccess": "https://your-app.com/webhook/build-complete",
        "onError": "https://your-app.com/webhook/build-failed"
      }
    }
  }
}
```

### Custom Prompts

Define custom prompts for Bilt:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": { "..." },
      "prompts": {
        "create-app": "Use Bilt to create a {type} native mobile application with {features}",
        "deploy": "Deploy {project} to production using Bilt"
      }
    }
  }
}
```

### Logging

Configure detailed logging:

```json theme={null}
{
  "mcpServers": {
    "bilt": {
      "transport": { "..." },
      "logging": {
        "level": "debug",
        "file": "~/.openclaw/logs/bilt.log"
      }
    }
  }
}
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/docs/api-reference/overview">
    Learn about all 8 Bilt tools
  </Card>

  <Card title="OpenClaw Docs" icon="book-open" href="https://docs.openclaw.ai">
    Learn more about OpenClaw
  </Card>
</CardGroup>
