Octo-Arms
by oomer583
README.md
# Octo-Arms
**One brain. Many arms.** A zero-dependency [MCP](https://modelcontextprotocol.io) server that gives an AI assistant a persistent memory and a set of pluggable tools, running on your own machine.
- **Remembers across chats.** A small knowledge graph (events, projects, decisions, ideas, people, notes, connected by named links) stored in one JSON file you own.
- **Arms are just files.** Drop a `.js` file into `arms/` and its tools appear. The included arms are `memory` and `host` (read-only machine status).
- **No dependencies.** Plain Node.js (18.15 or newer), no `npm install`.
- **Safe by default.** Listens on `127.0.0.1`, requires a long secret, limits request size, and refuses to store anything that looks like a password or API key.
> Status: early (v0.1). It started as a private assistant used every day and was cleaned up for sharing. The memory arm and the server are covered by a smoke test (`npm test`).
## Quick start
Needs Node 18.15 or newer. Nothing else to install.
```bash
git clone <this repo>
cd octo-arms
npm run setup # creates .env with two fresh random secrets (never overwrites an existing .env)
node server.js
```
You should see `Octo-Arms ready on 127.0.0.1:3333 with 15 tools`.
The setup prints your MCP endpoint once: `http://127.0.0.1:3333/mcp/<OCTO_ARMS_SECRET>`. You can also send `Authorization: Bearer <OCTO_ARMS_SECRET>` to `/mcp`. Treat it like a password.
### Connect an AI assistant
Use any MCP client that supports remote HTTP servers. If your client runs on another machine (for example a hosted chat app), the server has to be reachable from the internet, which needs a tunnel such as Cloudflare Tunnel, Tailscale Funnel or ngrok. Read **Security** below first.
Then give the assistant the instructions in [`docs/memory-skill.md`](docs/memory-skill.md). They teach it *when* to look things up, *when* to write, and what never to store. The tools alone are not enough: without those rules the assistant will not know to use memory at the right moment.
## Tools
| Tool | What it does |
|---|---|
| `memory_search` | Find nodes by words; empty query returns the newest nodes |
| `memory_get` | Open one node with its links (depth 1 or 2) |
| `memory_save` | Write a node and link it to existing ones |
| `memory_link` | Add a relation between two nodes |
| `memory_update` | Edit title, summary or tags |
| `memory_delete` | Delete a node and its links |
| `host_status` | CPU, RAM, disk, uptime of the host (read-only) |
| `diagnose_error` | Look an error up in a table of known errors, check tool versions, return redacted evidence (read-only) |
| `diagnose_log` | Same for the end of a log file in a folder you allowed (read-only) |
| `toolbox_status` | Tools in Octo-Arms's own tools folder and on the system (read-only) |
| `toolbox_update` | Install or update a tool in Octo-Arms's own folder (approval needed) |
| `toolbox_rollback` | Go back to the previous version (approval needed) |
| `video_watch` | Send a video to your own video service; get a timestamped transcript and a 12-frame contact sheet (read-only) |
| `webhook_send` | Send one JSON event to a configured URL (approval needed) |
Node types: `event`, `project`, `decision`, `idea`, `person`, `note`. A title is up to 120 characters and a summary up to 1500; longer notes should be split into linked nodes.
## Add an arm
Copy [`arms/_example.js`](arms/_example.js) to `arms/yourthing.js`, edit it, restart. Each tool has a `name`, a `description` (tell the model when to use it and what it must never do), an `inputSchema` and a `handler`. Set `OCTO_ARMS_ARMS=memory,host` to load only some arms.
If an arm changes something in the world (sends, deletes, posts, restarts), enforce the safety rules in code, with a required `confirm` argument and an allow-list, instead of trusting the tool description alone.
## Error diagnosis without an AI inside Octo-Arms
`diagnose_error` and `diagnose_log` do not contain a model and do not guess. They do three plain things:
1. Look the error text up in [`knowledge/known-errors.json`](knowledge/known-errors.json), a data file. Each entry has the matching text, the cause, the fix, a source link and how sure the entry is.
2. Check the installed versions of a few allow-listed programs (`deno`, `ffmpeg`, `node`) against the documented minimum. The data file cannot add programs to that list.
3. Return the evidence, with secrets, user names, IPs and e-mail addresses removed, to the assistant that called Octo-Arms. If nothing matches, the answer says so and the assistant reasons from the evidence.
This only knows the errors in the table. Add an entry each time you meet a new one, with a source. Log text is untrusted: the output is labelled so, and no tool ever runs anything taken from it.
`diagnose_log` reads only `.log`, `.txt`, `.out` and `.err` files inside folders you list in `OCTO_ARMS_LOG_DIRS` (separated by `;` on Windows, `:` elsewhere). Paths outside those folders and symlinks that point out of them are refused. Octo-Arms cannot see the errors of other programs on its own; it sees what is pasted to it, its own arms, and those folders.
## Watching videos
`video_watch` sends a video to a service you run (`OCTO_ARMS_VIDEO_SERVICE_URL`, optional `OCTO_ARMS_VIDEO_SERVICE_TOKEN`) and gives the assistant two things: a transcript with timestamps and one image holding 12 frames in a 4x3 grid, so it can follow what is on screen as well as what is said. The service contract is a single JSON request and response, described at the top of [`arms/video.js`](arms/video.js).
Octo-Arms itself never fetches or downloads videos. The reference service, [`examples/local-video-service.js`](examples/local-video-service.js), works on video files on your own computer: it reads only folders you list in `VIDEO_SERVICE_DIRS`, builds the contact sheet with `ffmpeg`, and uses a `.srt` or `.vtt` file with the same name as the transcript. It needs `ffmpeg` and `ffprobe` installed.
```bash
VIDEO_SERVICE_DIRS=/path/to/videos node examples/local-video-service.js
# in .env: OCTO_ARMS_VIDEO_SERVICE_URL=http://127.0.0.1:3340/
```
Whatever else you connect behind that address is your responsibility, including the terms of any website it touches.
## The tools folder
Octo-Arms keeps programs it manages in `<OCTO_ARMS_HOME>/tools` (default `~/.octo-arms/tools`) and starts them by full path. It never changes your system installation or PATH. Today it can manage Deno.
`toolbox_update` downloads the official release from GitHub (host allow-list checked on every redirect), checks the sha256 published next to the archive, runs the new program to confirm its version, and only then switches to it. The previous version is kept and `toolbox_rollback` returns to it. Both tools go through the approval gate. The checksum comes from the same release page as the archive, so it catches corrupt or swapped downloads, not a compromised release.
Other programs, including n8n, still use their own installation unless you point them at the Octo-Arms copy. Tested on Linux with real downloads; the Windows and macOS paths use the system `tar` and have not been tested.
## Approval gate
Arms that change things in the real world (sending, posting, deleting) must not rely on a sentence in the tool description. Octo-Arms enforces approval in code:
1. The model calls a gated tool, for example `webhook_send`. Nothing runs. It gets an approval id.
2. A human releases or cancels it on a separate endpoint, with a separate secret the model never holds:
```
curl -X POST http://127.0.0.1:3333/approve/<OCTO_ARMS_APPROVE_SECRET> -d '{"action":"list"}'
curl -X POST http://127.0.0.1:3333/approve/<OCTO_ARMS_APPROVE_SECRET> -d '{"action":"approve","id":"<id>"}'
curl -X POST http://127.0.0.1:3333/approve/<OCTO_ARMS_APPROVE_SECRET> -d '{"action":"deny","id":"<id>"}'
```
3. Each approval is single use, expires after 10 minutes (`OCTO_ARMS_APPROVAL_TTL_MIN`), and runs exactly the arguments that were proposed.
If `OCTO_ARMS_APPROVE_SECRET` is missing, or equal to `OCTO_ARMS_SECRET`, gated tools refuse to run. To gate your own arm, call `gate.propose(name, args, run)` from `lib/gate.js`.
The `webhook_send` arm posts one JSON event to `OCTO_ARMS_WEBHOOK_URL` (an n8n webhook, your own video agent, anything). The URL comes from configuration, never from the model.
## Security
- Anyone who has your URL (or token) can read and write your memory. Treat `OCTO_ARMS_SECRET` like a password, and rotate it if it leaks (it also appears in tunnel and proxy logs when used in the URL path; prefer the Bearer header where your client allows it).
- Keep the default `OCTO_ARMS_HOST=127.0.0.1`. Expose it only through a tunnel you control.
- The memory file contains whatever you chose to save, which may be personal. `data/` is in `.gitignore`; keep it that way and never commit it.
- The built-in secret filter is a safety net, not a guarantee. Do not ask the assistant to store credentials.
- No arm in this repo runs shell commands built from tool arguments. Keep it that way in arms you write.
## Tests
```bash
npm test
```
## How this was made
Built with help from Claude (Anthropic) for code review, hardening and documentation. Zero third-party libraries or services are used at runtime.
## License
MIT, see [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues