filesystem-rag-mcp
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., "@filesystem-rag-mcp search my documents for the meeting notes about Q3 planning"
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.
filesystem-rag-mcp
Local filesystem RAG MCP server combining vector/semantic search and full-text (BM25) search over files. Compliant with MCP spec 2026-07-28 / 2026-07-29, supporting both stdio and http (Streamable HTTP) transports, along with OAuth 2.1 authentication and Dynamic Client Registration (RFC 7591).
Features
MCP Protocol Conformance: Built against MCP specification 2026-07-28 (
mcp[cli]>=1.21.0), supporting tool calling, resources (fs://stats,fs://config), and prompts (rag_query).Universal File to Markdown Conversion:
Converts virtually any file type to clean, informative Markdown on demand:
Documents & Office: PDF, Word (DOCX/DOC), PowerPoint (PPTX/PPT), Excel (XLSX/XLS), RTF, EPUB.
Notebooks & Code: Jupyter Notebooks (
.ipynb) with inputs/outputs/markdown, Python, JavaScript, TypeScript, Rust, Go, C/C++, Java, Shell, etc.Structured Data: JSON, JSONL, YAML, TOML, XML, CSV, TSV, SQL.
Databases: SQLite (
.sqlite,.db,.sqlite3) with schema extraction and row previews.Archives: ZIP, TAR, TGZ manifests and directory listings.
Media & Audio: MP3, WAV, FLAC, OGG, M4A with metadata tags (ID3, Vorbis) and audio stream properties.
Images: Dimensions, format, color mode, and EXIF camera metadata.
Emails:
.emland RFC 822 messages with headers, body parts, and attachment lists.Binary & Firmware: Formatted hexdump summaries with embedded printable ASCII string extraction.
Deep Content-Type Detection:
Integrates Google Magika AI and magic byte inspection so files are classified and converted accurately regardless of extension or missing extensions.
Dual Transports:
stdio: Standard input/output transport for local desktop assistants and CLI hosts (Claude Desktop, Hermes, etc.).http: Modern Streamable HTTP transport for remote and web deployments.
Hybrid Search Architecture:
Full-Text: Fast embedded BM25 search via Whoosh with field boosting and prefix matching.
Vector / Semantic: Embedded ChromaDB with sentence-transformers embedding generation.
Reciprocal Rank Fusion (RRF): Merges sparse full-text and dense semantic scores without manual hyperparameter tuning.
OAuth 2.1 & Dynamic Client Registration (RFC 7591):
Supports RFC 7591 DCR (
/register) to dynamically onboard MCP clients.PKCE S256 code challenge verification.
RFC 8414 Authorization Server Metadata (
/.well-known/oauth-authorization-server).Protected Resource Metadata (
/.well-known/oauth-protected-resource).Strict Bearer token verification using cryptographic JWTs.
Path Security:
Directory traversal prevention (
.., path symlink escapes).Configurable inclusion/exclusion glob patterns.
Related MCP server: mcp-local-rag
Installation
Using uv:
git clone https://github.com/freyajeffers/filesystem-rag-mcp.git
cd filesystem-rag-mcp
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"Running the Server
Stdio Transport (Default)
Ideal for desktop clients like Claude Desktop:
filesystem-rag-mcp --transport stdio --root-dir /path/to/my/documentsStreamable HTTP Transport with OAuth 2.1
filesystem-rag-mcp --transport http --host 127.0.0.1 --port 8000 --root-dir /path/to/my/documentsStreamable HTTP Transport without Auth (Dev Mode)
filesystem-rag-mcp --transport http --no-auth --host 127.0.0.1 --port 8000 --root-dir /path/to/my/documentsAvailable MCP Tools
ping:Rapid health check and liveness probe verifying server connectivity, version, and active workspaces.
search:Query parameters:
query(string, required): Natural language search query or keywords.mode(string, default: "hybrid"):hybrid,fulltext, orsemantic.top_k(integer, default: 10): Maximum number of search hits.alpha(float, default: 0.5): Weighting between full-text (0.0) and vector (1.0).path_glob(string, optional): Glob pattern (e.g.src/**/*.py,docs/*.md) to filter search hits.rerank(boolean, default: false): Apply neural cross-encoder reranking (FlashRank) over top candidates.fuzzy(boolean, default: false): Enable typo-tolerant fuzzy matching / query term expansion for misspelled terms.wait_for_indexing(boolean, default: false): Iffalse, immediately executes searches using whatever index is currently available without blocking caller; iftrue, waits for background thorough indexing to complete.
Returns ranked search hits with match scores, source indexes, contextual snippets, and an
index_stateobject notifying the caller of background indexing progress.
grep_search:Fast, sandboxed regex or exact substring search across files with line numbers and context lines.
read_files_batch:Concurrently reads and converts multiple files in a single tool call.
refresh_file:Incrementally re-indexes a single file in
<50mswithout global disk traversal.
get_chunk_context:Retrieves preceding and succeeding chunk neighbors around a given
chunk_id.
deep_search:Multi-hop search decomposing complex queries across topics and sub-queries with deduplicated chunk aggregation.
pack_context:Assembles a clean, token-bounded Markdown prompt bundle (e.g. 4000 tokens) with contiguous chunk stitching.
get_corpus_graph:Generates an architectural dependency and reference topology graph identifying system hubs and orphans.
git_search:Safe local git inspection: commit history, diffs, and line-by-line blame without shell execution.
search_symbols:Fast AST/regex extraction of function and class declarations across Python, JS/TS, and generic code.
find_symbol_references:Finds call-sites, imports, and usages of symbols across workspace files with line numbers and snippet context.
patch_file:Atomically patches files with exact substring replacement, sandboxed path validation, dry-run support, and immediate $<50\text{ms}$ incremental re-indexing.
add_workspace/list_workspaces:Multi-root and monorepo scoping to register and search across multiple project paths dynamically.
list_directory:Sandboxed tree/directory exploration tool.
Parameters:
rel_path(string, default: ""): Target folder inside workspace root.max_depth(integer, default: 2): Traversal depth limit.pattern(string, optional): Glob pattern filter for entries.include_files(boolean, default: true): Include file entries.include_dirs(boolean, default: true): Include directory entries.limit(integer, default: 150): Maximum entries returned.
Returns file metadata, sizes, detected MIME/format labels, and convertibility flags.
get_index_status:Query parameters:
wait(boolean, default: false): Iftrue, synchronously waits for background indexing to finish before returning.timeout_seconds(float, default: 30.0): Maximum duration to wait.
Returns live indexing status, indicating whether quick or thorough indexes are running or ready, plus chunk counts and timestamps.
fetch_targeted_data:Fine-grained, targeted data extraction from structured and tabular files:
SQLite: Execute read-only SQL queries via
queryparameter (e.g.SELECT id, name FROM users WHERE active=1).JSON / JSONL: Query paths via
queryparameter (e.g.users[0].address.cityorconfig.database).CSV / TSV: Select specific columns, apply row offsets/limits, and value match filters.
Text / Code: Extract exact line ranges via
start_lineandend_line.
read_file_markdown:Automatically converts diverse document and data formats (PDF, DOCX, PPTX, XLSX, HTML, IPYNB, CSV, RTF, JSON, YAML, TOML, XML, code) to clean Markdown.
Returns
{ "rel_path", "abs_path", "markdown", "length_chars" }.
download_file_raw:Downloads binary or text files as base64 with auto-detected MIME type and size headers.
Returns
{ "rel_path", "abs_path", "mime_type", "total_size_bytes", "returned_size_bytes", "truncated", "base64_data" }.
read_file:Read plain text files with optional byte truncation.
get_chunk:Inspect full chunk contents by ID.
refresh_index:Force re-indexing of documents and chunk caching.
Configuration Generator & Presets
Generate ready-to-paste JSON client configs directly from the CLI:
# Print configs for Claude Desktop, Zed, and Hermes
filesystem-rag-mcp --config-snippet all
# Specific targets:
filesystem-rag-mcp --config-snippet claude
filesystem-rag-mcp --config-snippet zed
filesystem-rag-mcp --config-snippet hermesSystem Diagnostics (--doctor)
Run immediate environment and health verification to check Python version, directories, core dependencies, optional document converters, and system tools:
# Interactive diagnostic output with checkmarks and suggestions
filesystem-rag-mcp --doctor
# Machine-readable JSON output for automated health probes
filesystem-rag-mcp --doctor --jsonOperational & Performance Guards
Offline / Air-Gapped Mode: Use
--offline/FSRAG_OFFLINE_MODE=1to disable outbound HuggingFace network requests and operate strictly on cached weights.Large File Protection:
max_convert_file_bytes(default: 50MB) prevents OOM crashes on huge files by safely providing leading stream extracts.Vector Binary Exclusion: By default, raw binary files falling back to hexdumps are indexed in BM25 full-text search but excluded from dense vector embeddings (
index_binary_vectors=False) to avoid noise in vector similarity space.Graceful Shutdown: Process termination cleanups are registered with
atexitto flush persistent indexes and release file watcher threads cleanly.
Developer Workflow
Use the provided Makefile for standardized development, testing, and linting tasks:
make help # Show all available development commands
make install # Set up virtual environment and install in editable mode
make lint # Run ruff lint checks
make format # Format codebase with ruff
make typecheck # Strict static type analysis with mypy
make test # Run pytest test suite
make ci # Run full local CI gate (format, lint, mypy, pytest)
make doctor # Run environment diagnostic checksLicense
MIT
Available Tools
23 toolsadd_workspaceC
Register an additional workspace directory for multi-root monorepos or polyrepos.
Inputs: name (required), path (required). Returns: object
deep_searchBRead-only
Multi-hop search decomposing complex research questions across multiple topics/files. Runs parallel subquery searches, clusters findings, and merges deduplicated chunks.
Inputs: query (required), alpha, rerank, sub_queries, +1 more. Returns: object
download_file_rawBRead-only
Download/read a raw file as base64-encoded bytes with MIME type. Suitable for downloading binary files, images, PDFs, etc. Validated against root.
Inputs: rel_path (required), max_bytes. Returns: object
fetch_targeted_dataA
Execute targeted data fetching against structured files. Supports:
SQLite: SQL query via
queryparameter (e.g. 'SELECT * FROM users WHERE role="Admin"')JSON/JSONL: path expression via
queryparameter (e.g. 'users[0].email' or 'config.db')CSV/TSV: column filtering, row offsets/limits, and value match filters
Text/Code: line range extraction via
start_lineandend_lineparameters.
Inputs: rel_path (required), query, columns, end_line, +5 more. Returns: object
find_symbol_referencesBRead-only
Find call-sites, imports, and usages of a specific symbol across workspace code files. Returns occurrences with file paths, line numbers, usage classification ('import' vs 'reference'), and snippets.
Inputs: symbol_name (required), sub_dir, path_glob, workspace, +1 more. Returns: object
get_chunkBRead-only
Fetch a single chunk by its id. Returns the chunk text and metadata.
Inputs: chunk_id (required). Returns: object
get_chunk_contextBRead-only
Fetch contextual neighbor chunks surrounding a chunk_id from the same file. Expands awareness of the document before and after a search hit.
Inputs: chunk_id (required), after_chunks, before_chunks. Returns: object
get_corpus_graphBRead-only
Construct an architectural dependency and reference topology graph of the workspace. Detects central architectural hubs (highest in-degree), file dependencies, and orphan files.
Inputs: sub_dir, max_files. Returns: object
get_index_statusA
Inspect the live indexing state: background quick/thorough task status, indexed text and vector chunk counts, and completion timestamps. Set wait=True and optional timeout_seconds to synchronously await index completion.
Inputs: wait, timeout_seconds. Returns: object
git_searchBRead-only
Inspect git commit logs, recent changes, commit diffs, or line blame across repository files. Modes: 'commits', 'recent_changes', 'diff', 'blame'.
Inputs: mode, limit, query, line_end, +2 more. Returns: object
grep_searchBRead-only
Exact regex or substring search across files in the workspace. Returns matching lines with context lines, line numbers, and file paths. Supports path_glob filtering (e.g. 'src/**/*.py') and case sensitivity.
Inputs: pattern (required), sub_dir, path_glob, workspace, +3 more. Returns: object
list_directoryCRead-only
Explore the sandboxed filesystem tree. Returns directory/file metadata including size, detected MIME/type, conversion support, and relative path. Supports depth and glob filtering.
Inputs: limit, pattern, rel_path, max_depth, +3 more. Returns: object
list_workspacesARead-only
List all registered workspace roots and their status.
Inputs: no named parameters. Returns: object
pack_contextARead-only
Assemble a clean, token-bounded Markdown prompt context pack from search hits. Groups contiguous chunks by file, dedupes, and trims to strict token budgets (e.g. 4000 tokens).
Inputs: query (required), alpha, rerank, path_glob, +2 more. Returns: object
patch_fileA
Atomically patch a sandboxed file in the workspace by replacing an exact substring with new content. Automatically triggers immediate incremental re-indexing (<50ms) upon successful edit.
Inputs: rel_path (required), new_string (required), old_string (required), dry_run, +2 more. Returns: object
pingARead-only
Health check and liveness probe verifying server connectivity and runtime readiness.
Inputs: no named parameters. Returns: object
read_fileARead-only
Read a file's contents from the configured root. The path is validated against the root; symlinks that escape are refused.
Inputs: rel_path (required), max_bytes. Returns: object
read_file_markdownBRead-only
Convert any document (PDF, DOCX, PPTX, XLSX, HTML, IPYNB, CSV, RTF, JSON, YAML, text, code) to clean Markdown. Validated against root.
Inputs: rel_path (required). Returns: object
read_files_batchARead-only
Inspect multiple files concurrently in a single roundtrip. Returns a mapping of relative paths to contents or structured error objects. Supports Markdown conversion (as_markdown=True) or raw text.
Inputs: rel_paths (required), as_markdown, max_bytes_per_file. Returns: object
refresh_fileB
Incrementally (re-)chunk and re-index a single specific file into full-text and vector stores in <50ms without walking the rest of the workspace.
Inputs: rel_path (required). Returns: object
refresh_indexA
Walk the configured root directory, (re-)chunk every text file, and (re-)embed + index all chunks. Safe to call repeatedly; stale chunks are evicted. May be slow on large corpora.
Inputs: full_rebuild. Returns: object
searchARead-only
Hybrid full-text + vector search over the indexed filesystem. Returns the top-k most relevant chunks with their file path, character offset range, and a snippet of text. Does NOT block on background indexing by default; immediately searches what is currently available and reports index completeness. Set wait_for_indexing=True to explicitly wait until thorough indexing finishes. Set compact=True to omit large chunk text and preserve context budget.
Inputs: query (required), alpha, fuzzy, top_k, +4 more. Returns: object
search_symbolsBRead-only
Search for function and class declarations/definitions across Python, JS/TS, and generic code. Returns symbol names, lines, parameters, and docstrings without full text scanning.
Inputs: name, sub_dir, path_glob, workspace, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have clearly distinct purposes (search=hybrid semantic, grep_search=regex, search_symbols=declarations, find_symbol_references=usages, deep_search=multi-hop). There is mild overlap in the read family (read_file, read_file_markdown, download_file_raw, read_files_batch) and between refresh_index/refresh_file, but descriptions differentiate scope and format well.
Predominantly consistent snake_case with a verb_noun pattern (get_chunk, read_file, add_workspace, list_workspaces, refresh_index). A few deviations break the pattern: 'ping' is a bare verb, and git_search/grep_search use noun_verb ordering, but overall the convention is predictable.
23 tools sits in the heavy band for a single server. The domain is genuinely broad (search, indexing, git, multi-format reads, workspaces, graph analysis), so most tools earn their place, but several closely related read/search variants push it toward over-scoped.
Coverage of the RAG/filesystem lifecycle is strong: indexing, refresh (full and incremental), hybrid/regex/symbol search, chunk navigation, multi-format reads, git inspection, and workspace management are all present. The notable gap is write operations—only patch_file exists, with no create/delete file, limiting mutation workflows.
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Your personal library, readable by AI agents: durable snapshots, hybrid search, 46 MCP tools.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.4-
- AlicenseAqualityDmaintenanceMCP server that enables local hybrid semantic and keyword search over private PDF, DOCX, Markdown, and text documents without sending data to embedding APIs.9MIT
- AlicenseBqualityBmaintenanceEnables local hybrid search over Obsidian and Markdown vaults via MCP, combining vector retrieval, full-text search, reranking, graph navigation, and safe CRUD while keeping data local.431MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables fast local hybrid search over a folder of markdown files via MCP, combining BM25 and vector similarity with explicit relevance verdicts and no LLM or network calls at query time.1-