The problem
Every AI tool I use starts from zero. Claude, ChatGPT and my coding agents each keep their own memory, so I kept re-explaining my background, my projects and how I like code written. Writing a CV or updating this portfolio meant pasting the same facts into a new chat each time.
What if every AI app I use could read the same notes, written by me, and none of them could quietly rewrite them?
The solution
Personal Knowledge MCP is a small self-hosted Model Context Protocol server. My notes are plain Markdown in a private GitHub repository. The server indexes them and lets Claude.ai, ChatGPT, Claude Code and Codex search and read them after a passkey sign-in. Agents can suggest edits, but only as pull requests that I review and merge.
4
AI apps reading the same notes
5
MCP tools: four read, one propose
1
owner account accepted
~90 s
from a merged edit to a searchable note

It's built for one person, one VPS and one domain. I started it as a private codebase with Obsidian LiveSync, CouchDB and a signed-approval CLI, then rebuilt a simpler version around Git once I saw which parts I actually used. The simpler one is what runs today.
How it works
- 01WriteNotes are Markdown with optional frontmatter:
type,visibilityandtags. I edit them in Obsidian and push to Git. - 02SyncA sidecar container clones the private notes repository every 60 seconds with a read-only token. A failed pull keeps the last good copy.
- 03IndexThe server builds a SQLite FTS5 full-text index and a wikilink graph from the notes. The index is disposable; the Markdown is the source of truth.
- 04AskAn AI app calls
search_notes,read_note,get_related_notesorget_profile_contextand gets source excerpts with paths and revision hashes.
The server never runs a model. It returns my own notes with their sources, and the client's model does the writing, so every answer traces back to a specific note and revision.
Edits go through review
Reading is the default. Writing is opt-in and indirect: an agent calls propose_note_change, and the server opens a pull request on the notes repository. Nothing changes until I merge it.

What a proposal must carry
- The revision from the agent's last
read_note, so a stale edit is refused instead of overwriting newer text - A path inside the vault; traversal and hidden files are rejected
- The full new note body; existing frontmatter is kept
What limits it
- A separate GitHub token scoped to the notes repository only
- 20 proposals per hour, 256 KiB each
- The agent's reason is confined to a code block in the PR body, so it can't pass as my own text
- No delete tool exists
Making four apps agree
Connecting one client was easy. Connecting four was the real work, because each one handles OAuth a little differently:
Codex
Claude Code
Claude.ai
ChatGPT
ChatGPT's extra scopes made Pocket ID add the issuer as a second token audience, which the server rejected. Instead of dropping the audience check, I accepted exactly two shapes, [resource] or [resource, issuer], and added tests that still reject every other combination.
A second bug only showed up end to end: Pocket ID sometimes issues one-hour tokens that span 3,601 seconds, which my lifetime check refused. A small clock tolerance and a regression test fixed it.
Architecture
Edge
- Traefik on one hostname with automatic HTTPS and an HTTP→HTTPS redirect
- Per-IP rate limits on the login routes and on
/mcp
Identity
- Pocket ID for passkey sign-in, issuing OAuth tokens with PKCE
- A one-time
setupservice creates the owner group, the API resource and ready-made clients for all four apps through Pocket ID's admin API - Its admin key is removed after setup and never reaches the MCP server
MCP server
- TypeScript on Node 24 with the official MCP SDK over Streamable HTTP
- Validates issuer, audience, owner, scope
knowledge:readand token lifetime with jose - Zod schemas for tool inputs and note frontmatter
Notes
- A git sidecar keeps a shallow clone; the server mounts it read-only
- SQLite FTS5 search and a link graph rebuilt from the Markdown
Design decisions
Git instead of a sync database. The first version mirrored an Obsidian vault through LiveSync and CouchDB, with a supervised sync process I had to pause before applying approved edits. Git already gave me history, review and a merge button. Moving to a Git repository removed CouchDB, the sync coordination code and my own approval CLI, and pull requests replaced all three.
Hardened containers. Every service runs with a read-only filesystem, dropped capabilities, no new privileges, and memory and process limits.
Deployable on Coolify without secrets at build time. Coolify interpolates variables while it builds, so I made the Compose file build without any runtime values and report missing settings when the stack starts.
Outcome
The server runs on my VPS, and all four apps read the same notes. When I ask any of them for a CV, a cover letter or a project write-up like this one, they start from my notes instead of from zero.
One source of context, in plain Markdown I own, readable by every AI app I use and editable only through my review.
I'm preparing the rebuilt version as an MIT-licensed open-source repository with setup guides for Coolify and plain Docker.
Tech stack
| Layer | Technology |
|---|---|
| Server | TypeScript, Node.js 24, MCP TypeScript SDK (Streamable HTTP) |
| Validation | Zod, jose |
| Search | SQLite FTS5 (Node built-in) |
| Identity | Pocket ID, OAuth with PKCE, passkeys |
| Infrastructure | Docker Compose, Traefik, Coolify |
| Notes | Obsidian, Git, GitHub API |
| Testing | node:test |

