
threadkeep-mcp
io.github.skillmerc/threadkeep-mcp
Search and read the AI chats you saved with Threadkeep. Local, read-only, no network.
Documentation
threadkeep-mcp
A local MCP server that lets Claude Desktop, Cursor, VS Code and other MCP apps search and read the chats you saved with the Threadkeep browser extension. Made by SKILLMERC.
It reads the memory folder Threadkeep writes (Markdown files plus .threadkeep/index.json). It is read-only, talks only over stdio, and opens no network connection.
Status
0.2.0: six read-only tools over one memory folder. 0.2.0 adds the Threadkeep 3.0 projects: list_projects, get_project and get_note, and a project filter on search_chats and list_chats. It reads 2.x folders as before. What changed in each version: CHANGELOG.md in the GitHub repo.
Privacy
- It reads only the files listed in the folder's
.threadkeep/index.json(chats, and for projects each Brief.md and the notes listed there). It never changes, moves or deletes a file. It sends nothing to SKILLMERC or anyone else: no telemetry, no update check. - If you start it with
npx, npx downloads it from the npm registry (npmjs.com) the first time and may check there for a newer copy when it starts. The Claude Desktop bundle needs no download after you install it. - The AI app you connect it to decides what it does with the text it reads. That may include sending it to the app's AI provider under your account. Read that app's privacy policy.
Tools
All six are read-only (readOnlyHint: true, openWorldHint: false). Each tool description tells the AI app that chat and note text is quoted material, not instructions. A saved chat or note can still hold text that reads like instructions, so keep your AI app's tool approval prompts on.
search_chats { query, site?, tag?, folder?, project?, since?, until?, limit? }: every word must match (Chinese, Japanese and Korean text is matched by character pairs, as on the Threadkeep library page). Chats with the words in the title come first, then the best match, then the newest. Returns id, title, site, updated, folder, file and up to 3 snippets of about 300 characters per chat.limitdefault 10, max 25. No match gives a plain "No saved chats match ..." message.get_chat { id, offset?, max_chars? }: the chat's front matter fields (title, site, url, created, updated, messages, folder, tags, pinned) and its Markdown.max_charsdefault 20,000, max 50,000; when there is more,next_offsetsays where to go on.list_chats { site?, folder?, tag?, project?, since?, until?, limit?, cursor? }: newest first.limitdefault 25, max 100;next_cursorgives the next page.list_projects { limit? }: the Threadkeep 3.0 projects, newest first: id, name, chats, updated, brief_words, sites.limitdefault 25, max 100. A folder from Threadkeep 2.x has no projects: the answer is an empty list and "This folder has no projects yet. Update Threadkeep to 3.0."get_project { id_or_name, offset?, max_chars? }: the project's brief (Brief.md front matter fields and Markdown, sliced likeget_chatwithnext_offset), its chats (id, title, site, updated, file; read them withget_chat) and its notes (file and size). The name must match exactly, or in any case when only one project has it; when more than one project matches, the answer lists them and asks for the id.get_note { project, file, offset?, max_chars? }: one note from the project'snotes/folder, as plain text. Only.mdand.txtnotes that index.json lists for that project, each at most 5 MB.
folder matches that library folder and its subfolders ("" means Unfiled). project takes a project id or its name. since and until take a date (2026-11-21, UTC, until includes the whole day) or a full ISO time. No answer is longer than 60,000 characters.
Staying current
The search index is built in memory at start from the files listed in index.json. Before each call the server checks index.json; when the extension has written a new one, the index is rebuilt without a restart, and only chats whose file changed are read again. If index.json is caught half-written, the previous index keeps serving and the next call tries again.
Set up
The npx setups below need Node 20 or newer. The Claude Desktop bundle (below) needs no Node. It is not out yet: it will go on skillmerc.com.
Use your own memory folder in place of the example path: the folder you chose in Threadkeep, the one that holds .threadkeep/. In JSON on Windows, double each backslash: "C:\\Users\\you\\Documents\\Threadkeep Memory".
Claude Desktop: Settings, Developer, Edit Config opens claude_desktop_config.json. Add this, save, then quit and reopen Claude Desktop:
{ "mcpServers": { "threadkeep": { "command": "npx", "args": ["-y", "threadkeep-mcp@0.2", "--dir", "/Users/you/Documents/Threadkeep Memory"] } } }
Cursor: the same mcpServers block in ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one project).
VS Code (GitHub Copilot): .mcp.json at the root of your project (one project) or ~/.copilot/mcp-config.json (every project), with "type": "stdio":
{ "mcpServers": { "threadkeep": { "type": "stdio", "command": "npx", "args": ["-y", "threadkeep-mcp@0.2", "--dir", "/Users/you/Documents/Threadkeep Memory"], "tools": ["*"] } } }
Then ask your AI app, for example: "Search my saved chats for sourdough." If the app says the server failed, its MCP log shows the reason this server gave, for example "no .threadkeep/index.json in ...".
To check the folder from a terminal: npx -y threadkeep-mcp@0.2 --dir "<folder>" prints how many chats it serves (on stderr), then waits for an AI app. Press Ctrl+C to stop.
Claude Desktop bundle (.mcpb)
manifest.json turns this package into an MCP Bundle: one file that Claude Desktop installs with a double click (or Settings, Extensions, Advanced settings, Install Extension). Claude Desktop ships its own Node, so the user needs no Node or npm. On install it asks for one setting, Threadkeep memory folder (a folder picker, user_config.memory_folder), and starts node bin/threadkeep-mcp.js --dir <that folder>. Display name "Threadkeep Memory", author SKILLMERC, icon icon.png (the Threadkeep store icon).
Build it:
node scripts/bundle.mjs # writes dist/threadkeep-mcp-<version>.mcpb and .mcpb.sha256
The script fails (exit 1) unless every check passes: manifest.json matches package.json and the tools the server registers, the bundle holds only production dependencies (no tests, fixtures or scripts), and the unpacked bundle starts with the command in manifest.json and lists the six read-only tools. It writes the SHA-256 of the bundle next to it.
Where it goes: skillmerc.com only (the Threadkeep help page), with the SHA-256 shown next to the link. The bundle is unsigned on purpose: today Claude Desktop refuses signed bundles (modelcontextprotocol/mcpb issue 278), so check the SHA-256 instead.
What it refuses
- To start, unless
--diris a folder holding.threadkeep/index.jsonwith"format": "threadkeep-memory"and"version": 1. So it cannot be pointed at a home folder by mistake. The reason goes to stderr and the exit code is non-zero. - To serve any file not listed in the
chatsof index.json (or as a project's Brief.md or listed note), any chat or brief that is not.md, any note that is not.mdor.txt, any chat file over 25 MB, Brief.md over 1 MB or note over 5 MB, and any path that resolves outside the folder:..segments, absolute paths, drive letters, backslashes, and symlinks (file or folder) that lead out. The check isrealpathpluspath.relative, never a string prefix, so a sibling such as<folder>-oldis outside too. - To read a file without checking it again first. Every read runs the path check again (the folder can change while the server runs), then opens the file without following a final symlink and confirms the open file is the one that was checked.
- To write to stdout anything but JSON-RPC. Logs, warnings,
--helpand--versiongo to stderr, andconsole.*calls are routed to stderr.
Limits
- The index is built before the server answers the AI app: about 5 s for 2,000 chats of 40 KB on a Mac, roughly 25 s for 10,000. A very large folder can pass an app's start timeout.
- If
--diris a symlink and it is pointed at another folder while the server runs, the next reload serves the new folder (it still needs a valid index.json).
Development
Node 20 or newer. Runtime dependencies: @modelcontextprotocol/sdk and zod (the schema library the SDK uses for tool inputs), both pinned to exact versions.
npm install
npm test
The fixture lives in test/fixtures/memory (rebuild with node test/fixtures/make-fixture.mjs). Symlinks, the oversize file and the sibling folder are made at test time in a temp copy, so the repo checks out cleanly on Windows.
Tests
npm testrunstest/run.mjs: everytest/*.test.mjswithtest/no-network.mjsinNODE_OPTIONS, so the test runner, each test file and every server the tests start have the network blocked.test/preload.test.mjsfails if the suite is run any other way. Extra arguments go tonode --test:npm test -- --test-name-pattern=search.- What the suite covers: path safety, index loading, the command line, the SDK stdio client, raw stdout purity (only JSON-RPC on stdout, a stray
console.loggoes to stderr), the six tools (projects:test/projects.test.mjs), reload onindex.jsonchange, size caps, and that the site ids in the tool descriptions match the extension writer (../threadkeep/src/memory/format.js; skipped when that file is not next to this package). npm run smoke:inspectorcallstools/listand onesearch_chatsagainst the fixture through the MCP Inspector command line (pinned@modelcontextprotocol/inspector@2.17.0, fetched by npx, so it needs the network and Node 22.23.4 or newer). CI runs it on Node 22.- CI:
.github/workflows/ci.ymlrunsnpm ciandnpm teston every push tomainand every pull request, on Linux, macOS and Windows with Node 20, 22 and 24. It runs the tests withCIset to empty, because the extension source the contract test reads is not in this repo (the test skips without it, but fails whenCIis set).
Release
0.1.0 and 0.2.0 were published by hand from a clean clone of this repo: npm ci, npm test, npm publish --access public, with the package owner's second factor. So they have no provenance statement. Each published version has a tag v<version> on the commit it was built from.
.github/workflows/publish.yml is ready for later versions: when a GitHub release v<version> is published it runs npm ci, npm test, then npm publish --provenance --access public through npm trusted publishing, so no npm token is stored anywhere. It runs in the GitHub environment npm, which only main and v* tags may use. It is not connected on npm yet, so no version has come from it so far.
npm also documents staged publishing (https://docs.npmjs.com/staged-publishing): npm stage publish on a package that does not exist yet creates it with a public placeholder version 0.0.0-stage, and the real version goes live only after a maintainer approves it with the second factor. We do not use it. The first publish of this package still left a placeholder 0.0.0-stage on the package page, 76 seconds before 0.1.0. It holds no code and is deprecated with "Placeholder, use 0.1.0 or later". Install 0.1.0 or later.
Licence
MIT. Made by SKILLMERC.
ChatGPT, Claude, Gemini, NotebookLM, DeepSeek, Grok, Cursor and Visual Studio Code are trademarks of their owners. threadkeep-mcp is not made, endorsed or supported by any of them.
threadkeep-mcpnpm install threadkeep-mcp