Skip to main content
Glama
server-noonien

server-noonien

Official

server-noonien

CI CodeQL Glama mcprush npm
version License: MPL 2.0 Node ≥
22

Shared, serverless, conflict-free memory for AI agents — with peer-to-peer sync.

server-noonien is a drop-in replacement for the official @modelcontextprotocol/server-memory knowledge graph — the same entities, observations and relations — that converges across machines with no central server, no database and no merge conflicts.

Its headline feature is peer-to-peer sync: the nooniend daemon replicates each node's shard directly to the others, so several machines share one memory with no shared folder — only IP reachability over a VPN or a LAN.

Table of contents

Related MCP server: Lorekeeper

Why server-noonien

The problem

Agent memory today is local, and the official memory server is a single JSONL file that every mutation reads and rewrites in full. That breaks the moment you have more than one machine:

  • It lives on one host. Switch machine and your agent has forgotten everything.

  • Sharing it over a synced folder loses writes. The server serializes mutations in-process only: two hosts each load the whole graph, mutate their own copy and write it back, so the last write silently discards the other's — and the sync tool forks the file into conflict copies instead of merging it.

  • The alternatives want a server, a database or a cloud. The mainstream "shared memory" products are something you have to host, or they ship your memory off your machines.

How server-noonien solves it

server-noonien removes the shared file and the central server at the root, and keeps the drop-in tool surface:

  • Every node keeps its own memory. Each machine writes only its own append-only shard (<node>.jsonl); a shard has a single writer by design, so no two servers ever write the same file and noonien itself never forks one — a shared area's syncer still can, and a conflict copy is just another shard to fold.

  • Shards merge, they do not overwrite. The graph is a CRDT — an LWW-Element-Set ordered by (HLC, node, sequence) — whose merge is idempotent, commutative, associative and convergent. Any two machines that have seen the same operations hold the identical graph, in any order, so there is no "last write wins" data loss.

  • No shared area, no central server. The shards travel directly between machines with the nooniend daemon — only IP reachability, over a VPN or a LAN — so several machines share one memory with no shared folder and no service to host. Prefer a folder or a bucket you already have? file and s3 work too: the transport is a choice, not a lock-in.

  • Local-first and offline-friendly. Every node reads and writes its own shard on disk and keeps a full local replica, so it keeps working offline; the mesh reconverges when the network returns.

  • Drop-in for the official server. The same nine tools, inputs and outputs, so it slots under the memory server name with no agent changes — plus the update_*, merge_entities and read_conflicts extensions, the operations the official nine have no equivalent for.

Comparison

server-noonien vs the official memory server vs hosted memory services:

server-noonien

Official server-memory

Hosted memory services

Multi-machine

Yes — per-node shards, one graph

No — one local file

Yes, via the service

Sharing a synced folder

Safe — append-only, conflict-free

Unsafe — whole-file read-modify-write

N/A

Needs a server / database

No

No

Yes

Needs a cloud account

No

No

Yes

Works offline

Yes (file backend)

Yes

No

Storage

Folder or S3-compatible bucket, your choice

One JSONL file

Their cloud

Drop-in for the official tools

Yes — same nine, plus extension tools

—

No

Migration

noonien import memory.jsonl

—

Export/import dance

Model

Explicit knowledge graph

Explicit knowledge graph

Often vector/semantic

License

MPL-2.0

MIT

Proprietary

Hosted is a category, not a product: it covers services that host your memory for you. server-noonien is the local-first opposite — you own the storage and there is no account.

A shared area is required for the file/s3 backends — a folder or an object store every node can reach. nooniend removes that requirement: it replicates the shards directly between nodes.

The three commands

One npm package, server-noonien, ships three commands (Node.js ≥ 22). Install it once and all three land on your PATH:

npm install -g server-noonien

The s3 backend's @aws-sdk/client-s3 is an optional dependency, loaded only when NOONIEN_BACKEND=s3 selects it. npm install -g server-noonien --omit=optional skips it when you never use s3.

Command

Role

How it runs

server-noonien

the MCP memory server

short-lived, spawned by the MCP client over stdio

noonien

the maintenance CLI

one-shot, run by hand

nooniend

the peer-to-peer replication daemon

long-lived, one per machine

Only server-noonien matches the package name, so it is the only command npx can run by package name. Run the other two with --package, or from the global install above:

npx -y server-noonien                       # the MCP server (no argument serves over stdio)
npx -y -p server-noonien noonien help       # the maintenance CLI
npx -y -p server-noonien nooniend           # the replication daemon

From a clone — for development, or to run code not yet on npm:

git clone https://github.com/sequico/server-noonien.git
cd server-noonien && npm install && npm run build

node dist/index.js      # server-noonien — the MCP server
node dist/noonien.js   # noonien    — the maintenance CLI
node dist/gossip.js     # nooniend   — the replication daemon

server-noonien — the MCP server

The entry every MCP client uses. With no argument (or serve) it speaks MCP over stdio, so you don't run it yourself — the client spawns it and it lives for the session:

npx -y server-noonien                          # the stdio command the client runs
claude mcp add memory -- npx -y server-noonien # register it with Claude Code as the `memory` server

Point your client at it; it works on one machine out of the box, and sharing across machines is the next step. In OpenCode (V2):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "memory": {
        "type": "local",
        "command": ["npx", "-y", "server-noonien"],
        "environment": { "NOONIEN_DIR": "~/.noonien" }
      }
    }
  }
}

Other clients wrap the same command and environment in their own envelope; from a clone the command is ["node", "/path/to/server-noonien/dist/index.js"]. Because the nine drop-in tools keep the same names, inputs and outputs, you can replace the memory server entry with server-noonien and change nothing else.

noonien — the maintenance CLI

Command

Does

noonien serve

run the MCP memory server over stdio (the same as server-noonien)

noonien import <file>

import an official server-memory JSONL file (writes its own <node>-import shard, so it runs online)

noonien export

print the folded knowledge graph as JSON

noonien merge

fold every shard and report the merged state

noonien compact

maintain this node's shard now — prune shadowed operations and, only where it is safe, physically delete its tombstones (the server's own rule: NOONIEN_GC; a daemon that owns the directory keeps the whole view and the shard) — and prune every *-import shard the directory holds

noonien query <text>

