Local-first document management and semantic search for AI coding agents
The Model Context Protocol (MCP) server is a local-first document management and semantic search service for AI coding agents. It is published to the MCP Registry and distributed via npm (shown by the npm version badge). The repository is MIT licensed and is listed under topics including documents, knowledge-base, mcp-server, gemini, and model-context-protocol.
๐ ๏ธ Key Features
Local-first document management
Semantic search for AI coding agents
๐ Use Cases
Retrieve information from a knowledge base during coding assistance
Support agent workflows that use semantic search
โก Developer Benefits
MCP server targeting model-context-protocol integrations
Repository-backed distribution (MCP Registry and npm)
โ ๏ธ Limitations
No tool count or specific MCP tools are provided in the available source excerpt
Local-first document management and semantic search for AI coding agents. No external databases, no cloud APIs, no vendor lock-in.
Unlike other MCP servers that are CLI-only, this one ships with a full web dashboard โ browse, search, upload, and manage your knowledge base from your browser. Every MCP tool is also exposed as a REST API, giving AI agents a lean, schema-free interface.
๐ Runs fully offline โ Orama vector DB with local AI embeddings (Transformers.js)
๐ Built-in Web UI โ starts automatically on port 3080 alongside the MCP server
Open your browser at http://localhost:3080 โ the web UI starts automatically.
๐ค Agent Skill (REST API) โ recommended for AI agents
Every MCP tool is also accessible via the REST API on http://127.0.0.1:3080/api/. This is the recommended way to interact from AI agents (Claude Code, OpenCode, Gemini CLI, Cursor) because it avoids loading MCP tool schemas into the conversation context โ only the response JSON enters.
All environment variables are optional. Without GEMINI_API_KEY, only the local embedding-based search tools are available.
MCP Tools
The server registers the following tools (all validated with Zod schemas):
๐ Document Management
Tool
Description
add_document
Add a document (title, content, optional metadata)
list_documents
List all documents with metadata and content preview
get_document
Retrieve the full content of a document by ID
delete_document
Remove a document, its chunks, database entries, and associated files
๐ File Processing
Tool
Description
process_uploads
Process all files in the uploads folder (chunking + embeddings)
get_uploads_path
Returns the absolute path to the uploads folder
list_uploads_files
Lists files in the uploads folder with size and format info
get_ui_url
Returns the Web UI URL (e.g. http://localhost:3080) โ useful to open the dashboard or to locate the uploads folder from the browser
๐ Search
Tool
Description
search_documents
Semantic vector search within a specific document
search_all_documents
Hybrid (full-text + vector) cross-document search
get_context_window
Returns a window of chunks around a given chunk index
search_documents_with_ai
๐ค AI-powered search using Gemini (requires GEMINI_API_KEY)
Configuration
Configure via environment variables or a .env file in the project root:
Variable
Default
Description
MCP_BASE_DIR
~/.mcp-documentation-server
Base directory for data storage
MCP_EMBEDDING_MODEL
Xenova/all-MiniLM-L6-v2
Embedding model name
GEMINI_API_KEY
โ
Google Gemini API key (enables search_documents_with_ai)
MCP_CACHE_ENABLED
true
Enable/disable LRU embedding cache
START_WEB_UI
true
Set to false to disable the built-in web interface
WEB_HOST
127.0.0.1
Bind address for the web UI (use 0.0.0.0 to expose on all interfaces)
WEB_PORT
3080
Port for the web UI
MCP_STREAMING_ENABLED
true
Enable streaming reads for large files
MCP_STREAM_CHUNK_SIZE
65536
Streaming buffer size in bytes (64KB)
MCP_STREAM_FILE_SIZE_LIMIT
10485760
Threshold to switch to streaming (10MB)
Storage layout
code
~/.mcp-documentation-server/ # Or custom path via MCP_BASE_DIR
โโโ data/
โ โโโ orama-chunks.msp # Orama vector DB (child chunks + embeddings)
โ โโโ orama-docs.msp # Orama document DB (full content + metadata)
โ โโโ orama-parents.msp # Orama parent chunks DB (context sections)
โ โโโ migration-complete.flag # Written after legacy JSON migration
โ โโโ *.md # Markdown copies of documents
โโโ uploads/ # Drop .txt, .md, .pdf files here
Embedding Models
Set via MCP_EMBEDDING_MODEL:
Model
Dimensions
Notes
Xenova/all-MiniLM-L6-v2
384
Default โ fast, good quality
Xenova/paraphrase-multilingual-mpnet-base-v2
768
Recommended โ best quality, multilingual
Models are downloaded on first use (~80โ420 MB). The vector dimension is determined automatically from the provider.
โ ๏ธ Important: Changing the embedding model requires re-adding all documents โ embeddings from different models are incompatible. The Orama database is recreated automatically when the dimension changes.
Architecture
code
Server (FastMCP, stdio)
โโ Web UI (Express, port 3080)
โ โโ REST API โ DocumentManager
โโ MCP Tools
โโ DocumentManager
โโ OramaStore โ Orama vector DB (chunks DB + docs DB + parents DB), persistence, migration
โโ IntelligentChunker โ Parent-child chunking (code, markdown, text, PDF)
โโ EmbeddingProvider โ Local embeddings via @xenova/transformers
โ โโ EmbeddingCache โ LRU in-memory cache
โโ GeminiSearchService โ Optional AI search via Google Gemini
OramaStore manages three Orama instances: one for document metadata/content, one for child chunks with vector embeddings, and one for parent chunks (context sections). All are persisted to binary files on disk and restored on startup.
IntelligentChunker implements the Parent-Child Chunking pattern: documents are first split into large parent chunks that preserve full context (sections, paragraphs), then each parent is further split into small child chunks for precise vector search. At query time, results are deduplicated by parent so that the LLM receives both the matched fragment and the broader context.
EmbeddingProvider lazily loads a Transformers.js model for local inference โ no API calls needed.
Development
bash
git clone https://github.com/andrea9293/mcp-documentation-server.git
cd mcp-documentation-server
npm install
bash
npm run dev # FastMCP dev mode with hot reload
npm run build # TypeScript compilation
npm run inspect # FastMCP web UI for interactive tool testing
npm start # Direct tsx execution (MCP server + web UI)
npm run web # Run only the web UI (development)
npm run web:build # Run only the web UI (compiled)
Contributing
Fork the repository
Create a feature branch: git checkout -b feature/name