← Back to Plugins
Channels

Claude Cowork

carterisanartist By carterisanartist 👁 24 views ▲ 0 votes

Bridge that lets Claude Desktop / Claude Code dispatch, supervise, and trade escalations with a company's central OpenClaw assistant over a shared Telegram bot. Ships an MCPB extension, a Claude Code plugin manifest, and a cross-platform Electron installer.

GitHub

Install

npm install -g

README

# Company Claw Bridge

A bridge that turns the company's central [OpenClaw](https://openclaw.ai) assistant into a coworker
Claude can talk to. Claude **dispatches tasks** to Claw, **supervises** it, and **answers
escalations** Claw raises with `[ASK-CLAUDE]`. Transport is a shared company Telegram bot, so the
same Claw can be reached from any employee's machine without exposing the Gateway to the public
internet.

The bridge ships in two forms that share the same source tree:

- A **Claude Desktop MCPB extension** (`company-claw-bridge.mcpb`) per `manifest.json`.
- A **Claude Code plugin** (`.claude-plugin/plugin.json`) loadable via
  `claude --plugin-dir ./company-claw-bridge` or installed from a marketplace. The Claude Code
  manifest references the same `dist/index.js` MCP server, the same `user_config` keys, and the
  same Telegram-channel injection model.

Tools, env vars, and runtime are identical across both surfaces; the only difference is which
manifest the host application reads.

```
[Employee] -> [Claude Desktop] -> [MCPB plugin] -> [Telegram Bot API] -> [Company Claw on Telegram]
                                                                            |
                                            <- replies + [ASK-CLAUDE]s back -+
```

---

## What's in this repo

| Path                              | Purpose                                                                                                 |
| --------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `manifest.json`                   | MCPB / Claude Desktop manifest (tools list, `user_config`, server entry).                               |
| `.claude-plugin/plugin.json`      | Claude Code plugin manifest (same MCP server, `userConfig`, `channels`, `${user_config.*}` substitution). |
| `server/index.ts`                 | MCP server entry: registers all tools, wires lifecycle.                                                 |
| `server/config.ts`       | Reads `user_config` values out of `process.env`.                        |
| `server/telegram.ts`     | Telegram Bot API client: `sendMessage`, long-polling `getUpdates`.      |
| `server/dispatcher.ts`   | Tags outbound messages, correlates replies, streams progress.           |
| `server/escalation.ts`   | Detects `[ASK-CLAUDE]`, exposes answer flow.                            |
| `server/supervise.ts`    | Thin wrappers over Claw chat commands (`/status`, `sessions_*`, etc).   |
| `server/audit.ts`        | Optional dev-mode mirror to a second Telegram chat.                     |
| `server/state.ts`        | On-disk state: `update_id` watermark, pending requests, escalations.    |
| `server/logger.ts`       | stderr-only structured logger.                                          |
| `scripts/build.sh`       | Compile TypeScript and pack into `company-claw-bridge.mcpb`.            |

---

## Setup at a glance

There are two machines to configure, and the **same installer app** handles both. On launch
it asks you which role this machine plays:

| Role                            | Run on…                                          | What it does                                                                                                                                          |
| ------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Claw host**                   | The Mac mini / Windows box / server with OpenClaw | Binds the company Telegram bot to OpenClaw's `channels.telegram`, sets the DM allowlist, restarts the Gateway, runs `openclaw doctor`.                |
| **Claude side**                 | Each employee's laptop / workstation              | Verifies the shared bot token, auto-discovers the user's chat with the bot, installs the bridge into Claude Desktop's config, runs a smoke test.       |
| **Both on this machine**        | Dev / demo box running everything locally        | Runs the Claw-host setup, then the Claude-side setup, without re-asking for the token.                                                                 |

> ### Do the Claw host first
>
> The Claude-side install asks for two things the admin only produces during the Claw-host
> install: the **shared bot token** (from BotFather, plugged in during Step 2) and the
> **bot's @username** (printed at the end of Step 2). It also enforces the DM policy that
> was set on the Claw host — if `dmPolicy: "pairing"` is in effect, the employee can't
> reach Claw until the admin approves their pairing code.
>
> So the order is non-negotiable:
>
> 1. **Admin** creates the shared bot in Telegram, runs the installer on the OpenClaw
>    host in **Claw host** mode, and at the Done screen copies down: bot token, bot
>    @username, and which `dmPolicy` they picked.
> 2. **Admin** distributes those three things to every employee through whatever
>    channel you already trust for secrets (1Password, Bitwarden, a pinned message in
>    an internal channel — anything but plain email).
> 3. **Employee** runs the same installer on their own laptop in **Claude side** mode,
>    pastes the token, lets the wizard auto-discover their chat ID, and — if you went
>    with `pairing` — pings the admin for approval after their first DM to the bot.
>
> Running the wizards in the other order doesn't *break* anything (Claude side will
> just sit at "Smoke test failed: getMe rejected the token" until the admin produces
> one), but it wastes both people's time.