search entities and print the matching subgraph

noonien help

list the commands; noonien --version prints the version

nooniend — the daemon

A long-lived service, one per machine, that replicates the shard directory peer to peer. It takes no arguments and is configured entirely through environment variables — the shared NOONIEN_DIR and NOONIEN_NODE_ID (Shared variables) plus the daemon's NOONIEND_* (Daemon variables). See Peer to peer for the setup.

Share across machines

noonien merges shards; it does not move them by itself. How the shards travel between machines is your choice: peer to peer (a companion daemon — the recommended default) or a shared area (a folder or a bucket that already exists). The MCP server always reads and writes its own local shard; only the transport differs.

Peer to peer — nooniend (recommended)

The recommended way to share one memory across machines with no shared storage. nooniend is a long-lived daemon that replicates the local shard directory peer to peer. It only needs IP reachability, so it runs over any VPN (WireGuard, Tailscale, OpenVPN, Netbird, ZeroTier, …) or a plain LAN.

Give each machine a unique node id and run one nooniend per machine. Every daemon keeps a full replica of the others' shards beside its own, in the same local directory the MCP server uses — no shared folder required:

# on a tailnet
NOONIEN_DIR=~/.noonien \
NOONIEND_TAILSCALE=true \
nooniend

# or, with no self-listing underlay, seed one reachable peer
NOONIEN_DIR=~/.noonien \
NOONIEND_PEERS=ai.example:49778 \
nooniend

The peers find each other — you never list the machines. Configure one discovery source: NOONIEND_TAILSCALE (from tailscale status), NOONIEND_DNS_SRV (the _nooniend._tcp SRV records), or NOONIEND_PEERS (a static seed; one is enough, membership then self-propagates). A discovery source returns candidates, not members: a candidate joins only once it answers /info, so a machine on the network that does not run nooniend is never adopted. NOONIEND_ADVERTISE is optional and defaults to the listen host.

How it behaves:

  • Never authors operations. Each node's MCP server writes only its own <node>.jsonl; the daemon keeps replicas of the peers' shards and only ever pushes the shard it authors, so the single-writer rule holds. It also restores the local shard from a peer's replica when the local copy is behind.

  • Push on change + periodic anti-entropy. On a local change (NOONIEND_PUSH) and every NOONIEND_INTERVAL seconds it compares the per-shard high-water seq and moves the delta in whichever direction is behind. Operations are idempotent, so delivery may be best-effort — no consensus, no ordering, only eventual completeness.

  • Scales past a full mesh. By default it contacts every peer; NOONIEND_FANOUT caps that to a random subset per round — which excludes tombstone collection, because a reachable peer the round did not sample suspends it, so the daemon refuses that combination — and at or above NOONIEND_DIGEST_MIN_SHARDS it reconciles through a fixed-size digest instead of the full shard list (with NOONIEND_CHANNELS moving membership onto its own channel). A small mesh keeps behaving exactly like a full mesh, and a peer without the digest capability falls back to the plain list, so a mixed mesh never breaks.

  • Relays. A node serves every replica it holds, so an offline node keeps converging through any peer that has its shard.

  • Discovery and membership. Bootstrap adapters (Tailscale, DNS SRV, a static seed) return candidates; the peer set then gossips itself. A static node@host:port seed is explicit intent and enters membership directly; a bare address (a Tailscale or DNS-SRV candidate) joins only once it answers /info, and its id comes from that answer — never from the discovery source — so a device that does not run nooniend is never a member and never blocks collection. A node that comes up is adopted on its next probe, and the sources are re-read every NOONIEND_DISCOVER_INTERVAL seconds, so a joiner is found without a restart. Liveness comes from the exchange results — suspect after NOONIEND_SUSPECT_AFTER failures, dead after NOONIEND_DEAD_AFTER, retried after NOONIEND_DEAD_RETRY, and forgotten after NOONIEND_MEMBERSHIP_TTL. A peer that reaches this node is marked alive — its certificate names it under mTLS, otherwise the id it announces on the request — so a peer that recovers is re-engaged at once instead of waiting out NOONIEND_DEAD_RETRY. A caller that is not a peer yet is never adopted from its headers: nothing it sends becomes membership, and its id is never taken on trust. It is offered as a discovery candidate instead — the host the request came from, the port it announces — and the daemon confirms it on /info, exactly like a Tailscale or DNS candidate. That is how a statically-seeded joiner is discovered by the seeds it reached, within a round, and why an address announced for a different host is never even probed. A node's own entry is authoritative; an address that serves a different node is dropped.

  • Wire and security. A small HTTP/JSON service bound to NOONIEND_LISTEN (the full wire contract is in PROTOCOL.md); a shard accepts only its own node's operations. mTLS with per-peer certificates: the certificate's common name is the node id, so a peer may only push the shard it authors, while reads stay open to any authenticated peer — which is what lets a node relay. NOONIEND_REVOKED refuses specific nodes on every route; NOONIEND_DEPARTED additionally discards a departed node's replica and lets collection proceed past it.

  • Observability. Prometheus metrics — liveness, peer health, the stable watermark and, for collection, how long each peer has been away (noonien_gossip_absent_seconds) and how many deleted elements are frozen (noonien_gossip_frozen_elements) — plus a per-shard stable watermark (the minimum high-water mark reached on every contactable peer, a conservative causal-stability bound), and status and graph routes for probes and operators — see The daemon HTTP API.

Under systemd, a user unit:

[Unit]
Description=nooniend — peer-to-peer shard replication
After=network-online.target

[Service]
EnvironmentFile=%h/.config/noonien/nooniend.env
ExecStart=%h/.local/bin/nooniend
Restart=on-failure

[Install]
WantedBy=default.target

The daemon HTTP API

nooniend serves a small HTTP/JSON API on NOONIEND_LISTEN (default 0.0.0.0:49778). The full wire contract — routes and payloads, the operation format, the protocol revision and capabilities, the size limits and the mTLS model — is specified in PROTOCOL.md.

curl -s http://127.0.0.1:49778/health
curl -s http://127.0.0.1:49778/status
curl -s http://127.0.0.1:49778/peers
curl -s http://127.0.0.1:49778/graph | jq '{entities: (.entities|length), relations: (.relations|length)}'

