# cursor-acp-bridge

ACP stdio bridge for Cursor CLI.

## Why

Cursor CLI (`cursor agent acp`) has poor ACP support — persistent sessions fail with "Session ID Not Found" ([Cursor Forum #155516](https://forum.cursor.com/t/cursor-acp-session-load-fails-with-session-id-not-found-breaking-persistent-sessions-acpx-openclaw-acp-runtime/155516)). This bridge works around those issues.

## Install

```bash
npm install -g cursor-acp-bridge
```

## acpx Configuration

Add to `~/.acpx/config.json`:

```json
{
  "agents": {
    "cursor": {
      "command": "cursor-acp-bridge"
    }
  }
}
```

To use a different model:

```json
{
  "agents": {
    "cursor": {
      "command": "cursor-acp-bridge --model gpt-4"
    }
  }
}
```

## OpenClaw Configuration

Merge the following into your `openclaw.json` to register Cursor as an ACP agent:

```jsonc
{
  "plugins": {
    "entries": {
      "acpx": { "enabled": true },
    },
  },
  "acp": {
    "enabled": true,
    "backend": "acpx",
  },
  "agents": {
    "list": [
      {
        "id": "cursor",
        "runtime": {
          "type": "acp",
          "acp": {
            "agent": "cursor",
            "backend": "acpx",
          },
        },
      },
    ],
  },
}
```

To enable ACP session spawning in Telegram threads, also add:

```jsonc
{
  "channels": {
    "telegram": {
      "threadBindings": {
        "spawnAcpSessions": true,
      },
    },
  },
}
```

Then tell OpenClaw to "create a persistent cursor session".

> Make sure `cursor-acp-bridge` is installed globally and configured in `~/.acpx/config.json` (see above).
