Skip to main content
Glama
Local Docs MCP

Local Docs MCP

by koenvaneijk

Local Docs MCP v0.4.2

Fast, local, multi-folder document search for Windows using SQLite FTS5, PDF OCR (Tesseract), a tray app, and a standalone MCP server for Local Chat.

Supports PDF, DOCX, XLSX/XLSM, TXT, Markdown, CSV (scanned PDFs get nld+eng OCR). No cloud services — Dropbox is only an autodetected default folder. Index any local folder(s) into one database. Separate from outlook-classic-mcp; does not touch Outlook mail.

Requirements

  • Windows 10/11, Python 3.11+ with pip, venv, tkinter (3.12/3.13 recommended)

  • Files must be locally accessible (cloud online-only placeholders need downloading first)

  • Optional: Tesseract OCR with nld + eng for scanned PDFs

  • Optional: Local Chat for MCP chat search

Related MCP server: local-docs-mcp

Installation

py -3.13 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[tray]"
.\.venv\Scripts\python.exe -m local_docs_mcp.cli doctor
.\.venv\Scripts\python.exe -m local_docs_mcp.cli index   # autodetects a local Dropbox

Any other folder (or add more):

.\.venv\Scripts\python.exe -m local_docs_mcp.cli add-root "D:\Documents"
.\.venv\Scripts\python.exe -m local_docs_mcp.cli index

Do not register nested/overlapping roots (the indexer blocks this). Only index folders you're comfortable exposing to your local AI assistant.

.\.venv\Scripts\python.exe -m local_docs_mcp.cli roots
.\.venv\Scripts\python.exe -m local_docs_mcp.cli status
.\.venv\Scripts\python.exe -m local_docs_mcp.cli search '"annual report"'

DB location: %LOCALAPPDATA%\local-docs-mcp\index.sqlite (override with LOCAL_DOCS_MCP_DB or --db). It contains extracted text — keep it private.

Tray app

.\.venv\Scripts\pythonw.exe -m local_docs_mcp.tray

Tray icon → Search documents…; double-click a result to open it, or Show in Explorer. Enable Start with Windows if desired. Syncs after each scan and ~every 15 minutes; works without Local Chat. Offline roots keep their indexed rows while others sync. If launch fails, run python.exe -m local_docs_mcp.tray in a terminal (log: tray.log beside the DB).

Do not run watch while the tray is running. Console-only sync instead:

.\.venv\Scripts\python.exe -m local_docs_mcp.cli watch --interval 900

Local Chat

Local Chat is a local chat client that spawns stdio MCP servers in the background.

  1. Open Local Chat → ⚙ Settings → MCP Servers tab → + Add Server.

  2. Fill in:

    • ID: local-docs (short slug; in the model's view tools appear as local-docs__search_documents, local-docs__read_document, …)

    • Display Name: Local Docs Search

    • Command: <path to venv>\.venv\Scripts\python.exe

    • Arguments: -m local_docs_mcp.server

  3. Click Save & Apply — the MCP connects immediately (no extension restart) and the tools are auto-discovered.

Tools: search_documents, read_document, open_document (only on explicit request), index_status.

Example: “Find Word or PDF contracts mentioning a payment of €5,000, and open the best match.”

Tesseract / OCR

winget install -e --id UB-Mannheim.TesseractOCR

Language packs (PowerShell as Administrator, default folder):

$dest = 'C:\Program Files\Tesseract-OCR\tessdata'
Invoke-WebRequest 'https://github.com/tesseract-ocr/tessdata_fast/raw/main/nld.traineddata' -OutFile "$dest\nld.traineddata"
Invoke-WebRequest 'https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata' -OutFile "$dest\eng.traineddata"
& 'C:\Program Files\Tesseract-OCR\tesseract.exe' --list-langs

Low-text PDF pages are rendered and OCR'd locally. Set TESSERACT_CMD if installed elsewhere; disable with index --no-ocr; other languages via --ocr-languages nld+eng+fra. Changing OCR settings re-extracts PDFs once. Images inside DOCX/XLSX and legacy .doc/.xls are not OCR'd. Tesseract is launched with CREATE_NO_WINDOW on Windows, so the background tray sync never flashes a black console window.

Upgrading

  1. Exit the old tray, stop any watch (the old indexer can delete v0.4 rows; disable its Start with Windows first).

  2. Move your old index.sqlite to %LOCALAPPDATA%\local-docs-mcp\.

  3. Extract, create/use the venv, pip install -e ".[tray]".

  4. python -m local_docs_mcp.cli index — migrates in place; IDs and FTS data preserved.

  5. Restart the tray; the Local Chat MCP server keeps working — re-apply it with ⚙ Settings → MCP Servers → Save & Apply in Local Chat to pick up the new code.

Managing roots

.\.venv\Scripts\python.exe -m local_docs_mcp.cli add-root "E:\SharedFiles"
.\.venv\Scripts\python.exe -m local_docs_mcp.cli index
.\.venv\Scripts\python.exe -m local_docs_mcp.cli remove-root "E:\SharedFiles"          # keeps records
.\.venv\Scripts\python.exe -m local_docs_mcp.cli remove-root "E:\SharedFiles" --purge  # also deletes records

Without --purge, indexed text is retained for recovery, but the opener refuses those docs (folder no longer authorized). To purge: re-add the root, then remove with --purge.

Safety and limits

  • Files open only inside an authorized root (symlinks resolved).

  • Deletions >20% per root are blocked; confirm with index --allow-large-delete after checking files/sync client.

  • Traversal errors and offline folders preserve records; other folders keep indexing.

  • Indexing is size/mtime-based, not real-time. Deleted/moved files drop out on reconciliation; document IDs aren't stable after moves.

  • Text capped at 2M chars / 100 MiB per file.

  • The DB holds plaintext excerpts — keep it local and use trusted AI providers.

Publishing

Commit source, pyproject.toml, README, tests. Never commit .venv, SQLite DBs, or logs.

pip install "local-docs-mcp[tray] @ git+https://github.com/koenvaneijk/local-docs-mcp.git"

The local_docs_mcp module provides the CLI, tray, search UI, and MCP entry points.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      F
      maintenance
      Provides LLMs with secure, read-only access to local documentation by scanning directories, extracting content from PDF, DOCX, Markdown, and text files, and performing keyword searches.
      3
      6 npm
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables local document search and reading across formats like docx, pdf, md, and more, providing tools for listing, searching, and reading documents.
      3
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to search and read the user's local document collection (PDF, Word, Excel, Markdown, plain text) during a conversation by subject, by file name/path, or by exact word, and to retrieve file contents page by page. It also supports finding folders relevant to a topic and checking indexing status, with everything running locally on the user's machine.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to locally index folders of PDFs, Office files, email, archives, and other documents, then run full-text, boolean, phrase, fuzzy, and date-range searches while keeping documents on the user's machine.
      MIT