/graph folds everything the node holds, so it is a diagnostic for a normal directory: past 50 000 operations it answers 413 and asks for the shards instead, which serve the same data a page at a time.

Shared area — file and s3

The file and s3 backends converge through a shared area that already exists and is replicated outside noonien — a folder or a bucket every node can reach. Point every node at the same area and each node's shard reaches the others:

NOONIEN_BACKEND=file NOONIEN_DIR=/srv/noonien-shared NOONIEN_NODE_ID=ai server-noonien
# or
NOONIEN_BACKEND=s3 NOONIEN_S3_BUCKET=my-bucket NOONIEN_NODE_ID=ai server-noonien
  • file — shards are *.jsonl files in NOONIEN_DIR; point it at a folder replicated by Syncthing, Dropbox, a git working tree or a shared mount.

  • s3 — one object per shard, written with conditional writes retried on contention, waiting the same budget the file backend gives a lock, so a competing writer on one node id costs a wait rather than a failed write; uses @aws-sdk/client-s3 (an optional dependency, loaded only when selected). Conditional writes need a store that honours If-Match/If-None-Match on PutObject (AWS S3, Cloudflare R2, MinIO do); a store that ignores them is not supported, and a conditional write carrying an ETag the store cannot use — none, or a multipart one — is refused rather than guarded by a token that can never match. Reading is not conditional: a shard object with a multipart ETag reads and stats normally. An object store has no append, so every mutation rewrites the whole shard object (read-modify-write): correct, but O(shard size) per write.

The memory backend keeps shards in process only — for tests and throwaway sessions. See Configuration for the variables.

What a shared area does not give you: a safe deletion. file/s3 share a graph; they cannot say whether a peer holds a write it has not delivered yet. So without a daemon the maintenance prunes only, and a physical deletion happens only where the operator declares the directory written by this node alone (NOONIEN_GC) — see Deletion and collection. Convergence is delegated to the syncer as well: noonien neither verifies nor retransmits, so latency and conflict copies are the syncer's business, and a conflict copy is just another shard to fold. And the daemon replicates a directory: nooniend refuses to run with NOONIEN_BACKEND=s3 (or memory), where it would replicate a local folder the server never uses.

Configuration

Every setting is read from the environment. NOONIEN_DIR and NOONIEN_NODE_ID are shared; the MCP server, the CLI and the daemon otherwise have their own variables — NOONIEN_* for the server, NOONIEND_* for the daemon.

Shared variables

Used by every command.

Variable

Default

Meaning

NOONIEN_NODE_ID

hostname

This node's shard name — the identity the MCP server writes under and the daemon replicates. Must be unique per machine and written by a single server at a time.

NOONIEN_DIR

~/.noonien

Directory holding this machine's shards: the file backend's store and the daemon's replica store. A leading ~ is expanded.

These two are local to each machine, not a shared area: the MCP server and the daemon share the same directory on the same host, and every machine keeps its own copy of every shard. Peer-to-peer sync with nooniend needs no shared folder or bucket; a shared area is only the alternative transport for file/s3.

A node id is a single-writer shard: exactly one server process should append to it at a time. The normal setup is one memory server per machine; if you run several servers against the same store concurrently, give each its own NOONIEN_NODE_ID. The tool does not enforce this, and it does not have to be silent about it: an append carries the shard state the writer derived its sequence numbers from, so a second writer is refused and re-derives instead of spending a sequence already spent — both operations land, on their own sequences, and every peer receives both. Two writers that land on the same millisecond still produce operations with the same id, which a read fails loudly on. A unique node id is still a requirement, not something the tool can check.

Server variables

Used by the MCP server (and the noonien CLI, which reads and writes the same shards).

Variable

Default

Meaning

NOONIEN_BACKEND

file

file, memory or s3.

NOONIEN_S3_BUCKET

—

Bucket (required for the s3 backend).

NOONIEN_S3_PREFIX

""

Key prefix all shard objects live under.

NOONIEN_S3_REGION

us-east-1

Region passed to the S3 client.

NOONIEN_S3_ENDPOINT

—

Custom endpoint for MinIO / R2 / Contabo and similar.

NOONIEN_S3_FORCE_PATH_STYLE

on when an endpoint is set

Path-style requests.

NOONIEN_COMPACT_AFTER

1000

Compact the local shard online after this many appended operations (0 disables).

NOONIEN_GC

off

Delete tombstones without a daemon: only where this node is the directory's only writer — a promise nothing in the directory can prove. Where a daemon owns the directory (it announces itself with its knowledge file from startup) it has no effect: the daemon collects.

NOONIEN_GC (server, default off) and the daemon's NOONIEND_GC (default on) are different switches; with the memory backend nothing is shared, so the server collects regardless of NOONIEN_GC.

S3 credentials come from the standard AWS chain (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, profiles, instance roles, …).

The local shard is compacted online: the server rewrites its own shard after NOONIEN_COMPACT_AFTER appended operations (default 1000, 0 disables), inside the same mutation queue as the writes. The rewrite is a compare-and-swap against the content it read, and a concurrent write — an append, or the nooniend daemon recovering the shard — makes it re-read and retry, so nothing is ever lost; noonien compact runs the same compaction by hand. noonien import authors its own <node>-import shard, so it too can run while the node's server is live, re-importing is idempotent, and it prunes that shard on the way out.

noonien compact prunes every *-import shard the directory holds, this node's and a peer's. An import only ever adds and is written once, on whichever machine ran it, so without that a replica's shadowed adds stay contested in read_conflicts for ever — the machine that could have pruned them may be gone or renamed. That prune needs neither the peer knowledge nor the NOONIEN_GC promise: it drops only the operations a later one shadowed, never a tombstone, and rewrites only when something was dropped, so a repeat pass costs nothing and asks no peer to re-pull. The folded graph is byte-identical after the pass, and the pruned shard propagates in the next round. The one window it cannot close is a re-import running on that shard's own machine at the same moment: the compacted generation wins the round and the fresh import is superseded, so re-run the import — it is idempotent.

On the file backend, append and compact take a per-shard lock, so they serialize instead of racing even across processes — and the daemon takes the same lock. An append is synced before it is acknowledged, so a write the server has confirmed is on disk; a lock nobody refreshes is stolen, by its age in either direction, because a folder a syncer replicates can carry one stamped by a machine whose clock runs ahead.