### Step 1 — Admin: create the shared bot

1. In Telegram, talk to [`@BotFather`](https://t.me/BotFather) and run `/newbot`.
2. Pick a name and username (e.g. `@CompanyClawBot`).
3. Save the bot token BotFather returns — this is the `telegram_bot_token` you'll hand out.
4. Recommended: in BotFather, run `/setprivacy` and **Disable** group privacy (only matters if
   you'll use Claw in group chats).

### Step 2 — Admin: run the installer on the OpenClaw host (Claw host mode)

1. Download `Company Claw Bridge Setup-<version>.dmg` (macOS) or
   `Company Claw Bridge Setup Setup <version>.exe` (Windows) onto the box that runs
   OpenClaw.
2. Launch the installer and pick **"This machine runs OpenClaw"**.
3. Wizard:
   1. **Prerequisites** — confirms `openclaw` is on PATH and Node 22.19+ (24 recommended) is
      available; per OpenClaw's own runtime requirements.
   2. **Initialize Claw** — pick an auth choice from the cards (Anthropic API key, OpenAI API
      key, OpenAI Codex OAuth, Google API key, Z.AI/GLM, Moonshot, Ollama, or any custom
      OpenAI/Anthropic-compatible endpoint), pick or type a provider-prefixed model ref
      (e.g. `anthropic/claude-sonnet-4-6`), optionally hit **Test connection** to probe
      the provider, then **Run openclaw onboard**. Under the hood we spawn
      `openclaw onboard --non-interactive --auth-choice <id> --skip-bootstrap --skip-health`
      with your API key injected via the documented env var, then `openclaw models set
      <provider/model>` to pin the default, then `openclaw status --deep` to confirm health.
      OpenClaw is the source of truth for the config write — we never touch
      `agents.defaults.model.primary` or `models.providers.<id>` ourselves.
   3. **Telegram bot** — paste the bot token; `getMe` confirms it.
   4. **Bind OpenClaw** — pick a **DM policy** (`pairing` / `allowlist` / `open` / `disabled`)
      and paste a comma-separated list of **numeric Telegram user IDs** allowed to DM the bot
      (or `*` for the `open` policy). Per OpenClaw's own contract, `@username` entries are
      silently dropped at runtime, so the installer rejects them up front and links you to the
      ID-discovery options (`openclaw logs --follow`, `getUpdates`). Writes
      `channels.telegram.{enabled: true, botToken, allowFrom, dmPolicy}` into
      `~/.openclaw/openclaw.json` with a timestamped backup. A "Run `openclaw doctor --fix`"
      escape hatch is one click away if pre-existing config needs cleanup.
   5. **Activate gateway** — three side-by-side actions:
      - **Install daemon** runs `openclaw gateway install`, registering the gateway as a
        macOS LaunchAgent, Linux systemd user unit, or Windows Scheduled Task (with a
        per-user Startup-folder fallback) so it survives reboot.
      - **Restart only** runs `openclaw gateway restart` for setups that manage the daemon
        elsewhere.
      - **Diagnose** runs `openclaw doctor` and `openclaw status --deep` so you can verify
        health without dropping into a terminal.

      If you picked `dmPolicy: "pairing"`, a **Pairing approval** panel appears: it polls
      `openclaw pairing list telegram` and lets you approve incoming codes inline with a
      single click (equivalent to `openclaw pairing approve telegram <code>`).
   6. **Done** — copy down three things and send them to every employee through your usual
      secrets channel:
      - the **bot token** (sensitive — treat it like a password),
      - the **bot @username** so employees know who to DM to start a chat,
      - the **DM policy** you picked (`pairing` / `allowlist` / `open` / `disabled`) so
        employees know what to expect on first contact, and so anyone on `pairing` knows
        to ping you for approval after their first DM.

### Step 3 — Employee: run the installer on each laptop (Claude side mode)

**Before you start, get these three things from your admin** (they're produced by Step 2
above): the **bot token**, the **bot @username**, and the **DM policy** the admin picked.
If the policy is `pairing`, you'll also need to flag the admin after your first DM so
they can approve your pairing code on the Claw host.

1. Download the same installer.
2. Launch it and pick **"This machine runs Claude Desktop"**.
3. Wizard:
   1

... (truncated)
channels

Comments

Sign in to leave a comment

Loading comments...