archivist-mcp
Provides a git-versioned document vault: every write is a commit, with tools for history, diffs, reading files at past revisions, and restoring datasets. External edits made outside the tools are detected and committed separately.
Delegates authentication to GitHub via OAuth 2.1 with Dynamic Client Registration and PKCE, restricting access to a single configured GitHub username.
Exposes the server through Tailscale Funnel on a public HTTPS URL with a valid certificate, without opening router ports or exposing a home IP address.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Archivist MCP
A document vault an LLM can read and write, git-versioned on every write, self-hosted on your own server.
Archivist is an MCP server (Model Context Protocol: how an LLM client such as Claude calls external tools) that gives your conversations a persistent set of files. The vault is split into datasets, top-level folders with their own git repository, and a key registry decides which ones a conversation may reach. Every write is a commit, refused if the file changed since it was read, so a model's mistake can always be undone. It runs as a Docker container on Unraid, is published by Tailscale Funnel, and lets in a single GitHub account.
Quick start
Prerequisites
Unraid 7 with the Tailscale plugin (it gives the container its own Tailscale identity; keep it even if Tailscale on the host is off). On the host, Allow Tailscale Funnel = No: the Funnel belongs to the container.
A Tailscale tailnet with MagicDNS and HTTPS Certificates on, and Funnel allowed in the tailnet policy (granting it to
autogroup:membersurvives a recreated node).An SSD pool for the vault, and a GitHub account.
Below, <host>.<tailnet>.ts.net is the container's Tailscale name and
<ssd-pool> your pool.
Steps
1. GitHub OAuth application. github.com → Settings → Developer settings →
OAuth Apps → New OAuth App:
Field | Value |
Application name | anything, e.g. |
Homepage URL |
|
Authorization callback URL |
|
Generate a client secret; store Client ID and Client Secret in a password manager (the secret is shown once). One application per service.
2. The vault on disk.
zfs create <ssd-pool>/Vault
mkdir "/mnt/<ssd-pool>/Vault/Example Project"
chown -R 99:100 "/mnt/<ssd-pool>/Vault"
chmod -R 777 "/mnt/<ssd-pool>/Vault"Each top-level folder is a dataset. Copy files in with rsync or scp; the
server creates the git repositories itself.
3. The key registry.
printf 'Example Project | k7m2xq4p\nScratch |\n' > "/mnt/<ssd-pool>/Vault/keys.txt"
chown 99:100 "/mnt/<ssd-pool>/Vault/keys.txt"
chmod 640 "/mnt/<ssd-pool>/Vault/keys.txt"Example Project is locked with the key k7m2xq4p, Scratch will be open, any
other dataset is closed (Datasets and keys).
4. The container. Import archivist-mcp.xml into Unraid, or create the
container by hand with the same fields. Fill in:
Field | Value |
Vault |
|
App Data |
|
Tailscale State |
|
|
|
| from step 1 |
| your GitHub username, the only account let in |
| output of |
Tailscale | Hostname |
Leave the rest at the defaults, then Apply.
5. Node key expiry. In the Tailscale admin console, under Machines,
disable key expiry for the container's node. The startup checks refuse to run
while the key can expire: if the first start stops on node_key, fix it and
start again.
6. The log. You should see == git init (as root) ==, the permission pass,
the privilege drop, the preflight with every line OK, then:
PREFLIGHT: 11/11 — starting.
== server ==
… archivist-mcp <version> (engine <version>) — starting on 127.0.0.1:3000 (http stateless) — base_url https://<host>.<tailnet>.ts.net — allowed user: <login> — IP filter: OFF (no IP filter) — token store: /data/fastmcp — retention: disabledA FAIL line means the service did not start: see
The service will not start.
7. Connect. In Claude: Settings → Connectors → Add custom connector,
URL https://<host>.<tailnet>.ts.net/mcp. Authorise the GitHub login; the
tools appear.
8. Check, in a new conversation:
vault_status() → Example Project locked, Scratch open
dataset_status("Example Project") → REFUSED: a key is required
dataset_status("Example Project", key="k7m2xq4p") → answers
list_files("Scratch") → answers, no key9. Hand over the key. Paste k7m2xq4p into the instructions of the client
project that works on Example Project: only its conversations will have it.
Related MCP server: obsidian-vault-mcp
Using it day to day
Datasets and keys
Every call names a dataset in dataset; path is relative to it, and empty
means the whole dataset. Nothing at the vault root is reachable: keys.txt
cannot even be named. Dataset names use letters, digits, space, ., _, -,
and do not start with . or _.
Line in | State | A call |
| locked | must carry the key |
| open | needs no key |
no line | closed | is refused |
A line may end with what its key is allowed, and a dataset may have several lines, one per key:
Line in | What it grants |
| everything, with that key |
| reading, with that key |
| reading and the |
| reading, with no key |
| everything, with no key |
# The night job may only add to its log; a second chat may only look.
Example Project | k7m2xq4p
Example Project | n4wt8hcz | append
Example Project | r9d3kmvy | ro
# Anyone holding the connector reads, only the key writes.
Handbook | | ro
Handbook | p6fj2xbeThe caller adds nothing. It passes its key, or none, exactly as before; the line decides. A write the key does not allow is refused with
READ-ONLYorAPPEND-ONLY, and nothing is written.dataset_statusreturnsaccess:full,appendorro.The rights add up: a key is never worth less than no key.
Two words,
roandappend. Anything else in the third field —rw,full, nothing — is a malformed line. So is one key given two different rights on the same dataset.A comment is a whole line starting with
#. There is no comment at the end of a line:name | key # notemakeskey # notethe key.A dataset is
openonly when everything is allowed with no key;Handbookabove islocked, andvault_status()shows it withwithout_key: "ro".Closed is the default: a missing line, a typo in a name or a missing file makes datasets unreachable, never exposed.
vault_status()lists the closed ones andorphan_registry_lines, registry names matching no dataset.Hot-reloaded: an edit applies at the next call. Spaces around the bar are ignored; a line starting with
#is a comment. A malformed line stops the service at startup; while it runs, the line grants nothing andvault_status()gives its number inmalformed_registry_lines.No tool writes
keys.txt: a dataset made bydataset_createis closed until you give it a line.Eight alphanumeric characters make a good key (avoid
0/O,1/l). Keep the file640, owned by99:100.A key separates projects, it does not keep strangers out: OAuth does. A chat without the key in its context cannot invent it. A locked dataset can never be dropped by the tools.
Rules a client must know
The server sends its rules to the client at connection time. In short:
The sha256 is the unit of truth. Every read returns it; every write demands it (
"new"for a new file) and returns the new one. If the file changed meanwhile the write is refused withCONFLICT: re-read, reconcile, retry.Every write is atomic, verified and committed; a failed tool changes nothing. After a write lost in transport, compare the sha in
list_filesbefore retrying.Nothing is deleted: disposal is
move_pathintoTrash/.Fewer calls, and less in each, is faster:
list_fileswithdepth=1to look around,searchwithcontext=2to find,read_filewithfrom_lineandlinesfor part of a long file, several files in oneread_files, several changes in oneedit_filewithedits,manifestto know whether anything changed.A PDF is not done until it has been looked at:
render_pdfwithpreview=Truereturns the pages as pictures in the same answer, andviewshows any picture, PDF or folder already in the vault. The numbers a render returns say it was drawn, not what it looks like.Files changed from outside (SMB, by hand) are committed separately before the next write, which may return
external_commit_first. Not an error.No empty folders: git does not keep them.
.gitignore,.gitattributes,.gitmodulesare readable, never writable: change them on the server.Big binaries do not go through the model: in
write_binarythe model types the base64. Copy large files over SMB instead. For PDFs,render_pdfdraws one from data andrender_reportbinds documents already in the vault.
The tools
Every dataset-level tool also takes key="" as its last parameter, needed
only for locked datasets and best passed by name; it is omitted below. Returns,
limits and examples are on each tool's card in
reference-guide.md, served by reference_guide("<tool>").
Tool | What it does |
| datasets and their state; no key |
| the manual, or one tool's card; no key |
| a new, empty dataset, born closed |
| delete an open dataset |
| file counts, git state, commits, size |
| listing with size and sha per file; one level, a glob, or names only |
| one text file with its sha, or a run of its lines |
| several text files in one call |
| the original bytes of any file, as base64 |
| a picture (HEIC too), the pages of a PDF or a folder, as reduced JPEGs |
| a PDF's page count, outline and text; no OCR |
| a file at a past revision |
| server-side grep, with lines of context |
| one fingerprint for a tree |
| files as one base64 tar.gz, for clients that run code |
| a block at the end of a file |
| the whole file |
| replace unique fragments, one commit |
| a binary from base64 |
| a PDF drawn from a JSON document of blocks; |
| dataset Markdown bound into one PDF |
| move, rename or trash; never overwrites |
| the last commits |
| changes between revisions; without |
| the dataset back to a revision, as a new commit |
| empty |
Details
How it is built
client ──HTTPS, OAuth 2.1──► Tailscale Funnel ──► 127.0.0.1:3000 server.py ──► vault.py ──► /vault
(same container) GitHub gate, IP filter one git repository per datasetFastMCP implements the protocol, the HTTP transport and the OAuth 2.1 flow, with DCR (Dynamic Client Registration) and PKCE (Proof Key for Code Exchange).
GitHub login: every request, handshake included, is refused unless it comes from
ALLOWED_GITHUB_LOGIN. A stranger never sees the tools.Tailscale Funnel publishes the port on public HTTPS with no router port opened. The server listens on loopback only.
Docker: the entrypoint fixes ownership as root, then runs as
nobody:users(99:100) with umask 000, so files stay usable over SMB.Preflight: eleven blocking checks (
preflight.py). One fails or crashes, the service does not start.The engine,
mcp_common_engine/, is the part that knows nothing about vaults: identity gate, designed refusals, configuration readers, preflight harness, log discipline. It is a folder of this repository, built into the image; its README describes each module.
Configuration
Variable | Default | Meaning |
|
| vault and registry inside the container |
| none | public https URL, no trailing slash, matching the GitHub callback |
| none | the OAuth application |
| none | the only account let in |
| none | signs issued tokens; 32+ characters, keep it stable |
|
| listening port, and the one the Funnel publishes |
| empty | optional source-IP filter: |
|
| squash history older than N months at boot, rewriting later commit hashes; 0 disables (recommended) |
|
|
|
|
|
|
|
| the service user |
| empty | checks to skip, comma-separated; testing only |
A placeholder (CHANGEME), an http:// URL, a short JWT key or a malformed
ALLOWED_CIDRS block startup. With ALLOWED_CIDRS undefined, the deprecated
ANTHROPIC_CIDR is read, then a built-in range.
Maintenance and failures
Cannot be regenerated | If lost |
GitHub client ID and secret | new OAuth application, update the container |
| tokens invalid: reconnect the connector |
The keys | rewrite them, paste them into the projects again |
The vault | the real loss: snapshot the whole |
| authorise again; the node returns as new and the Funnel needs authorising |
Unraid's saved template (/boot/config/plugins/dockerMan/templates-user/)
holds the secrets in plaintext.
Updating. Docker page → Check for Updates, then apply. Apply, never
Restart: Restart keeps the old configuration. Apply clears the container log;
since 4.5.0 the same lines stay in logs/archivist-mcp.log under App Data,
rotated at 2 MB with 9 old files kept (the boot checks are only in the
container log). The startup line then shows the new version.
To go back, put the previous version tag in Repository instead of :latest.
Crossing 3.0.0: registry lines become
name | key(was a TAB). Rewritekeys.txtfirst.Crossing 4.0.0: a dataset with no line becomes closed. First give every dataset that must stay reachable without a key the line
name |.Crossing 4.3.0: nothing to do. A registry written before means what it meant;
roandappendare there when you want them.
When an update changes tool names, parameters or descriptions, disconnect and reconnect the connector and test in a new conversation, or you will see the old tools.
The service will not start
Check | Look at |
| wrong vault mount, or an empty folder |
| the mount reads short or refuses a write or delete |
| a repository is missing: start again, boot creates it |
|
|
| a placeholder left, |
|
|
| the Funnel is off or publishes another port |
| the node key still expires |
| an |
| the |
The connector will not connect
Almost always BASE_URL does not match the GitHub callback exactly. No
tools: reconnect, new conversation. A refused login shows in
docker logs archivist-mcp 2>&1 | grep refused. A message like "server
hostname doesn't resolve or isn't reachable" only means the client saw a
failure: retry, and if calls sent together keep failing, try the other
HTTP_MODE.
Something went wrong in the vault
history("Example Project", "file.md", 20) what happened
read_at("Example Project", "file.md", "<hash>") how it was, then write_file it back
dataset_restore("Example Project", "<hash>", "<manifest>", key="…")A restore is a forward commit and can be undone. Below git, the ZFS snapshot.
Traps
Build with docker build --no-cache (the cache has lied), never on an Apple
Silicon Mac (arm64). A Tailscale update has broken the Funnel before (1.102.1):
check its changelog first.
Limits
Limit | Value |
text read and write, binaries | 2 MB |
| 50 paths, 2 MB in all · 50 changes |
| 64 KB |
listable files · | 3,000 · 200 · 5 seconds per call |
| 60 KB, truncated |
| 30 MB in, 5 MB tgz out |
| 20 pages, 200 KB JSON · 200 pages, 5 MB Markdown |
| a source of 100 MB; 10 pages or one sheet of 30 files per call, 1,500 pixels · 50 pages per call |
datasets | 200 |
The client also caps tool results; a large one may arrive as a file path
instead of data. archive with max_chars=20000 refuses with the size instead
(reference_guide("archive")).
What it deliberately does not do
No command execution, no file deletion, no writing keys.txt, no
git gc --prune on demand, no dumps: tools return small verdicts, because every
returned byte lands in the conversation's context.
Running the test suites
scripts/test.shIt builds a Python 3.12 virtual environment (PYTHON picks another,
ARCHIVIST_WORK reuses one), installs requirements.txt with --no-deps and
runs test_engine.py (the engine) and test_vault.py (the rest), each to its
own log. Trust the exit=0 lines. No network, Docker or FastMCP. The renderers
need Pango and the Liberation and DejaVu fonts; outside Debian, point
RENDER_FONT_DIR and REPORT_FONT_DIR at them.
Releasing
The version is VERSION in server.py; a release is a v* tag. The workflow
runs both suites, checks VERSION against the tag, builds the image, starts
it with scripts/smoke.sh (a stranger refused, both renderers drawing), and
only then publishes ghcr.io/alcor6502/archivist-mcp. A manual run publishes
nothing. In a fork, make the package public once. scripts/ship.sh is the
maintainer's commit-and-push helper.
Package contents
File | |
| tools and startup · datasets, keys, git · startup checks |
|
|
| the clock on a caller's regular expression: |
|
|
| the manual served to the model |
| the engine |
| the suites |
| the suite's pins · FastMCP, image only |
| image · startup · Unraid template |
| container and OAuth consent page icon |
|
|
Licence and credits
Released under the MIT licence — see LICENSE.
It builds on third-party components, which remain their authors' under their own licences:
Component | Author | Licence |
Jeremiah Lowin | Apache-2.0 | |
Tailscale Inc. | BSD-3-Clause | |
Anthropic | MIT | |
Python, git, Debian slim | respective projects | PSF / GPL-2.0 / various |
The distributed Docker image contains these components installed: their licences travel with them inside the image, as required.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Hosted Notion MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that wraps gitingest to enable Claude Code to analyze GitHub repositories, providing access to code structures, statistics, and full content. It facilitates the creation of structured study notes and supports both public and private repositories through the Model Context Protocol.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables Claude Desktop to read and write an Obsidian vault hosted on a VPS, using SSH or HTTP transport with OAuth authentication.62MIT
- AlicenseNot gradedqualityCmaintenanceRemote MCP server that exposes a personal git repository of markdown notes to Claude, enabling reading, writing, searching, and running scripts with automatic git commits and GitHub OAuth authentication.MIT
- AlicenseNot gradedqualityBmaintenanceAuthenticated remote MCP server that exposes a private GitHub-hosted Obsidian vault to Claude, enabling list, read, write, and search operations on notes.9MIT