Within a node the timestamp is monotonic: if the wall clock steps back (NTP, a restored snapshot, a manual date), a new operation keeps the previous timestamp rather than an older one, so an earlier operation can never win over a later one of the same node.

Daemon variables

Used by the daemon only. It needs at least one discovery source — NOONIEND_TAILSCALE, NOONIEND_DNS_SRV or NOONIEND_PEERS — to reach the mesh; the rest is optional. Run it behind a VPN or firewall and enable mTLS — see Security.

Variable

Default

Meaning

NOONIEND_LISTEN

0.0.0.0:49778

host:port the gossip service binds.

NOONIEND_ADVERTISE

the listen host (hostname on a wildcard)

Optional. host:port this node advertises to peers; set it only when the default does not resolve from the others. A value that is not a host:port is refused at startup, because every peer validates the gossiped entry and a typo would otherwise make this node a member nowhere.

NOONIEND_PEERS

—

Discovery: static seeds — node@host:port or host:port, comma separated. One is enough; membership then self-propagates.

NOONIEND_DNS_SRV

—

Discovery: domain whose _nooniend._tcp SRV records are seeds.

NOONIEND_TAILSCALE

off

Discovery: derive candidate addresses from tailscale status (a peer joins once it answers /info).

NOONIEND_DISCOVER_INTERVAL

300

Seconds between discovery refreshes; 0 reads the sources once at startup. A refresh only adds candidates.

NOONIEND_INTERVAL

30

Anti-entropy period, seconds.

NOONIEND_PUSH

on

Reconcile as soon as the local shard changes.

NOONIEND_FANOUT

0

Peers contacted per round; 0 is every reachable peer. A cap excludes NOONIEND_GC: a reachable peer the round did not sample suspends collection, so the daemon refuses the two together.

NOONIEND_DIGEST_MIN_SHARDS

32

Shard count at or above which the digest replaces the full list (0 = whenever supported).

NOONIEND_CHANNELS

off

Gossip membership on its own channel instead of piggybacking it on every exchange.

NOONIEND_RELAY

—

Comma-separated node ids always sampled (relays / super-peers).

NOONIEND_GC

on

