Skip to main content
Glama
local-docs-mcp

local-docs-mcp

local-docs-mcp

A personal MCP server that reads documents on your local PC to help with summarization and organization. It extracts text from PDF, Word, Excel, PowerPoint, Hangul (HWP), Markdown, CSV, and more, and handles saving summaries and organizing files with an approval process.

  • It does not use the network. No API key is required.

  • This server does not summarize. It extracts the original text accurately, and Claude writes the summary. (The machine_keypoints the server provides are frequency-based mechanical extraction, not a summary.)

  • It cannot read outside the allowed folders. Moving or saving files always requires approval.

Supported formats

Type

Extensions

Method

Documents

.docx .docm

Direct ZIP+XML parsing (headings, paragraphs, tables)

Hangul

.hwpx / .hwp

.hwpx is natively supported; .hwp is best-effort extraction if olefile is installed

PDF

.pdf

pypdf (per-page p.N labels)

Presentations

.pptx .pptm

Slide number order + speaker notes

Spreadsheets

.xlsx .xlsm

Per-sheet, shared string resolution

Data

.csv .tsv .json

Includes column names and row counts

Web & Mail

.html .htm .xml .eml

Tag stripping; mail includes headers + body

Text & Code

.md .txt .log .yaml .py .js etc.

UTF-8/CP949/EUC-KR auto-detection

.doc .xls .ppt (legacy binary formats) are not read; the server tells you to "save them in an x-suffixed format."

Related MCP server: file-analysis

Installation

Python 3.11 or later is required.

python -m venv .venv && .venv/Scripts/pip install -e ".[formats,dev]"

On macOS and Linux, use .venv/bin/pip. [formats] installs pypdf for PDF and olefile for .hwp (binary) together; without them, the remaining formats still work.

Registering with Claude Code

<PROJECT_DIR> is the absolute path where you cloned this repository, and <HOME> is the user home folder.

claude mcp add local-docs --scope user --env DOCS_MCP_ROOTS="<HOME>/Desktop;<HOME>/Documents" --env DOCS_MCP_OUTPUT="<HOME>/Desktop/docs-mcp-out" -- <PROJECT_DIR>/.venv/Scripts/python.exe -m docs_mcp.server

To use it only within this repository, copy .mcp.json.example to .mcp.json and replace <PROJECT_DIR> and <HOME> with the actual paths. .mcp.json paths differ per machine, so it is not tracked in the repository.

Environment variables

Variable

Meaning

Default

DOCS_MCP_ROOTS

Folders allowed for reading (separated by ;)

Desktop, Documents, Downloads

DOCS_MCP_OUTPUT

Folder for saving summaries and organization logs

<HOME>/Desktop/docs-mcp-out

DOCS_MCP_MAX_FILE_MB

Maximum file size

20

DOCS_MCP_ALLOW_MOVE

If 1, allows moving originals during organization

Unset (copy only)

11 tools

Read-only (R) and write (W) tools are registered separately so the host can show different approval UIs.

Tool

What it does

R

list_roots

Check readable folders, supported formats, and limits

R

scan_documents

Scan a folder for a document list (type, size, modified date)

R

outline_document

Structure, headings, keywords, representative sentences. For judging before reading the full text

R

read_document

Extract body text. Provides section labels and a continuation cursor

R

search_documents

Search across multiple document bodies + evidence snippets

R

build_summary_bundle

Extract evenly from multiple documents within a character budget

R

preview_save_summary

Preview content and path to save + issue approval token

W

save_summary

Save the approved summary to the output folder

R

preview_organize

Create only an organization plan (no file changes) + approval token

W

apply_organize

Execute the approved plan (copy by default)

W

undo_last_organize

Revert based only on the journal record

list_roots
  → scan_documents          어떤 문서가 있는지
  → outline_document        긴 문서는 뼈대부터
  → read_document           원문을 근거로 확보 (필요하면 이어 읽기)
  → (Claude가 요약 작성)
  → preview_save_summary    저장 내용 확인
  → [사용자 승인]
  → save_summary

Organization is done separately.

preview_organize   계획만 생성 — 파일은 하나도 건드리지 않음
  → [사용자가 계획 확인·승인]
  → apply_organize (기본 copy)
  → 문제가 있으면 undo_last_organize

There are four organization criteria.

Criterion

Result folder

by_kind

01_Documents 02_PDF 03_Presentations 04_Spreadsheets …

by_month

Modified month like 202608

by_kind_month

02_PDF/202608

by_keyword

Names specified in rules. Example: {"contracts": ["contract","agreement"]}

Safety mechanisms

  1. Path blocking — Every input path is resolve()d and then checked to be inside the allowed roots. .., symbolic links, and drive traversal are all blocked here.

  2. Write blocking — Saving is only possible inside the output folder. Nothing is written to the read roots.

  3. Excluded folders — .git, node_modules, .venv, AppData, etc. are neither scanned nor read.

  4. Approval token — A hash of the preview content. If even one character of the content changes, the token breaks and saving/organizing is rejected. However, the token only guarantees technical integrity and does not replace user approval.

  5. Copy by default — Moving originals is only possible with DOCS_MCP_ALLOW_MOVE=1.

  6. No deletion — Undo also does not delete files; it moves them to a _trash folder.

Verification

