squatch-codebook-mcp
by squatch-c-c
README.md
# squatch-codebook-mcp
Reason over your **own local notes** with a hyperdimensional (FHRR) codebook — `query`,
`related`, `neighbors`, `walk`, `analogy`. **No LLM in the loop, nothing leaves your machine.**
An [MCP](https://modelcontextprotocol.io) server, so it works in Claude Desktop (Chat) and Claude Code.
## Run it (zero install — `uvx` fetches + runs)
```bash
uvx --from git+https://github.com/squatch-c-c/squatch-codebook-mcp squatch-codebook-mcp
```
Requires [`uv`](https://docs.astral.sh/uv/) (`curl -LsSf https://astral.sh/uv/install.sh | sh`).
## Add to Claude Desktop
`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
```json
{
"mcpServers": {
"codebook": { "command": "uvx", "args": ["--from", "git+https://github.com/squatch-c-c/squatch-codebook-mcp", "squatch-codebook-mcp"] }
}
}
```
Restart Claude. Now in **Chat or Code** you can ask things like *"use codebook to find notes in
~/notes related to hyperdimensional computing"* and it answers geometrically over your local files.
## Tools
| Tool | What it does |
|---|---|
| `codebook_build(notes_dir, glob="*.md")` | Index a folder; list its notes (run first). |
| `codebook_query(notes_dir, text, …)` | Notes most related to a phrase. |
| `codebook_related(notes_dir, note_id, …)` | Related notes (geometric + link recall). |
| `codebook_neighbors(notes_dir, note_id, …)` | Nearest notes by cosine similarity. |
| `codebook_walk(notes_dir, start_id, steps=4)` | Reasoning walk along the LINKS relation. |
| `codebook_analogy(notes_dir, a, b, c, …)` | `a:b :: c:?` over your notes. |
All paths are local; every tool reads only the directory you point it at. Part of the
[Squatch](https://squatch.cc) working system.
TDQS
B3.4/5.0
Scored across 6 tools
Disambiguation5/5
Each tool has a clearly distinct purpose: indexing, analogy, nearest neighbors, query by phrase, related notes, and reasoning walk. No overlap or ambiguity.
Naming Consistency5/5
All tools follow a consistent pattern: 'codebook_' prefix followed by a descriptive noun (analogy, build, neighbors, query, related, walk). No mixing of styles.
Tool Count5/5
With 6 tools, the server is well-scoped for its purpose of note indexing and geometric reasoning. Not too few or too many.
Completeness4/5
Covers indexing, various retrieval methods, analogy, and reasoning. Minor gap: no incremental note addition or update; only reindexing entire folders, which could be a limitation.