Labsco
andrea9293 logo

MCP Documentation Server

β˜… 335

from andrea9293

A server for document management and semantic search using AI embeddings, with local JSON storage.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

MCP Documentation Server

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

  • πŸ” Hybrid search β€” full-text + vector similarity with parent-child chunking

  • πŸ€– Optional AI search β€” Google Gemini for advanced document analysis (bring your own key)

  • πŸ“ Drag & drop uploads β€” .txt, .md, .pdf support

  • πŸ“¦ Published on the MCP Registry β€” installable via npx, no clone needed

Web UI

The web interface starts automatically on port 3080 when the MCP server launches. From the web UI you can:

  • πŸ“Š Dashboard β€” overview of all documents and stats

  • πŸ“„ Documents β€” browse, view, and delete documents

  • βž• Add Document β€” create documents with title, content, and metadata

  • πŸ” Search All β€” semantic search across all documents

  • 🎯 Search in Doc β€” search within a specific document

  • πŸ€– AI Search β€” Gemini-powered analysis (if GEMINI_API_KEY is set)

  • πŸ“ Upload Files β€” drag & drop files and process them into the knowledge base

  • πŸͺŸ Context Window β€” explore chunks around a specific index

Configure an MCP client

Minimal

Copy & paste β€” that's it
{
 "mcpServers": {
 "documentation": {
 "command": "npx",
 "args": ["-y", "@andrea9293/mcp-documentation-server"]
 }
 }
}

With environment variables (all optional)

Copy & paste β€” that's it
{
 "mcpServers": {
 "documentation": {
 "command": "npx",
 "args": ["-y", "@andrea9293/mcp-documentation-server"],
 "env": {
 "MCP_BASE_DIR": "/path/to/workspace",
 "GEMINI_API_KEY": "your-api-key-here",
 "MCP_EMBEDDING_MODEL": "Xenova/all-MiniLM-L6-v2",
 "START_WEB_UI": "true",
 "WEB_HOST": "127.0.0.1",
 "WEB_PORT": "3080"
 }
 }
 }
}

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)

Architecture

Copy & paste β€” that's it
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

Copy & paste β€” that's it
git clone https://github.com/andrea9293/mcp-documentation-server.git
cd mcp-documentation-server
npm install
Copy & paste β€” that's it
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

  • Follow Conventional Commits for messages

  • Open a pull request

License

MIT β€” see LICENSE

Support

Star History

Built with FastMCP, Orama, and TypeScript