Collect the authored shard: prune the shadowed operations (keeping the operation a peer off the mesh could still have folded as the gate's evidence) and drop a tombstone once no peer off the mesh that folded its element could contest it — the peer's knowledge frontier is a subset of what this node holds and covers no operation of the element (physical deletion).

NOONIEND_FORGET_AFTER

15552000 (180 days)

Seconds of silence after which a peer is retired: its protection becomes durable (a merged threshold, or a blanket when it holds operations this node lacks) and its live record is dropped, so the metadata collection depends on stays bounded. 0 never retires.

NOONIEND_SUSPECT_AFTER

3

Failed exchanges before a peer is marked suspect.

NOONIEND_DEAD_AFTER

6

Failed exchanges before a peer is marked dead.

NOONIEND_DEAD_RETRY

300

Seconds a dead peer is left alone before it is probed again.

NOONIEND_MEMBERSHIP_TTL

604800

Seconds a dead peer is kept before it is forgotten.

NOONIEND_HOOK_URL

—

http(s) URL the daemon POSTs { node, watermark } to when the stable watermark advances (a peer wrote something); best effort, a hook that is down is a warning, never a failed round.

NOONIEND_REVOKED

—

Comma-separated node ids the daemon never syncs with and refuses to accept.

NOONIEND_DEPARTED

—

Comma-separated node ids explicitly gone: like NOONIEND_REVOKED but their replica is also discarded and they stop blocking collection.

NOONIEND_TLS_CERT / NOONIEND_TLS_KEY

—

Serve TLS with this certificate and key.

NOONIEND_TLS_CA

—

CA that signs the peers' certificates, used to verify them in both directions.

NOONIEND_TLS_REQUIRE_CLIENT

on

Require a client certificate (mTLS).

Listen port. The daemon listens on 49778, a port we select ourselves from the dynamic range (49152-65535). Nothing assigns it and nothing has to: the expected deployment is a private network — Tailscale or another VPN, with the port reachable only over it — where every peer is configured with the port instead of looking it up, so no reserved number is needed. A mesh is only as reachable as its ports: a discovery seed carries no port and takes the dialer's own, so a node left on a different port is never found. Give every node the same port, and set NOONIEND_LISTEN and NOONIEND_ADVERTISE to match while they are mixed.

How it works

Every mutation is recorded as an operation in an append-only log, split into per-node shards:

  • create_entities / add_observations / create_relations add elements;

  • delete_entities / delete_observations / delete_relations write tombstones (a deleted entity also tombstones its observations and incident relations).

A read folds all shards: each element (entity, observation occurrence, relation) is an LWW register decided by (HLC, node, sequence). A delete of an observation is content-level: it removes every occurrence older than it. Observations are shown while their entity is present, relations while both endpoints are present. The fold depends only on the set of operations, never on the order shards or lines were read. Operations are ordered by a Hybrid Logical Clock: the order survives clock skew, and a node that has observed a claim can write a correction ordered after it. An observed stamp further than a bounded skew in the future is clamped, so a wrong clock cannot drag the node's timestamps into the future. Reads are incremental: each shard is decoded once and cached against a cheap fingerprint, and the folded graph is memoized, so a read with nothing changed costs only a fingerprint poll per shard.

Consequences, all covered by property tests:

  • Idempotent — applying the same operations twice changes nothing.

  • Commutative — order of operations across shards does not matter.

  • Associative — folding shards in any grouping yields the same graph.

  • Convergent — two nodes with the same operations produce the identical graph.

Ordering is deterministic: entities by name, relations by (from, to, relationType), observations in operation order (HLC, node, sequence).

Compaction

The log grows with every mutation. Compaction rewrites this node's shard keeping, per element, only the operations that no later operation shadows — the shadow index is built from the merged log, so an operation superseded by another node's later operation is dropped too, and the winner of every element always survives, tombstones included. It runs online: the server compacts its own shard after NOONIEN_COMPACT_AFTER appends, and noonien compact does the same by hand. When each also collects tombstones — the physical deletion — is under Deletion and collection. The rewrite is a compare-and-swap (a temporary file renamed over the shard on the file backend, a conditional write on s3), so a crash midway can never truncate it and a concurrent write — an append, or a gossip recovery — makes the whole compaction re-read and retry instead of losing it.

Every compaction stamps a shard.compact metadata operation (never a graph element): its generation is bumped each time, and its seq is the shard's durable high-water mark, so the sequence never regresses and a compaction is never mistaken for a lost shard. Peers read the generation from /shards and replace a stale replica with the compacted shard, so every copy converges to the compacted content — a pruned *-import shard travels the same way. The rewrite covers this node's own shard and every *-import shard (see above); a peer's own shard is never touched, so compaction cannot conflict with its writer.

Deletion and collection

A delete is an operation, not a removal: delete_entities, delete_observations and delete_relations append tombstones, and the fold hides the element while a tombstone is the latest operation for it. The tombstone is exactly what makes the deletion beat a concurrent write, so dropping it while that write still exists would revive the element. A deletion is therefore only physical once nobody can still hold one.

nooniend collects the shard it authors when the mesh is safe, per element. It first prunes the operations a later one shadows that no retained off-mesh peer could still need, then it may drop a surviving tombstone when no peer off the mesh could contest that element. Two conditions gate it, per peer: the peer's knowledge frontier must be a subset of what this node already holds — a peer holding any operation this node lacks could hold a relayed operation on the element and is treated as a blocker — and the frontier must cover no operation of the element, so only a peer that folded it can contest it; a peer that never folded it can still mint a coincident element (an independent name, an observation on an entity it knows), which the fold decides as a concurrent genesis, not a revival. An element that appeared while a peer was already away is thus collectable at once, without waiting for that peer to return; an element the peer did know stays frozen until the peer comes back or is explicitly departed. A surviving operation on another shard also keeps the tombstone, so the fold is always preserved. When a peer could contest an element, the operation it knew is kept as the evidence the next round reads again — and by the node that authored it, not only by the deleter: a node never prunes a shadowed operation on an element a peer off the mesh could still contest, so the proof survives even when the tombstone lives on a different shard (a delete by one node of an element another created).

The claim, in one line: collection needs no barrier over the history — a peer that never folded an element cannot causally contest it, however long it stays away, and neither a global round of acknowledgements nor a timer on the data is needed. What it does need is a stable round over the live set: every retained peer that is still reachable must have been exchanged with in that round (otherwise the round suspends, because such a peer may hold writes this node has not pulled), and no retained peer may hold anything this node lacks. That is why NOONIEND_FANOUT and NOONIEND_GC exclude each other. Liveness is not autonomous: a peer that is unreachable and unverifiable — holding operations this node cannot read — blocks collection until the operator departs it (NOONIEND_REVOKED / NOONIEND_DEPARTED); the retention window bounds metadata and forfeits no data, but it does not remove that decision. A peer this node has never exchanged with, on the other hand, gates nothing — and not out of leniency: a causally aware competitor, the only thing a retained tombstone has to beat, means having folded the element, hence holding the tombstone. An operation of this node leaves here only through a push, and a push is recorded with the receiver's post-push high-water mark, so a tombstone that is collectable is held by nobody at all; the other authors' work such a peer may hold is reported by the peer that relayed it, and a mark this node lacks blocks on its own. An inbound push is recorded the same way, at once: the pusher authored what it pushed, so it holds it — which keeps the elements it delivered frozen even if it never answers again, and puts a pusher from outside the membership under the gate. A peer that reaches this node with a push also stays reachable, so the round suspends until an exchange has recorded the rest of its frontier. The peers tolerated this way are published as noonien_gossip_unreached_peers.

Each peer's knowledge frontier — the greatest sequence it has been seen to hold of every author's shard — is durable, persisted beside the shards in .nooniend-peers.json, so a machine gone for a year keeps blocking only the elements it actually knew. A peer the round could still reach but did not exchange with suspends collection entirely, because it may hold writes this node has not pulled. Forgetting a peer (the membership TTL) does not unblock it — it may be alive off the mesh with valid unsent writes — but NOONIEND_REVOKED and NOONIEND_DEPARTED do, the operator's decision that its writes are expendable; a departed peer's replica is discarded outright. A forfeited node's authorship is dropped from the gate as well, so it stops holding the collection back through the peers that still hold its replica; a revoked node's operations already here keep their elements frozen until it is departed, which discards them. Turn the daemon's collection off with NOONIEND_GC=false.

The per-peer record is bounded. After NOONIEND_FORGET_AFTER seconds of silence (default 180 days) a peer is retired, and retirement is semantically invisible: it moves where the protection lives, never which elements are guarded. An accounted peer — one whose frontier is a subset of what this node already holds — is merged into a durable retired frontier, one elementwise maximum per author. The maximum is exactly the union of the per-element decisions the peers would have made, so it keeps gating every element those peers could have folded, including deletions that happen after the retirement, over one map bounded by the shards this node holds rather than one map per peer. (A per-element list computed at expiry would not be sound: a tombstone created later is not on it.) An unaccounted peer — one that claims operations this node cannot read — leaves a durable blanket instead: the same "it could hold anything" that gated it while it was live, stated once rather than carried as an unverifiable map. Nothing is forfeited by retiring, which is why the window can be on by default. NOONIEND_REVOKED and NOONIEND_DEPARTED remain the only forfeiture — and since a maximum cannot be un-merged, a node must be departed before its window expires for its contribution to be lifted. A frontier that claims an author this node cannot serve is never recorded: a peer cannot freeze the mesh with a claim it cannot back. A claimed node that was never reached has nothing to materialise and gates nothing while it stays silent; its own frontier gates it from the first exchange. The retired record is durable, so the daemon syncs it before renaming it into place and refuses to start on a file it cannot read — an empty one included, which only a crash that lost the write can leave. A peer record it cannot parse is one whose protection is unknown, so it is not read as "this peer holds nothing": that node keeps a blanket, and noonien_gossip_blankets counts it until an operator resolves the file.

Without the daemon a physical deletion needs an explicit promise. A daemon that owns the directory (.nooniend-peers.json present) holds the peer knowledge and collects, and it is the only writer that maintains the shard: the server and noonien compact keep their whole view there — a shadowed operation is exactly the evidence the daemon's gate reads, so they must not prune it — and leave the shard to the daemon. With no daemon there is no knowledge to gate on, and the directory cannot tell whether a peer is merely absent: a machine that is offline, or configured but not yet synced, leaves nothing to see, and its unsynced write would be lost by a collection — which is the immediate deletion the official server performs. So the server's online maintenance and noonien compact both prune only, until the operator declares the directory written by this node alone (NOONIEN_GC=true), the promise that makes it sound; a declaration contradicted by another node's shard is refused and reported.

Metrics

The daemon serves every metric at /metrics (the MCP server is stdio and has no endpoint). The collection and retention state:

Metric

Meaning

noonien_gossip_frozen_elements

deleted elements kept because a peer off the mesh may still contest them

noonien_gossip_absent_nodes

retained peers not exchanged with in the last round

noonien_gossip_absent_seconds{node}

how long each peer has been away

noonien_gossip_retained_peers

peers whose knowledge still gates collection

noonien_gossip_unreached_peers

retained peers never exchanged with, whose ignorance gates no collection

noonien_gossip_retired_total

peers retired into the retired frontier

noonien_gossip_retired_unaccounted_total

peers retired with a blanket

noonien_gossip_retired_authors

authors whose thresholds survive in the retired frontier

noonien_gossip_blankets

durable blankets in force

The same endpoint carries the transport and liveness families — noonien_gossip_rounds_total, noonien_gossip_round_seconds, noonien_gossip_round_bytes, noonien_gossip_links, noonien_gossip_shards, noonien_gossip_stable_shards, noonien_gossip_membership_size, noonien_gossip_peers_ok_total, noonien_gossip_peers_failed_total, noonien_gossip_ops_pulled_total, noonien_gossip_ops_pushed_total, noonien_gossip_digest_exchanges_total, noonien_gossip_membership_channel_failures_total, noonien_gossip_bytes_sent_total, noonien_gossip_bytes_received_total, noonien_gossip_fanout, noonien_gossip_up, noonien_gossip_hook_total, noonien_gossip_hook_failed_total — and, when the daemon runs the local log's own maintenance, its noonien_mcp_* counters (noonien_mcp_folds_total, noonien_mcp_fold_seconds, noonien_mcp_shards_merged, noonien_mcp_shard_stat_total, noonien_mcp_ops_decoded_total, noonien_mcp_compacted_total, noonien_mcp_compaction_failed_total).

Tools

The MCP surface is the official nine, drop-in: names, inputs, outputs and messages match @modelcontextprotocol/server-memory. Extensions the official server does not have are added on top — an entity, a relation and an observation can be edited, two entities can be merged, and the elements more than one machine wrote are visible — and the nine are never changed. read_graph and search_nodes take an optional page and type filter; without them they answer exactly as before.

Each tool's description keeps the official sentence and adds what the contract does not fix: when to reach for the tool instead of a sibling, what it does to an entity that already exists, and how a batch fails. Every parameter carries a description too, so a client shows the shape without guessing.

Tool

Does

create_entities

create multiple new entities in the knowledge graph

create_relations

create multiple new relations between entities (active voice)

add_observations

add new observations to existing entities

delete_entities

delete entities and their associated relations

delete_observations

delete specific observations from entities

delete_relations

delete multiple relations

read_graph

read the entire knowledge graph

search_nodes

search nodes by a query, matched against entity names, types and observation content

open_nodes

open specific nodes by their names

update_entities

rename existing entities and/or change their entity type, moving their observations and relations

update_observations

replace observation contents on existing entities

update_relations

change the type of existing relations and/or repoint their endpoints

merge_entities

merge an entity into another: the union of their observations, its relations repointed, the merged entity deleted

read_conflicts

list the elements more than one node has written, with their authors

Drop-in compatibility

The same nine tools (Tools), so it slots under the memory server name with no agent changes. The extension tools sit beside them: a client written for the official server never calls them and never notices they are there.

The initialize result also carries instructions naming the extension tools and when to prefer them over composing delete_* + create_* (and each extension's description says what it replaces). A model already knows the nine official tools, and a tool it does not know it will not call.

The full graph is also exposed at the memory://knowledge-graph resource. The resource is read-only; clients can subscribe to it and receive notifications/resources/updated whenever a mutation changes the graph — via resources/subscribe on the 2025-era protocol, or a subscriptions/listen stream on the 2026-07-28 revision. The server speaks both: it answers the initialize handshake for 2025-era clients and server/discover for 2026-07-28 clients.

Entities are keyed by name. Observations behave like the official server: add_observations has no effect when the content is already present, but preserves duplicate contents within a single request, create_entities preserves duplicate contents as given, and deleting an observation removes every occurrence of that content. Relations are sets: adding the same relation twice has no effect. delete_entities also removes the entity's observations and its incident relations. The tombstones cover what the deleting node could see: an observation added concurrently on another node survives as an element, so if the entity is later created again that observation reappears with it.

update_entities renames an entity and/or changes its type, and update_relations changes a relation's type or endpoints. An edit is a tombstone plus an add, like every other mutation: a rename tombstones the old name together with its observations (so re-creating the old name cannot revive them) and re-creates the entity under the new name with the same observations and incident relations, repointed. A rename onto an existing name is refused rather than merging the two entities, and the endpoints of an updated relation must exist, as they must for a creation. A rename that another node contests — or two renames in one call that touch the same relation — settles per element by last-writer-wins, exactly like the rest of the graph.

update_observations replaces a content with another (content-level, like the delete it is built on: every occurrence of the old goes, the new is added once). merge_entities combines two entities — the union of their observations, their relations repointed — which is the operation a rename onto an existing name refuses to guess at; it is the way to un-do a duplicate a concurrent rename left behind. read_conflicts lists exactly those elements more than one node has written, with the authors, so a last-writer-wins resolution is visible instead of silent — and the ones a migration leaves behind clear on the next noonien compact from any node, which prunes every *-import shard. read_graph and search_nodes accept an optional limit/offset (and search_nodes an entityType filter) so a large graph is read a page at a time — a page carries the relations touching its entities — and without those arguments the answer is byte-for-byte the one they gave before.

Security

  • One writer per shard. Keep NOONIEN_NODE_ID unique and run one server per node id. A node id is sanitised to a bounded, path-safe shard-file stem, and every node id that arrives from a peer (a /shards/{node}/ops path, a gossiped summary, an announced header) is validated before it can name a file, enter the peer set or label a metric.

  • Replication. nooniend is a network service. Run it behind a VPN or firewall, and enable mTLS (on by default when certificates are configured) so only authenticated peers replicate. The client always verifies the peer certificate — a configured CA, or the system trust store when none is set; an unverified connection is never used. Without TLS the daemon trusts the underlay; a peer's advertised address is still validated as a plain host:port before it is dialed, and a dial target only ever comes from a peer's own /info, a static seed, the membership list a peer gossips or a candidate built from the host the request came from — so an announced address can never point the dialer at another host. The store also refuses a new shard once it holds as many as a peer may advertise, so neither a pushed node id nor an advertised one can fill the directory. A refusal (NOONIEND_REVOKED / NOONIEND_DEPARTED) needs the client certificate that mTLS supplies — without it a peer has no identity to refuse. Setting NOONIEND_TLS_REQUIRE_CLIENT=false turns TLS back into an unauthenticated channel (any client can push any shard); the daemon logs a warning at startup in that mode.

  • Trust model. mTLS authenticates members, not individual operations. Only a certificate marks a caller as alive: a header claiming a node id does nothing to that node's health, because a host that can open a socket could otherwise keep a peer that no longer answers alive for good — and a peer that is reachable and never covered suspends collection mesh-wide. Without mTLS a peer that comes back is revived by the round that reaches it. A node serves every shard it holds, so relaying is trusted: a member can carry another node's shard to a third node, and the daemon recovers its own lost shard from a peer's replica. Run nooniend only on machines you trust as peers. The fold's last-writer-wins order trusts the operation's HLC stamp, so a member whose clock is far ahead wins every conflict on its elements; a wrong clock is a correctness hazard, not a privilege boundary. Collection also trusts what a member reports: its frontier from /shards and the peer set it gossips — the certificate proves who it is, not that its reports are true — and it assumes the mesh is the only path by which a node learns: a node that leaves must not keep receiving operations elsewhere (do not point a daemon and a shared file/s3 area at the same directory, and a node bridging two meshes belongs to both or should be departed).

  • Reporting a vulnerability. Do not open a public issue — see SECURITY.md.

Development

git clone https://github.com/sequico/server-noonien.git
cd server-noonien
npm install

npm run check       # Biome: lint + format + import order
npm run typecheck   # tsc --noEmit
npm run test        # Vitest, including the CRDT property tests
npm run build       # tsc -> dist/
npm run audit       # npm audit --audit-level=high
npm run gate        # all of the above, the audit first

npm run release:check   # version artifacts agree, every bin is packed, the changelog matches
npm run mcpb            # build server-noonien-<version>.mcpb (Claude Desktop / Smithery Local)
npm run publish:smithery -- --dry-run   # the Smithery ServerCard this release would publish

The distribution is npm; the extra commands are for the channels that need a file rather than a package — the MCPB bundle for Claude Desktop and Smithery's Local track — and for the release preflight. Publishing the Smithery release needs SMITHERY_API_KEY and SMITHERY_SERVER in the environment and the bundle from npm run mcpb.

See CONTRIBUTING.md for the workflow and the ground rules.

Why the name noonien?

The name is an homage to Star Trek: The Next Generation. The project was first meant to be called "Datalore" — the title of the episode (Season 1, Episode 13, first aired 18 January 1988) that introduces Data and his twin brother Lore, the two Soong-type androids built by Dr. Noonien Soong. Data is the good one; Lore is the flawed, emotional, malicious prototype. Both are played by the same actor, Brent Spiner.

The episode title is a portmanteau of the two androids, and the two names fit a knowledge graph almost too well:

  • Data — a datum: a single fact.

  • Lore — the body of knowledge and tradition shared by a community.

So datalore would have meant the facts plus the shared lore — exactly what a shared agent memory is. But "Datalore" is also the name of an unrelated commercial product in the same software space, so rather than carry that brand conflict the project was renamed noonien, after the androids' creator, Dr. Noonien Soong. Naming it after their maker keeps the homage to both Data and Lore.

The twin motif maps onto this project's core problem — many copies of the same graph, on different machines, that must stay consistent. Data's good twin and Lore's evil twin are the two failure modes; in server-noonien the copies cannot drift apart, because the merge is conflict-free by construction. The graph has no evil twin.

A small production gem: the episode was first pitched as a romance for Data with a female android. It was Brent Spiner himself who suggested the evil-twin plot instead — so the actor who played both twins also shaped the episode's twist.

References:

This project is an independent fan homage. "Star Trek", "Data", "Lore" and "Noonien Soong" are the property of their respective rights holders; this project is not affiliated with or endorsed by them.

Documentation

  • PLAN.md — architecture and design decisions.

  • SCALING.md — the forward-looking plan for 1,000 / 10,000 nodes.

  • PROTOCOL.md — the nooniend wire protocol: transport, messages, limits and security.

  • docs/paper.md — the technical report: the model, the tombstone-collection contribution and the evaluation, with the bibliography in docs/references.bib (frozen at release 1.0.0; the report is © Sequi Company under CC BY 4.0 — see NOTICE).

  • CONTRIBUTING.md — how to contribute.

  • AGENTS.md — the project rules for contributors and agents.

  • SECURITY.md — security policy and how to report a vulnerability.

  • CODE_OF_CONDUCT.md — the community code of conduct.

License & Disclaimer

The source code is licensed under the Mozilla Public License 2.0 (MPL-2.0); the report docs/paper.md is © Sequi Company, licensed under CC BY 4.0 — see NOTICE.

⚠️ NO WARRANTY & NO SUPPORT: This software is provided "as is". The author offers absolutely no commercial support, no maintenance guarantees, and no uptime assistance. If you open an issue, it will be addressed purely on a voluntary basis.

❤️ Support the Project (Passive Monetization)

If this component is saving your company hundreds of hours of infrastructure development, please consider supporting the project:

  • Sponsor on GitHub: Help keep this project alive by adding your company logo to this README. 👉 Sponsor Now

  • Back a Feature: Want a specific bug fixed or a new protocol added? We use Polar.sh. Put a bounty on any GitHub Issue to incentivize its development. 👉 View Bounties

Available Tools

14 tools
add_observationsAdd ObservationsA

Add new observations to existing entities in the knowledge graph. Content the entity already holds is not added again, while duplicates within one request are kept as separate occurrences; the response reports what was added per entity. Every named entity must exist — a missing one fails the whole call, so create it with create_entities first. To replace a content use update_observations, to remove one use delete_observations.

Inputs: observations (required). Returns: results

create_entitiesCreate EntitiesA

Create multiple new entities in the knowledge graph. A name that already exists is skipped and left unchanged — use add_observations to extend it — and only the entities actually created are returned. Observations are stored exactly as given, duplicate contents included.

Inputs: entities (required). Returns: entities

create_relationsCreate RelationsA

Create multiple new relations between entities in the knowledge graph. Relations should be in active voice. Both endpoints must already exist: one missing name fails the whole call with "Entity with name … not found". A relation that is already present is skipped, so the response lists only the ones added.

Inputs: relations (required). Returns: relations

delete_entitiesDelete EntitiesA
DestructiveIdempotent

Delete multiple entities and their associated relations from the knowledge graph. Unknown names are ignored rather than failing, and the message reports how many were deleted and which were not found. The deletion also removes the entity's observations and its incident relations, and it is durable: a tombstone beats a concurrent write from another machine.

Inputs: entityNames (required). Returns: message, success

delete_observationsDelete ObservationsA
DestructiveIdempotent

Delete specific observations from entities in the knowledge graph. Deletion is by content: every occurrence of that content on the entity goes. A batch is not all-or-nothing — the message reports how many were deleted and names the entities that were not found. To replace a content in place use update_observations; to remove the whole entity use delete_entities.

Inputs: deletions (required). Returns: message, success

delete_relationsDelete RelationsA
DestructiveIdempotent

Delete multiple relations from the knowledge graph. A relation is matched by its from, to and relationType; one that matches nothing is ignored, and the message reports how many of the requested relations were deleted. Deleting an entity removes its incident relations with it, so this is for dropping one edge while both endpoints stay.

Inputs: relations (required). Returns: message, success

merge_entitiesMerge EntitiesA
Destructive

Prefer this to deleting one entity and re-adding its observations and relations to another: merge an entity into another, unioning their observations and repointing its relations. The target keeps its name; the absorbed entity is deleted.

Inputs: merges (required). Returns: results

open_nodesOpen NodesA
Read-onlyIdempotent

Open specific nodes in the knowledge graph by their names. Names that do not exist are omitted rather than failing, and the result carries every relation touching the entities returned, including relations to entities outside it. Use it when the names are known; for a query use search_nodes, for everything use read_graph.

Inputs: names (required). Returns: entities, relations

read_conflictsRead ConflictsA
Read-onlyIdempotent

Call this when a write may have been superseded by another machine, or before trusting an edit: it lists the elements more than one node has written, with their authors, so a last-writer-wins resolution is visible instead of silent

Inputs: no named parameters. Returns: conflicts

read_graphRead GraphA
Read-onlyIdempotent

Read the knowledge graph, or a page of it: the optional limit and offset take a slice of the entities in name order. Use it for the whole graph; for a query use search_nodes, for names you already know use open_nodes, and for the elements more than one node wrote use read_conflicts. A page carries the relations that touch its entities.

Inputs: limit, offset. Returns: entities, relations

search_nodesSearch NodesA
Read-onlyIdempotent

Search for nodes in the knowledge graph based on a query. The query is matched against entity names, types and observation content; entityType narrows to one exact type, and limit/offset page the matches in name order. For the whole graph use read_graph, and for names you already know use open_nodes.

Inputs: query (required), limit, offset, entityType. Returns: entities, relations

update_entitiesUpdate EntitiesA
Destructive

Prefer this to deleting an entity and re-creating it under another name: rename existing entities and/or change their entity type, keeping their observations and relations. A rename onto a name that already exists is refused rather than merging the two; an unknown name is reported and the batch keeps its other entries.

Inputs: entities (required). Returns: results

update_observationsUpdate ObservationsA
Destructive

Prefer this to delete_observations followed by add_observations: replace observation contents on existing entities in place

Inputs: updates (required). Returns: results

update_relationsUpdate RelationsA
Destructive

Prefer this to deleting a relation and creating another: change the type of existing relations and/or repoint their endpoints. Each entry is matched by its current from, to and relationType; a missing match is reported, not thrown, so the batch keeps its other entries.

Inputs: relations (required). Returns: results

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct resource+operation pair (entities, relations, observations × create/update/delete, plus merge and read paths), and descriptions explicitly cross-reference siblings ("for a query use search_nodes, for names you already know use open_nodes"). The potentially confusable read tools (read_graph, search_nodes, open_nodes, read_conflicts) are clearly delimited by use case, and update_entities vs merge_entities is distinguished (rename/type-change vs absorbing another node).

    Naming Consistency4/5

    The dominant pattern is consistent verb_noun with a fixed noun vocabulary (create_entities, update_relations, delete_observations, add_observations, merge_entities, read_graph, read_conflicts). Minor deviation: read operations alternate between read_*, search_*, and open_*, which is semantically motivated but breaks a single uniform verb convention.

    Tool Count5/5

    14 tools sit squarely in the well-scoped range. Every tool corresponds to a real operation in a knowledge-graph memory domain, with no redundant or filler entries.

    Completeness5/5

    Full lifecycle coverage is present: create/update/delete/merge for entities, create/update/delete for relations, add/update/delete for observations, plus four distinct read/query paths and a conflict-inspection tool for multi-writer scenarios. There are no obvious dead ends — even edge cases like rename collisions and partial batch failures are handled and documented.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Semantic memory for AI agents — local-first MCP server with hybrid search, knowledge graph, contradiction detection, and plan-then-commit consolidation.
      227 npm
      4
      AGPL 3.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to store, search, and resolve shared memories with full provenance, conflict detection, and an audit trail across MCP-compatible clients.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to maintain a shared, serverless, conflict-free knowledge graph across multiple machines by syncing append-only per-node shards. It provides drop-in compatibility with the official MCP memory tools while converging automatically without merge conflicts.
      Mozilla Public 2.0