.venv/Scripts/python.exe -m pytest -q
.venv/Scripts/python.exe scripts/smoke.py
.venv/Scripts/python.exe scripts/simulate.py
  • pytest — format-specific extraction, boundary checks, approval flow (unit tests)

  • smoke.py — verifies initialize → tools/list → tools/call over real stdio

  • simulate.py — creates a virtual document set and reproduces the entire flow over a real MCP connection. It creates 12 virtual documents (meeting minutes, contracts, quotes, presentation materials, PDFs, CP949 memos, etc.), then runs through scanning → summary saving → organization → undo, and verifies that things that should be blocked (reading outside roots, token forgery, moving originals) are actually blocked. It runs in a temporary folder and cleans up after itself. Pass a folder as an argument to keep the results.

Limitations

  • Scanned image PDFs have no text. No OCR is performed; only a warning is left.

  • Excel date cells may appear as internal serial numbers.

  • .hwp (binary) is best-effort extraction. Table and footnote order may differ from the original.

  • Text inside images is not read in any format.

License

MIT — LICENSE

Available Tools

11 tools
apply_organizeA
Destructive

승인된 정리 계획을 실제로 수행합니다. 기본은 복사이며, 이동은 서버 설정과 사용자 승인이 모두 있어야 합니다.

Inputs: target_dir (required), approval_token (required), mode, kinds, +5 more. Returns: mode, stage, status, journal, +5 more

build_summary_bundleA
Read-only

여러 문서를 글자 예산 안에서 고르게 발췌해 한 번에 돌려줍니다. 여러 문서를 묶어 요약할 때 씁니다.

Inputs: paths (required), char_budget. Returns: stage, status, included, documents, +6 more

list_rootsA
Read-only

이 서버가 읽을 수 있는 폴더, 저장 위치, 지원 형식과 한도를 확인합니다. 다른 도구를 부르기 전에 먼저 호출하세요.

Inputs: no named parameters. Returns: roots, stage, limits, status, +4 more

outline_documentA
Read-only

문서를 열어 구조(구역·제목·분량)와 키워드를 돌려줍니다. 전문을 읽기 전에 어디를 읽을지 고를 때 씁니다.

Inputs: path (required), keypoint_limit. Returns: kind, path, stage, status, +9 more

preview_organizeA
Read-only

문서를 어떤 폴더로 나눌지 계획만 만들어 보여줍니다. 파일을 전혀 건드리지 않습니다.

Inputs: target_dir (required), kinds, limit, folder, +3 more. Returns: plan, stage, total, status, +9 more

preview_save_summaryA
Read-only

요약문을 저장하기 전에 최종 파일 경로와 내용을 미리 보여주고 승인 토큰을 발급합니다. 파일을 쓰지 않습니다.

Inputs: title (required), sources (required), summary_markdown (required), note, +1 more. Returns: stage, status, reminder, target_path, +5 more

read_documentA
Read-only

문서 본문을 텍스트로 읽습니다. 구역 라벨([p.3], [슬라이드 2] 등)이 함께 붙어 요약에 근거를 달 수 있습니다.

Inputs: path (required), max_chars, start_char, only_labels. Returns: kind, path, text, stage, +8 more

save_summaryA

사용자가 승인한 요약을 출력 폴더에 저장합니다. preview_save_summary의 토큰이 필요합니다.

Inputs: title (required), sources (required), approval_token (required), summary_markdown (required), +2 more. Returns: path, bytes, stage, status, +2 more

scan_documentsA
Read-only

허용 폴더를 훑어 문서 목록을 최근 수정순으로 돌려줍니다. 파일 내용은 읽지 않습니다.

Inputs: kinds, limit, folder, name_pattern, +1 more. Returns: count, files, stage, stats, +3 more

search_documentsB
Read-only

여러 문서의 본문을 실제로 열어 검색어를 찾고, 주변 문장을 근거 스니펫으로 돌려줍니다.

Inputs: query (required), kinds, folder, max_files. Returns: hits, count, query, stage, +4 more

undo_last_organizeA
Destructive

가장 최근(또는 지정한) 정리 실행을 되돌립니다. 복사본은 지우지 않고 _trash 폴더로 옮깁니다.

Inputs: journal_path. Returns: mode, stage, status, journal, +4 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: listing roots, scanning, outlining, reading, searching, bundling summaries, preview/save summaries, preview/apply organize, and undo. No two tools appear to overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., list_roots, scan_documents, preview_organize). Even compound verbs like preview_save_summary maintain the pattern.

    Tool Count5/5

    11 tools is well-scoped for a local docs management server, covering read, search, summarize, save, and organize workflows without bloat. Each tool earns its place in the workflow.

    Completeness5/5

    The tool surface covers the full lifecycle for reading and managing documents: listing, scanning, outlining, reading, searching, bundling, saving summaries with preview, organizing with preview and apply, and undo for corrections. No obvious dead ends or missing operations for the stated purpose.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with local documents (PDF, Markdown, TXT) through tools for discovery, reading, extraction, summarization, comparison, keyword extraction, search, and analysis, ensuring privacy and offline capability.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables local folder analysis of unstructured documents (PDF, DOCX, PPTX, TXT, SVG, PNG, CSV, XLSX) by extracting structure, reading content, and generating reports, with a strict approval gate before any save operation.
      -
    • F
      license
      A
      quality
      C
      maintenance
      Enables read-only scanning and text extraction from PDF, DOCX, PPTX, SVG, and PNG files in a local folder, providing the raw text to AI models for summarization or analysis without an external LLM API.
      5
      -