# OpenClaw

This quickstart shows how to connect OpenClaw to Swytchcode and use the provider tools from the CLI and MCP server.

## Step-by-step setup

### Step 1: Install the Swytchcode CLI

**npm**

```bash
npm install -g swytchcode
```

**Windows**

```powershell
irm https://cli.swytchcode.com/install.ps1 | iex
```

**macOS / Linux**

```bash
curl -fsSL https://cli.swytchcode.com/install.sh | sh
```

Use `swy` as a shorter alias for `swytchcode`.

### Step 2: Initialize Swytchcode for OpenClaw

```bash
cd /path/to/your/project
swy init --editor=openclaw --mode=sandbox
```

This creates:

- `.swytchcode/` with [`tooling.json`](/configuration/tooling-json/) — the trust boundary that lists exactly which tools OpenClaw is allowed to call
- `OPENCLAW.md` in the repo root — the agent contract file describing available tools and conventions for OpenClaw to follow
- `~/.openclaw/settings.json` with the MCP server configuration

### Step 3: Fetch an integration

Search for available integrations (or browse the full list at [swytchcode.com/apis](https://www.swytchcode.com/apis)):

```bash
swy search
```

Fetch one, such as Stripe:

```bash
swy get stripe
```

### Step 4: Add tools to the trust boundary (`tooling.json`)

Add a specific method:

```bash
swy add stripe.charge.create
```

Or add all tools from a project:

```bash
swy add method --all stripe
```

Verify the tool is enabled:

```bash
swy list tooling
```

### Step 5: Start the MCP server

The MCP server starts automatically when OpenClaw connects through the config written during initialization. If you need to start it manually:

```bash
swy mcp serve
```

### Step 6: Use OpenClaw

Open your project in OpenClaw. The agent now has access to the Swytchcode MCP tools.

You can give prompts such as:

```text
Create a Stripe charge for $50 for customer cus_123.
```

OpenClaw will:

- check `swy list tooling` to verify the tool exists
- call `swy info stripe.charge.create` to inspect the schema
- generate runtime code using `swy exec`

## Example projects

- [Refund Agent](https://github.com/swytchcodehq/swytchcode-examples/tree/main/swytchcode-refund-agent-openclaw) - Multi-API customer onboarding workflow demonstrating idempotency, policy enforcement, and audit trails.
- [GitHub Issue Triage Bot](https://github.com/swytchcodehq/swytchcode-examples/tree/main/openclaw-swytchcode) - OpenClaw classifies and triages GitHub issues, posts templated comments, and logs actions through Swytchcode.
