local-notes-search-mcp
You can locally index your own text files and perform semantic search or optional grounded LLM Q&A over them via an MCP client.
Recursively index a directory for semantic search, skipping hidden files/dirs, common build dirs, files >2MB, binaries, and credential-shaped names; unchanged files skipped by hash; deleted files purged.
Search indexed content with natural-language queries, returning top-k chunks with file path, line range, snippet, and distance score; optionally scope by path_prefix.
Ask natural-language questions and get an LLM-synthesized answer grounded only in retrieved chunks with file:line sources; requires GROQ_API_KEY or MISTRAL_API_KEY, otherwise returns raw matches.
List indexed files with chunk counts, last-indexed timestamps, and stale-embedding markers.
Remove all indexed entries under a path without deleting original files.
Configure via env vars: index DB path, embedding model, model cache, offline mode, allowed roots, and optional API keys; supports Turkish/English/mixed text.
Indexing and search need no API key and work offline after the one-time model download; only ask_notes may contact an external LLM.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-notes-search-mcp search my notes for what I decided about the auth redesign"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🔎 local-notes-search-mcp
Semantic search over your own files — as an MCP server.
Ask questions in plain language instead of guessing the exact keyword you typed six months ago.
Try it in a minute
git clone https://github.com/Furkiozknn/local-notes-search-mcp.git
cd local-notes-search-mcp
uv sync && uv run python examples/stdio_demo.pyThat starts the server, talks to it over stdio the way an MCP client does, and
searches the fixture notes in examples/notes/ — five short
files written for this repository, not anyone's real notes — into a
throwaway index in a temp directory. Nothing in ~/.local-notes-search is
touched. Measured on the author's machine (Windows 11, Python 3.12, uv 0.12.5,
30 September 2026): uv sync with an empty uv cache 22 s, the one-time model
download about 20 s, the demo itself about 19 s. The first run needs network for
that download; see the model download if you want it as an
explicit step.
The part of that output that matters (verbatim; the tools answer in Turkish, the
author's working language, and distance is the sqlite-vec default L2 distance — lower is
closer, and it is not a 0–1 score):
examples/notes indexlendi: 5 dosya (yeni/değişmiş), 0 değişmemiş dosya atlandı, 5 yeni chunk, 0 silinmiş dosya temizlendi.
search_notes("what did I decide about the auth redesign?", top_k=2)
2 sonuç:
--- examples/notes/2026-08-decisions.md:1-10 (distance=4.5000) ---
# Decisions, August 2026
## Auth redesign
Decided: session cookies instead of JWT. The refresh-token rotation story was
getting worse than the problem it solved, and every client we ship is a browser.
[...]
--- examples/notes/meeting-2026-07-30.md:1-7 (distance=5.0842) ---
# Meeting, 30 July
[...]
- Agreed to revisit the login flow after the billing migration ships.The query says "auth redesign"; the note says "session cookies instead of JWT". The second pasta query in the full record finds a Turkish note for an English question, which is what the multilingual model is for.
When to use it, and when not to
Use it when | Do not use it when |
you remember what a note said but not the words you typed | you know the exact string: |
you want your MCP client (Claude Code, Claude Desktop, …) to search your own folders with | you need a shared, multi-user or hosted index: this is one local SQLite file, single writer |
the notes must not leave the machine and you have no API key to give | you need the ranking to be tuned per corpus: one fixed embedding model, no re-ranking |
Turkish, English or mixed notes | your files are PDFs, Word or images: only text formats are read (list) |
Want a synthesized answer instead of a result list? 💡 ask_notes runs the
exact same retrieval, then has an LLM answer grounded only in the retrieved
chunks, with file:line sources attached. It's strictly opt-in — set
GROQ_API_KEY or MISTRAL_API_KEY and it synthesizes; set neither and it
quietly returns the raw matches instead of failing.
Indexing and search need no API key, no Docker container and no daemon. The one network call they can make is the one-time model download.
Related MCP server: code-rag
🧭 The 30-second pitch
grep / ripgrep | Cloud RAG SaaS | local-notes-search-mcp | |
Finds "the auth decision" when you wrote "session vs JWT" | ❌ | ✅ | ✅ |
Works with no API key | ✅ | ❌ | ✅ |
Your files never leave the machine | ✅ | ❌ | ✅ |
No server / daemon / container to run | ✅ | ❌ | ✅ |
Answers with exact | ✅ | ⚠️ | ✅ |
Costs money per query | ✅ free | ❌ | ✅ free |
Usable directly by Claude / any MCP client | ❌ | ⚠️ | ✅ |
Optional grounded LLM answer with sources | ❌ | ✅ | ✅ opt-in |
🏗️ How it works
flowchart LR
subgraph INDEX["📥 Index pipeline — runs when you ask it to"]
direction LR
A["📁 Local folder"] --> B["🚶 Walk + filter<br/>skip hidden, node_modules,<br/>.venv, files > 2MB"]
B --> H{"🔐 Content hash<br/>or embedder changed?"}
H -- "no" --> SKIP["⏭️ Skip<br/>zero CPU"]
H -- "yes" --> C["✂️ Line-based chunker<br/>1500 chars + 200 overlap<br/>never splits a line"]
C --> D["🧠 fastembed ONNX<br/>paraphrase-multilingual-MiniLM-L12-v2 · 384-d"]
end
D --> DB[("🗄️ sqlite-vec<br/>vec0 virtual table<br/>~/.local-notes-search/index.db")]
subgraph QUERY["🔍 Query path — 100% offline"]
direction LR
Q["💬 Natural-language<br/>question"] --> QE["🧠 Embed query<br/>same model"]
end
QE --> DB
DB --> R["🎯 Top-k chunks<br/>file:line + snippet<br/>+ distance score"]
R -. "opt-in: ask_notes<br/>needs an API key" .-> LLM["🤖 LLM synthesis<br/>Groq → Mistral fallback<br/>grounded in retrieved chunks only"]
LLM --> ANS["💡 Answer + file:line sources"]
style LLM fill:#1c1730,stroke:#a371f7,color:#ffffff
style ANS fill:#1c1730,stroke:#a371f7,color:#ffffff
style DB fill:#003b57,stroke:#00b4d8,color:#ffffff
style R fill:#1a7f37,stroke:#3fb950,color:#ffffff
style SKIP fill:#4d3800,stroke:#d4a72c,color:#ffffffHybrid retrieval: meaning and exact words
Dense vectors are good at "how do I cook pasta" finding a note about boiling
spaghetti, and weak at exact tokens: an error code (E4127), a ticket
(JIRA-48213), an identifier. Those embed as noise. So every chunk is also
written to an SQLite FTS5 table (BM25 ranking, unicode61 tokenizer with
diacritics folded, and the Turkish ı/İ folded to i on both sides, so calisma
and CALIŞMA both find Çalışma), in the same index.db file.
search_notes runs both and fuses the two rankings with reciprocal rank
fusion (1 / (60 + rank) summed per chunk, rank-based so a cosine distance and
a BM25 score never have to be put on one scale). A chunk found by both rankings
outranks one found by either alone.
mode="vector"gives exactly the ranking from before hybrid search existed.mode="keyword"never loads the model, so it works before the model is downloaded and underLOCAL_NOTES_SEARCH_OFFLINE=1with an empty cache.Every word of the query is passed to FTS5 as a quoted string, so FTS syntax in a query (
AND,NEAR(...),*, a stray") is searched for, never executed.An index built by an older release gets its keyword table built from the stored chunks on first open; nothing is re-embedded. An SQLite without FTS5 falls back to vector search and says so.
🧰 MCP tools
🛠️ Tool | What it does |
🗂️ | Recursively indexes a directory. Skips hidden files and directories ( |
🔍 | Natural-language search. Returns |
💡 | Optional. Same retrieval as |
📋 | What's in the index right now: path, chunk count, last-indexed timestamp (first 200 files, with a count of the rest), and a marker on files embedded by another model/fastembed version. Useful before searching, or to debug a stale result. |
🧹 | Drops everything under |
What a client sees besides the text. Every tool carries MCP behaviour hints
and a title, and search_notes / list_indexed_files also return their result
as structuredContent with a published outputSchema (per hit: path,
start_line, end_line, snippet, distance, match), so a client can cite
file:line without parsing text. The text output is unchanged. An invalid
query comes back as an error result (isError: true), not as a normal answer.
Tool |
|
|
|
| Why |
| false | false | true | false | writes the index only; unchanged files are skipped |
| true | – | true | false | read the index only |
| true | – | false | true | sends retrieved chunks to Groq/Mistral when a key is set |
| false | true | true | false | deletes index entries (never your files) |
🔒
index_directory,search_notes,list_indexed_filesandremove_directoryrequire no API key and send nothing anywhere. The one network call they can make is the one-time embedding-model download described under Quickstart — setLOCAL_NOTES_SEARCH_OFFLINE=1to rule even that out.ask_notesis the one tool that can talk to a remote provider, and only when you explicitly give it a key.
🚀 Quickstart
Needs uv and Python 3.10–3.13.
git clone https://github.com/Furkiozknn/local-notes-search-mcp.git
cd local-notes-search-mcp
uv syncThe demo above is the quickest check that everything works. If the model cannot be
downloaded it prints an error naming the fix (network access, or
--download-model + LOCAL_NOTES_SEARCH_OFFLINE); uv run local-notes-search-mcp --help
lists the tools, the environment variables and the default paths.
Register local_notes_search.py as a stdio MCP server:
{
"mcpServers": {
"local-notes-search": {
"command": "uv",
"args": [
"--directory", "/absolute/path/to/local-notes-search-mcp",
"run", "local_notes_search.py"
]
}
}
}Without a clone, straight from GitHub (measured: 29 s to the first tools/list with an empty uv cache, 11 s warm; it is not on PyPI):
{"mcpServers": {"local-notes-search": {"command": "uvx", "args": ["--from", "git+https://github.com/Furkiozknn/local-notes-search-mcp", "local-notes-search-mcp"]}}}The model download, stated plainly. The embedding model is not bundled.
Unless it is already cached, the first index_directory / search_notes call
downloads it from Hugging Face (fastembed lists it at 0.22 GB) into
~/.local-notes-search/models, and every call after that is offline. To make
that download an explicit step instead of a side effect:
uv run local-notes-search-mcp --download-model # once, with network
export LOCAL_NOTES_SEARCH_OFFLINE=1 # from now on: never downloadWith LOCAL_NOTES_SEARCH_OFFLINE=1 and no cached model, a tool call fails with
an error that says exactly this, instead of reaching for the network.
Env var | Default | What it does |
|
| Where the index lives. One single file for every indexed directory — so a single |
|
| Embedding model (any fastembed-supported name). An index built with another model is refused, not silently compared. |
|
| Model cache. Falls back to |
| unset |
|
| unset | Optional allowlist. When set, |
| unset | Optional. Enables |
| unset | Optional. Fallback provider for |
Keys are read from the environment only — never commit them, and never put them in the MCP client config file you check into git.
Default indexed extensions: .md .txt .py .js .ts .tsx .jsx .json
.yaml .yml .rst .toml — override per call with extensions=[...].
🔒 What can be indexed
index_directory reads whatever it is pointed at, and ask_notes sends the
chunks it retrieves to a third-party LLM (Groq or Mistral) when a key is
configured. So an indexed path is a path whose contents can leave the machine.
These guards exist:
1. LOCAL_NOTES_SEARCH_ALLOWED_ROOTS (opt-in). Unset by default — that is
the historical behaviour, any directory the running user can read is
indexable, and this project does not pretend an empty default is a sandbox.
Set it and index_directory refuses anything outside:
export LOCAL_NOTES_SEARCH_ALLOWED_ROOTS="$HOME/notes:$HOME/projects"Paths are resolved (.. collapsed, symlinks followed) before the check, and a
subdirectory of an allowed root is allowed. A configured entry that is not a
directory is an error rather than being silently dropped — a typo must not
quietly switch the allowlist off.
2. A credential-filename denylist (always on). These are never indexed,
whatever the allowlist or the extensions=[...] argument says:
.env · .env.* · .netrc · _netrc · id_rsa · id_dsa · id_ecdsa ·
id_ed25519 · credentials.json · secrets.json · service-account*.json ·
.npmrc · .pypirc · .git-credentials · *.pem · *.key · *.p12 ·
*.pfx · *.ppk
Matching is case-insensitive. It is a name denylist, not a secret scanner:
it stops the obvious cases (credentials.json would otherwise sail through the
default .json extension filter), not a key pasted into a .md file.
3. Hidden files and directories are not walked (always on). .ssh,
.aws, .gnupg, .docker (whose config.json holds registry auth),
.config (where gh keeps an OAuth token in hosts.yml), ~/.claude.json
(MCP server configs, API keys in env included) — pointing index_directory
at a home directory must not sweep those in through the .json / .yml
filters. A hidden directory you do want indexed can be passed as path
itself. Only regular files are read: a FIFO or device named *.md is skipped
(a FIFO used to hang the whole call), and a file is never read past 2 MB even
if it grew after the walk.
4. Symlinks cannot leave the root (always on). A symlinked file is indexed
only if it resolves to a regular file inside the directory being indexed, not
inside a skipped directory, and not to a denylisted name — so
notes/todo.md → ~/.aws/credentials is skipped instead of being read under an
innocent name, past both the denylist and the allowlist. Directory symlinks are
never followed.
🗄️ What the index stores
The index file holds, for every indexed chunk, its full text in plain
text, its path and line range, and its vector. It is a copy of your notes,
not just pointers to them. On Linux/macOS it is created owner-only (0600,
inside a 0700 ~/.local-notes-search/; an index created by an older version
is tightened the next time it is opened). Delete it — or use
remove_directory — and the copy is gone; your original files are never
modified.
Every indexed file also records which embedder produced its vectors: the
model name and the fastembed version. That matters because fastembed 0.6.0
changed this model's pooling (CLS → mean), so vectors from before and after
are not comparable. After an upgrade, search_notes / ask_notes start with
a warning that says how many files are stale, list_indexed_files marks them,
and the next index_directory on those folders re-embeds them even though
their content did not change. An index created before this was recorded is
treated the same way.
🧠 Why this architecture
Decision | Why |
🗄️ | A |
⚡ | Local embedding here is the only path — it runs on every index and every search. |
🧬 | Small (0.22 GB), Apache-2.0, and — decisive for this tool — actually multilingual: the previous |
✂️ Line-based chunking, no NLP/AST dependency | Chunks accumulate whole lines until a character budget is hit — a line is never split in half, so every |
🔐 Whole-file content-hash skip on re-index |
|
🧪 Tests
uv run pytest -v107 tests, on a deliberate two-tier strategy. Pure-logic tests (chunking,
hashing, file walking, ask_notes' provider-chain and degradation paths)
always run — no model, no network, no API key. Tests that need the real
fastembed model or the sqlite-vec extension skip honestly when those can't
be loaded — an offline runner, a blocked model download — rather than faking a
green result.
What that means in practice, reported exactly as measured:
Environment | Result |
✅ CI (model cached, and required: a missing model fails the job instead of skipping; Python 3.10, 3.11, 3.12 and 3.13) | 107 passed on each of the four — measured 30 September 2026 — including the real end-to-end flow — the fastembed model really loaded, the sqlite-vec extension really ran, and a "how do I cook pasta" query really retrieved the recipe note and not the car-maintenance one. |
⚠️ Windows, model download blocked ( | 84 passed, 23 skipped (15 model-backed + 8 POSIX-only) — measured 30 September 2026. Every model-free test green, and the model-backed ones skipped with an explicit reason instead of a false pass. |
The second row is the honest cost of the first: this suite tells you when it couldn't verify something.
What this server can actually do
The expensive question about an MCP server is not what it promises but what it can do on your machine: which credentials it can touch, where it connects, what it runs. Answering that means reading the source, and most people will not.
On every push, mcp-vet from the same account audits this server from source and writes the whole report into the job summary, verdict included. The gate closes at HIGH and above — and it also closes if the tool itself could not run, because "I could not look" should not read as green.
Auditing our own server with our own tool had a side effect worth recording: adding this job surfaced a real false positive in mcp-vet, which was fixed. A tool nobody runs stays right by default.
⚠️ Known limitations
Written down on purpose, because a README that claims no weaknesses is a README you shouldn't trust.
No query-instruction prefix is needed anymore. The previous English-only
bge-small-en-v1.5recommended embedding queries with an instruction prefix, which this tool skipped as a v1 simplification. The current default,paraphrase-multilingual-MiniLM-L12-v2, is a symmetric model: queries and passages are meant to embed identically, so the simplification is now simply the correct usage. If you overrideLOCAL_NOTES_SEARCH_MODELwith an asymmetric model (BGE/E5 family), know that its prefix convention is still not applied.path_prefixfilters after the vector search, not inside it. The search over-fetches4 × top_knearest chunks from the whole index and then keeps those under the prefix, so a narrow prefix in a large index can return fewer thantop_kresults even when more matching chunks exist. The keyword side of hybrid search over-fetches and filters the same way.Keyword matching is word-level. FTS5's
unicode61tokenizer splits on punctuation, soZX-99812is the two wordsZXand99812, matched as a phrase; there is no stemming (deploysdoes not matchdeploy).Single-writer SQLite. Concurrent
index_directory/search_notescalls from separate processes can collide on writes. The tool is designed around a single MCP client session.
📓 Changelog
See CHANGELOG.md.
📜 License
MIT — and every runtime dependency was license-checked:
sqlite-vec (Apache-2.0), fastembed (Apache-2.0), mcp (MIT),
litellm (MIT). No non-commercial or field-restricted weights anywhere in
the stack.
Built as part of an ecosystem of small, focused, self-hostable AI tools.
More from this ecosystem
mini-creative-toolkit — 23 CPU-first media tools behind one MCP server
nvidia-nim-mcp — seven MCP tools on NVIDIA NIM's free tier
voice-io-mcp — speech in and out, needing no API key
mcp-vet — audits an MCP server's source before you install it
All of them in one searchable page: furkiozknn.github.io — each card is generated from that repository's own project-meta.json.
Available Tools
5 toolsask_notesA
Ask a question in natural language about your indexed files. Retrieves the most relevant chunks (same retrieval as search_notes) and asks an LLM (Groq, then Mistral fallback - needs GROQ_API_KEY or MISTRAL_API_KEY) to synthesize an answer grounded ONLY in those chunks, with file:line sources. Without either key configured, degrades to returning the raw retrieved chunks with a note that no LLM is available - never fails outright just because synthesis isn't possible.
Inputs: question (required), top_k, path_prefix. Returns: result
index_directoryA
Index (or re-index) a local directory for semantic search. Walks
recursively, skips .git/node_modules/.venv/etc and files >2MB, and
skips any file whose content is unchanged since the last index (cheap:
a whole-file hash check before touching the embedding model). Files
that were indexed before but no longer exist under path are removed
from the index.
Credential-shaped file names (.env, id_rsa, credentials.json, .netrc,
*.pem, ...) are never indexed. If LOCAL_NOTES_SEARCH_ALLOWED_ROOTS is
set, `path` must resolve inside one of its entries; unset (the default)
means any readable directory is indexable.Inputs: path (required), extensions. Returns: result
list_indexed_filesA
Lists what's currently in the index - file path, chunk count, last indexed time. Useful to check what's covered before searching, or to debug a stale/missing result.
Inputs: path_prefix. Returns: result
remove_directoryA
Removes every indexed file/chunk under path from the index. The
index is persistent local state in ~/.local-notes-search/ (or
LOCAL_NOTES_SEARCH_DB) - this is how you clean it up without deleting
the whole database file.
Inputs: path (required). Returns: result
search_notesA
Semantic search across everything indexed so far. Returns the top matching chunks with file path, line range, and a relevance-ordered snippet - not just a bag of file names.
Inputs: query (required), top_k, path_prefix. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: index_directory ingests data, search_notes and ask_notes are differentiated as raw retrieval vs. LLM-synthesized answers, list_indexed_files provides observability, and remove_directory cleans up. Even the two retrieval-based tools are easy to tell apart because their outputs and purposes are explicit.
All tool names follow a consistent snake_case verb_noun pattern: index_directory, search_notes, list_indexed_files, ask_notes, remove_directory. There are no mixed conventions or vague generic verbs.
Five tools is a well-scoped surface for a local notes search server: ingest, search, ask, list, and remove each earn their place. The count is neither bloated nor too thin.
The index lifecycle is fully covered: create/update via index_directory, read via search_notes and ask_notes, inspection via list_indexed_files, and deletion via remove_directory. Re-indexing handles changed and removed files, so there are no obvious dead ends or missing operations.
Related MCP Connectors
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceLocal MCP server that provides semantic search (RAG) over code repositories, enabling AI clients like Claude and Gemini to access project context without manual re-upload.-
- FlicenseNot gradedqualityCmaintenanceA semantic code search MCP server that enables natural language queries against your codebase, supporting features like related file discovery and context expansion, all running locally.2-
- AlicenseAqualityBmaintenanceLocal MCP server for semantic code search using Tree-sitter AST parsing, local embeddings, and hybrid search; enables indexing and querying codebases entirely offline.7MIT
- AlicenseAqualityDmaintenanceLocal-first MCP server for semantic + keyword hybrid code search. Zero external services, no API keys required.2MIT