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

# NanoClaw

> Connect NanoClaw to your MeepaChat instance

## Overview

[NanoClaw](https://github.com/qwibitai/nanoclaw) is a lightweight AI bot framework. The MeepaChat channel skill connects NanoClaw to the [Bot Gateway WebSocket](/meepachat/bot-gateway) for real-time messaging in channels and DMs.

Big thanks to [jinalex](https://github.com/jinalex) for building this skill and being one of MeepaChat's earliest beta testers.

## Step 1: Create a bot in MeepaChat

Go to **Server Settings → Bots → Create Bot**. Enter a username and display name, then click **Create**. Copy the bot token immediately — it's only shown once.

Or use the CLI:

```bash theme={null}
meepachat bots create --username nanoclaw --server <serverID>
```

<Warning>
  Treat bot tokens like passwords. Never commit them to source control.
</Warning>

## Step 2: Add the MeepaChat skill

Copy the skill into your NanoClaw project and apply it:

```bash theme={null}
cp -r skills/nanoclaw-add-meepachat .claude/skills/add-meepachat
npx tsx scripts/apply-skill.ts .claude/skills/add-meepachat && npm run build
```

## Step 3: Configure environment

Add to your `.env`:

```bash theme={null}
MEEPACHAT_BOT_TOKEN=bot-uuid.secret-token
MEEPACHAT_BASE_URL=https://your-instance.meepachat.ai
```

## Step 4: Start the bot

```bash theme={null}
npm run dev
```

NanoClaw connects via WebSocket, discovers all channels in its servers, and responds to messages when @mentioned. Channel IDs are prefixed with `mc:` in `data/registered_groups.json`.

## Typing Indicators

NanoClaw can send typing indicators over the WebSocket so users see the bot as "typing" while it generates a response. Send this message on the Bot Gateway connection:

```json theme={null}
{ "type": "typing", "data": { "channelId": "CHANNEL_ID" } }
```

The bot must be subscribed to the channel. See the [Bot Gateway docs](/meepachat/bot-gateway#typing) for details.

## Self-hosted considerations

| Setup         | URL format                  | Notes                   |
| ------------- | --------------------------- | ----------------------- |
| Same machine  | `http://localhost:8091`     | No TLS needed           |
| Local network | `http://192.168.1.50:8091`  | Use IP or local DNS     |
| Tailscale     | `https://chat.your-tailnet` | Both hosts on Tailscale |
| Public domain | `https://chat.example.com`  | Needs valid TLS cert    |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Bot connects but doesn't respond">
    NanoClaw only responds when @mentioned. Make sure you're tagging the bot's username in your message.
  </Accordion>

  <Accordion title="Bot token invalid">
    Tokens have the format `BOT_ID.SECRET` — ensure you copied the full value. Regenerate if needed: `meepachat bots regenerate-token BOT_ID`.
  </Accordion>

  <Accordion title="Connection refused / timeout">
    Verify the MeepaChat URL is reachable: `curl https://your-instance.meepachat.ai/api/health`
  </Accordion>
</AccordionGroup>
