file-insight-mcp
Click on "Install 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., "@file-insight-mcpScan the sample docs folder and generate a summary report."
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.
File Analysis MCP (file-insight-mcp)
A personal local MCP server that reads unstructured documents in a specified folder, analyzes their structure, and writes per-document summaries and a folder-wide summary report.
All documents in this package's
data/sample_docs/are synthetic data created for demo purposes.
References
Server structure (FastMCP, stdio, multi-MCP server composition): https://github.com/kyopark2014/mcp
Harness conventions (step-by-step stage/next_actions, grounding anchors, approval boundaries): reuses the approach established in the related
personal-meeting-mcp-trainingprojectHarness engineering principles list: https://github.com/walkinglabs/awesome-harness-engineering (context budget, pre-approval hooks, deterministic eval, and static safety scanner items selectively applied at this project's scale)
MCP Python SDK: https://github.com/modelcontextprotocol/python-sdk
Related MCP server: file-analyzer
What this server does
Scans the structure of a fixed target folder (
data/sample_docs/).Reads only documents with allowed extensions (
.txt .md .csv .log).Extracts table of contents (heading structure), dates, numbers, and key term candidates from documents using rule-based logic.
Builds a combined summary prompt from all documents. The summary itself is written by the host LLM (Claude/Codex); this MCP does not call any LLM API.
Validates the structure of the written summary report and cross-checks that mentioned filenames actually exist.
Saves the report to a file only after the user explicitly approves.
Quick start
Required environment: Python 3.11 or later, uv
uv sync --extra devAfter installation, verify that all four commands in the Verification section below pass.
To visually inspect the tools with MCP Inspector:
uv run mcp dev src/file_insight_mcp/server.pyProject structure
Domain logic and tool conventions are separated so that changing validation rules does not require touching the tool layer.
Path | Role |
| Path safety checks, extension allowlist, size and item count limits |
| Folder scan, document reading, report structure validation, approval-based saving |
| Table of contents, date, number, and key term extraction (rule-based, deterministic) |
| Cross-checking filenames mentioned in summaries (advisory check) |
| Common tool convention elements — |
| MCP tool, resource, and prompt registration (harness layer) |
| Pure logic for path expressions, verdicts, and variable substitution in eval cases |
| Deterministic regression cases (data, not code) |
| Runner that executes cases over the actual MCP protocol |
| STDIO startup, schema, and harness convention smoke test |
| Pre-release static checks (credentials, dangerous calls, tool annotations) |
| Domain function unit tests (run without starting the server) |
Recommended flow
SCAN → LIST → READ → EXTRACT → DRAFT → CHECK → PREVIEW → [사용자 승인] → SAVEDStep | Tool | Read/Write | Role |
SCAN |
| Read | Target folder structure, per-extension counts, allowed status |
LIST |
| Read | List of documents that can actually be read |
READ |
| Read | View source text. Supports line range specification and |
EXTRACT |
| Read | Extract table of contents (heading/numbering) structure |
EXTRACT |
| Read | Extract key term candidates based on dates, numbers, and frequency |
DRAFT |
| Read | Generate a prompt combining all documents + the standard report format |
CHECK |
| Read | Structure validation. Provides |
CHECK |
| Read | Cross-check that filenames mentioned in the summary actually exist (advisory, does not block saving) |
PREVIEW |
| Read | Check differences against the previously saved version |
PREVIEW |
| Read | Shows validation and diff together and issues an approval token |
SAVED |
| Write | Saves only when the approval token matches (the only write tool) |
OBSERVE |
| Read | List of saved reports |
OBSERVE |
| Read | View the save audit log |
Resources and prompts
Type | URI or name | Role |
Resource |
| Document source text |
Resource |
| Saved summary report |
Prompt |
| Analysis workflow from scan to save approval |
Harness design
This server treats not only functionality but also the way the model uses tools as a design target.
Every response includes
stageandnext_actions, so the model can choose the next tool from the response alone.blocking: trueis a guidance hint meaning "do not skip this step." What actually blocks saving is structure validation and the approval token; the hint does not take over that role.Errors are returned as
ToolFailurewith a cause code, recovery method, and selectable values. The goal is to let the model recover on its own without asking again.Argument schemas are kept flat (
{"relative_path": "..."}). Using Pydantic models as argument types would nest them as{"params": {...}}and change the call shape.Return values are Pydantic models, so
outputSchemais generated automatically.Every tool has
readOnlyHint/destructiveHintso the host can show a different approval UI for write tools.Only certain checks (structure) block saving; heuristic checks (filename cross-check) are reported as warnings only.
Context budget
Following the principle that "the context window is not a dumping ground but a working-memory budget," every tool has an explicit cap on response size.
scan_folder_structure: IfMAX_SCAN_ENTRIES(500) is exceeded, it reportstruncated: trueand truncates.read_document: Files larger thanMAX_FILE_BYTES(200KB) are not read in full; instead, an error guides the caller to read only part of the file viaread_document_chunk.extract_key_terms: Limits the number of items per category withmax_terms.preview_save_report:include_preview=Falseis the default, so a draft the model already has is not included in the response again. When it must be included,max_preview_charslimits the length.harness.truncate()/harness.number_lines(): Always makes truncation status and citation anchors (line numbers) explicit so the model does not have to guess whether "this is the whole thing or part of it."
Safety boundaries
The server only handles
security.TARGET_DIR(data/sample_docs/). It cannot access anything outside that directory via.., absolute paths, drive letters, or symbolic links (security.safe_relative_path).Files outside the extension allowlist (
.txt .md .csv .log) are not read. Executable/script extensions are always excluded from targets.If a file exceeds
MAX_FILE_BYTES(200KB), it is not read in full; an error guides the caller instead.Hidden files and folders whose names start with
.are excluded from scanning.The only write tool is
save_approved_report, which works only when the (report_id, body) hash token issued bypreview_save_reportmatches.This server only reads documents. If code or shell execution calls such as
eval/exec/subprocessappear in the source,scripts/validate_package.pyfails.
Verification
uv run pytest -q
uv run python scripts/smoke_stdio.py
uv run python scripts/run_evals.py
uv run python scripts/validate_package.pyThe four commands each check different things, so all of them must pass.
Command | Scope of checks | Server startup |
|
| No |
| Tool registration, schema flatness, annotations, error message conventions | Yes |
| Deterministic regression cases in | Yes |
| Static checks for credential leaks, dangerous calls, tool annotations | No |
run_evals.py includes the full save flow, covering whether saving succeeds or is rejected when the approval token is correct or incorrect. Whenever you fix a bug, add one line to evals/cases.jsonl with a case that reproduces that bug. See evals/README.md for the case syntax.
If you want to analyze a different folder
For safety, this project fixes the target folder to TARGET_DIR in src/file_insight_mcp/security.py (the data/sample_docs/ inside the package). To analyze a real work folder:
Change
TARGET_DIRto the desired absolute path, or modify it to be injected via an environment variable.Reflect the extensions that actually exist in that folder in
ALLOWED_EXTENSIONS.First check that there are no sensitive subfolders (credentials, personal information, etc.).
Claude Desktop connection
Replace ABSOLUTE_PROJECT_PATH in config/claude_desktop_config.example.json with the absolute path of this folder, then apply it to the Claude Desktop configuration. You must fully quit the app and relaunch it.
Design principles
The MCP does not call any separate LLM API. Claude or Codex writes the summary sentences; this MCP handles the source text, structure, validation, and saving.
It never fabricates filenames, numbers, or dates not confirmed in the documents; the grounding checker mechanically cross-checks them.
Final saving requires both the approval token issued at preview and the user's explicit approval.
Domain logic (
core,outline,grounding) is separated from tool conventions (server,harness,security).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables real-time indexing and semantic search of local documents (PDF, Word, text, Markdown, RTF) using vector embeddings and local LLMs. Monitors folders for changes and provides natural language search capabilities through Claude Desktop integration.22MIT
- FlicenseAqualityCmaintenanceEnables read-only analysis of local unstructured documents by scanning a folder, extracting text and structural metadata, and passing content with truncation and error-awareness to an LLM for summarization.9
- AlicenseAqualityCmaintenanceEnables reading and extracting text from local documents (PDF, Word, Excel, PowerPoint, HWP, Markdown, CSV, etc.) without network access, and provides approval-gated summary saving and file organization.11MIT
- FlicenseAqualityCmaintenanceEnables local analysis of unstructured documents (PDF, DOCX, PPTX, SVG, PNG) by extracting text and structure with citation anchors, and verifies summaries against source material before a human approves saving a report.9
Related MCP Connectors
Convert PDF bank statements into structured transactions, accounts, and balances.
Turn any PDF into structured JSON via AI + OCR: invoices, bank statements, contracts.
LLM chat, text summarization and AI image generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jm333-B/temp_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server