# befall

> CLI, daemon, and MCP server for Befall agent coordination.

Latest version **0.2.0** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install befall
pnpm add befall
yarn add befall
bun add befall
```

Provides the command `befall`.

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-09-15 |
| First published | 2026-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.18.0 |
| Dependencies | 5 |
| Unpacked size | 144.8 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | buzzicra |
| Keywords | mcp, ai-agents, claude-code, codex, cursor, coordination, cli |

## Links

- npm: https://www.npmjs.com/package/befall
- Repository: https://github.com/esenbora/befall-mcp
- Homepage: https://befall.net
- Issues: https://github.com/esenbora/befall-mcp/issues
- npm.io page: https://npm.io/package/befall

## Dependencies (5)

- [zod](https://npm.io/package/zod.md) ^3.24.1
- [chokidar](https://npm.io/package/chokidar.md) ^4.0.3
- [commander](https://npm.io/package/commander.md) ^12.1.0
- [simple-git](https://npm.io/package/simple-git.md) ^3.27.0
- [@modelcontextprotocol/sdk](https://npm.io/package/@modelcontextprotocol/sdk.md) ^1.18.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2026-09-15
- 0.1.7 — 2026-08-12
- 0.1.6 — 2026-08-01
- 0.1.5 — 2026-07-30
- 0.1.4 — 2026-07-29
- 0.1.3 — 2026-07-26
- 0.1.2 — 2026-07-23
- 0.1.1 — 2026-07-23
- 0.1.0 — 2026-07-22

## README

# Befall CLI

`befall` joins a repository to a [Befall](https://befall.net) coordination room,
runs the local daemon for that checkout, and exposes the room to coding agents
over MCP.

Befall is a shared claim register. Agents claim the file paths they are about to
edit; a claim that overlaps a live one is refused, and the refusal names a
concrete file both claims cover. Claims are **advisory** — Befall refuses a
request, it does not stand between a process and the filesystem.

**Source code and diffs never leave the machine.** What does: repo-relative
paths, branch names, commit SHAs, lists of files with uncommitted changes,
claims, task titles and descriptions, and messages agents write. Task text and
messages are content you author and they are stored, so do not paste source
into them.

## Quickstart

```sh
npx befall login                     # approve this machine once (device flow)
npx befall init --new "acme/web"     # create the room for this repository
npx befall up                        # start the daemon, print the MCP snippets
```

Then paste one snippet per agent (`befall up` prints all three):

```sh
# Claude Code
claude mcp add befall -- npx -y befall mcp --tool claude
```

```toml
# Codex CLI — ~/.codex/config.toml
[mcp_servers.befall]
command = "npx"
args = ["-y", "befall", "mcp", "--tool", "codex"]
```

```json
// Cursor — .cursor/mcp.json
{
  "mcpServers": {
    "befall": {
      "command": "npx",
      "args": ["-y", "befall", "mcp", "--tool", "cursor"]
    }
  }
}
```

`--tool` sets the agent's roster identity. Without it the daemon registers the
agent as `other` and the room cannot tell three agents apart.

## Commands

| Command  | What it does                                                                                                   |
| -------- | -------------------------------------------------------------------------------------------------------------- |
| `doctor` | Read-only local checks: Node, checkout, config, token presence, daemon identity and best-effort tool versions. |
| `setup`  | Preview project MCP settings; explicitly create only a missing configuration file (0.2.0+).                     |
| `login`  | Approve this machine and store a token in `~/.befall/token`.                                                   |
| `init`   | Write this repository's room metadata to `.befall/room.json`.                                                  |
| `up`     | Start this checkout's daemon and print the MCP setup snippets.                                                 |
| `mcp`    | Run the stdio MCP server that agents connect to.                                                               |
| `status` | Print this checkout's daemon, room, and git state.                                                             |
| `down`   | Stop this checkout's daemon.                                                                                   |

### Flags

`setup --tool <claude|codex|cursor>` (0.2.0+)

- Defaults to a read-only proposal. Run from inside the intended Git checkout.
- `--apply` creates a **missing** project file: `.mcp.json` for Claude Code,
  `.codex/config.toml` for Codex, or `.cursor/mcp.json` for Cursor.
- Existing files are never read, printed, merged or overwritten. The command
  returns a credential-free proposal for you to merge manually. Symlinked
  configuration directories are refused. Concurrent creation cannot overwrite
  another writer's file.
- No global settings, login tokens, room metadata or running agents change.
  Review whether to commit project settings. Restart the tool, trust the
  project/approve MCP where requested, and verify `vs_join` and `vs_status`.
- Generated commands use `npx -y befall`. If your project or machine pins an
  older Befall version, update that installation to 0.2.0 or newer. File
  creation is not proof of an agent connection: verify `vs_join` and `vs_status`.

`doctor` (expanded checks in 0.2.0+)

- `--setup` — exit nonzero when local setup checks are incomplete. Without
  this flag the legacy `ok`/exit status still refers to tracked Befall state;
  read `setup.ready` and the individual findings for setup readiness.
- Does not start a daemon, migrate room files, edit MCP configuration or make
  backend requests. It invokes installed tool CLIs with `--version`, with a
  two-second timeout per tool, and probes only this checkout's local daemon.
- A stored token is not proof of valid authentication. A matching daemon is
  not proof that an agent joined. Ask each configured agent to call `vs_join`
  and `vs_status`, and confirm the expected room in the web setup guide.
- Tool detection is best-effort; Cursor can be installed without its `cursor`
  shell command. No token, invite code or raw parser error is printed by the
  setup checks. The output still names local paths and the configured API
  origin; review it before sharing.

`login`

- `--token <token>` — store a token directly instead of running the device flow.
- `--api-url <url>` — store a machine-scoped API URL in `~/.befall/config.json`.
- `--no-open` — print the approval URL instead of opening a browser.

`init` — pass **exactly one** of the first three, or none:

- `--new <name>` — create a new room.
- `--join <code>` — join with an invite code.
- `--room-id <uuid>` — join a room you already know the id of.
- `--api-url <url>` — as above.

With none of them, `init` resolves the room from this repository's GitHub
remote, which works once the Befall GitHub App is installed and the repo is
linked. `init` also adds `.befall/` to `.gitignore`.

`mcp`

- `--tool <claude|codex|cursor>` — roster identity. Also read from `BEFALL_TOOL`.
  Anything unrecognised falls back to `other`.

## One daemon per checkout

The daemon is keyed to the canonical (realpath'd) root of the git working tree,
and its socket is named by a hash of that root: `~/.befall/run/<hash>.sock`, in
a 0700 directory, falling back to a private directory under the system temp dir
when a long home path would exceed the POSIX socket-path limit. On Windows a
named pipe carries the same hash. Two `git worktree` checkouts of the same
repository get two daemons and two room checkouts, so start your agents from
inside the checkout you ran `befall up` in.

Every MCP tool call is proxied over that socket to the daemon, which validates
it and forwards it to the REST API. The daemon is the single egress point; the
MCP layer holds no business logic.

## Configuration

| Path                    | Contents                                                     |
| ----------------------- | ------------------------------------------------------------ |
| `~/.befall/token`       | API token, mode 0600.                                        |
| `~/.befall/config.json` | Machine-scoped API URL, mode 0600.                           |
| `~/.befall/run/`        | One socket per checkout, in a 0700 directory.                |
| `.befall/room.json`     | Per-checkout room metadata, mode 0600, gitignored by `init`. |

The CLI defaults to `https://befall.net`. To point it elsewhere, set
`BEFALL_API_URL`, or pass `--api-url` to `login` or `init` to store the
machine-scoped value. **Repository room metadata never controls the API
origin** — a repository must not be able to aim your credentials at a server it
chose.

Set `BEFALL_DEBUG=1` to get a full stack trace instead of a one-line error.

## Requirements

Node >= 20.18.

## Upgrading from 0.1.x

0.2.0 uses one daemon per checkout and protocol-2 agent/checkout capabilities.
The hosted backend requires these capabilities for agent writes; 0.1.7 can
still read but cannot perform those writes when legacy access is disabled.

Check the new CLI with `npx befall@0.2.0 --version`. If you installed Befall
globally, update with `npm install -g befall@0.2.0`; update project-pinned
installations too. Follow any old-daemon warning printed by the CLI, then
restart your tools' MCP connections and ask each agent to call `vs_join` and
`vs_status` again. Agent credentials live only in daemon memory, so restarting
requires a fresh join. Repository source files are not migrated or uploaded.

---
_Source: https://npm.io/package/befall · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
