obmp-agent
by abhaymettu
README.md
# obmp-agent
The agent peer for [Obsidian Multiplayer](https://github.com/abhaymettu/obsidian-multiplayer). One command line tool, one MCP server and one mount daemon. An agent joins a shared note or folder as a member with its own key and role, next to the people typing in it. Its cursor reads `[AI: name]`. The owner can pause it, roll back its edits and revoke its key.
## Install
```sh
npm install -g github:abhaymettu/obmp-agent
obmp-agent help
```
Node 24.22 or newer on the 24 line, or 26.11 or newer. Earlier releases, Node 22 included, stop reporting a file to recursive `fs.watch` once it is replaced by a rename, so a person's edits after an agent's write go unseen. One runtime dependency, `loro-crdt`, which ships prebuilt WebAssembly. No native build step.
## Connect a client
The plugin's **Add agent** button writes the key to `~/.obmp/agents/<alias>.key` (mode 0600) and copies the client line. To print it again:
```sh
obmp-agent setup claude claude # also codex, cursor, opencode
obmp-agent status claude
```
A plain vault folder needs no key:
```sh
obmp-agent mcp --vault ~/vault
```
Guides live with the plugin:
- [Quickstart](https://github.com/abhaymettu/obsidian-multiplayer/blob/main/docs/quickstart.md): plugin to first agent edit, pause, rollback and revoke
- [Integration guide](https://github.com/abhaymettu/obsidian-multiplayer/blob/main/docs/integration-guide.md): CLI, MCP tools by role, mount daemon, handoffs, leases, exit codes
- [Agent skill](https://github.com/abhaymettu/obsidian-multiplayer/blob/main/SKILL.md): the procedure an agent follows inside a share
- [Security model](https://github.com/abhaymettu/obsidian-multiplayer/blob/main/SECURITY.md)
## Keys
A key never goes on a command line. `obmp-agent` refuses one in argv with exit 11 before any network code loads. Use `--stdin`, `--from-file` or `OBMP_KEY_FILE`. `obmp-agent doctor` checks file modes, expiry and relay reach, and scans shell history and MCP configs for a pasted key.
## How it relates to the plugin
The engine, wire format and crypto are Obsidian Multiplayer's core. This repo carries the plugin repo as a git submodule, `upstream/`, pinned to a public commit, and reaches core through one file, `src/core.ts`. The bundle in `dist/` includes core, so an install pulls nothing from `upstream/` at run time. The plugin repo's CI checks out this repo with `upstream/` set to its own tree and runs the whole suite, so a core change that breaks the agent fails there first.
## Develop
```sh
git clone --recurse-submodules https://github.com/abhaymettu/obmp-agent
cd obmp-agent
npm install
npm run typecheck
npm test
```
`npm test` runs the unit pins and the agent kill suite: mount jail, secret leaks, swarm governor, steer authorship, pause and revoke, two keys, MCP parity. The end to end test over a real relay needs the relay binary:
```sh
cargo build --release --manifest-path upstream/relay/Cargo.toml
```
It looks in `upstream/relay/target/release/obre1-relay`, or in `OBRE1_RELAY_BIN`.
A checkout runs its TypeScript source. An install runs `dist/obmp-agent.mjs`, which is committed so a GitHub install needs no build step. After a change under `src/`, run `npm run bundle` and commit `dist/` with it; CI fails if the two differ.
## Container
```sh
npm run bundle
docker build -t obmp-agent .
docker run --rm -i -v "$HOME/.obmp/agents/claude.key":/run/secrets/obmp_key:ro obmp-agent mcp
```
The image runs as a non-root user on `node:24-alpine`. The key arrives by file mount only.
## License
MIT, the same license as the plugin. See [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues