mcp-local-rag
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_PATH | No | Vector database path. | ./lancedb/ |
| BASE_DIR | No | Document root (security boundary). The folder you want to search. | cwd |
| BASE_DIRS | No | JSON array of roots, overrides BASE_DIR. Example: '["/path1","/path2"]' | |
| CACHE_DIR | No | Model cache directory. Recommend absolute path. | ./models/ |
| RAG_DTYPE | No | Quantization precision (fp32/fp16/q8). | fp32 |
| RAG_WATCH | No | File watching (true/1 enables). | |
| MODEL_NAME | No | HuggingFace model ID for embeddings. | all-MiniLM-L6-v2 |
| RAG_DEVICE | No | ONNX execution device (cpu or webgpu). | cpu |
| HF_ENDPOINT | No | Manual mirror override for HuggingFace. | huggingface.co |
| HTTPS_PROXY | No | Model download proxy. Example: http://127.0.0.1:7890 | |
| RAG_GROUPING | No | Grouping strategy: 'similar' or 'related'. | |
| MAX_FILE_SIZE | No | Max file size in bytes. | 100 |
| RAG_MAX_FILES | No | Limit results to top N files. | |
| HF_AUTO_MIRROR | No | Auto-detection of mirror (true/1 enables, false disables). | true |
| CHUNK_MIN_LENGTH | No | Minimum chunk length (1–10000 characters). | 50 |
| RAG_MAX_DISTANCE | No | Maximum distance threshold for search results. | |
| RAG_HYBRID_WEIGHT | No | Keyword boost weight: 0 = semantic only, 1 = keyword only. | 0.6 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| query_documentsA | Search ingested documents with hybrid keyword + semantic matching. Returns results sorted by relevance, each with filePath, chunkIndex, text, fileTitle, score (0 = best, higher = worse), and source (for ingest_data items). |
| ingest_fileA | Ingest a document file (PDF, DOCX, TXT, MD) into the vector database. Path must be absolute; re-ingesting the same path replaces its existing data. Returns { filePath, chunkCount, timestamp, fileTitle }. |
| ingest_dataA | Ingest in-memory content as a string (use ingest_file for files on disk). The source identifier enables re-ingestion to update existing content. Returns { filePath, chunkCount, timestamp, fileTitle }. |
| delete_fileA | Delete a previously ingested file or data from the vector database. Use filePath for files ingested via ingest_file, or source for data ingested via ingest_data. Either filePath or source must be provided. Returns deleted (operation succeeded), removedChunks, and existed (whether anything was actually present). |
| list_filesA | List supported files (PDF, DOCX, TXT, MD) under the configured base directories and whether each is ingested. Returns { baseDirs, files, sources }; sources lists ingested items reported apart from the file scan, chiefly ingest_data content (web pages, clipboard, etc.). |
| statusA | Get index status: { documentCount, chunkCount, memoryUsage (MB), uptime (s), ftsIndexEnabled, searchMode, instances }. When multiple instances are configured, pass instance name for per-instance status. |
| read_chunk_neighborsA | Read the chunks immediately before and after a query_documents result, in the same document, for more surrounding context. Pass chunkIndex from the result plus exactly one of filePath (ingest_file) or source (ingest_data). Returns the target chunk (isTarget: true) and its neighbors, ascending by chunkIndex; an out-of-range chunkIndex returns []. Defaults: before=2, after=2 (max 50 each). |
| ingest_directoryA | Batch ingest all supported files in a directory. Recursively scans for code and document files under the given path, ingesting each one with AST-level (code) / semantic chunking. Returns per-file status plus totals. Use this for initial bulk ingestion or after deleting the database. |
| reindex_staleA | Re-ingest all files whose disk contents have changed since the last ingestion (detected via mtime comparison). Returns the count of stale files that were re-ingested. Use when you know files have been modified but the index is out of date. |
| reindex_allA | Re-ingest ALL indexed files from scratch. Delete existing chunks, then re-ingest every previously-indexed file. Use after changing the embedding model, chunker parameters, or when the index is corrupted. This is a slow, destructive operation — prefer reindex_stale for routine updates. |
| configA | Read or update runtime configuration. Without arguments, returns current config (hybridWeight, maxDistance, maxFiles, grouping). With arguments, updates the specified keys and returns the new config. Changes take effect immediately — no restart required. |
| export_indexA | Export the current index to a JSON file for backup or migration. Returns the export file path and stats (document count, chunk count, file size). The exported file can be re-imported with a future import_index tool. |
| dedup_checkA | Detect near-duplicate documents in the index by computing content hashes for every chunk. Returns file pairs with high chunk overlap, sorted by similarity. Use to identify accidentally duplicated or re-ingested content. |
| find_definitionA | Find where a symbol (function, class, variable, etc.) is defined in code files. Searches AST-level entity metadata extracted during code chunking. Returns { totalMatches, matches: [{ filePath, chunkIndex, entityName, entityType, lineRange?, scope? }] }. Only works for code files that were ingested with AST-level chunking (CodeChunker). |
| find_referencesA | Find all references to a symbol across ingested code files using a two-phase strategy: (1) import metadata scan for exact import name matches, (2) FTS text search for in-code mentions. Results merge with import references first, deduplicated by (filePath, chunkIndex). Returns { totalMatches, matches: [{ filePath, chunkIndex, referenceType, context?, importSource?, isDefault?, isNamespace? }] }. Only works for code files ingested with AST-level chunking. |
| health_checkA | Diagnose server health and configuration. Checks embedder (model loaded?), LanceDB (readable?), BASE_DIRs (reachable on disk?), and cache directory (writable?). Returns structured pass/fail results with a human-readable summary and per-check fix suggestions for any failures. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/damoqiongqiu/mcp-local-rag'
If you have feedback or need assistance with the MCP directory API, please join our Discord server