MCP Documentation Server

MCP Documentation Server

Enables AI agents to manage, upload, chunk, and semantically search local documents through MCP tools and a REST API, with a built-in web dashboard and optional Gemini-powered AI search.

Category
Visit Server

README

MCP Registry npm version GitHub Stars Ask DeepWiki

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

Quick Start

{
  "mcpServers": {
    "documentation": {
      "command": "npx",
      "args": ["-y", "@Unity-Billal-mesloub/mcp-documentation-server"]
    }
  }
}

šŸ¤– Agent Skill (REST API) — recommended for AI agents

Every MCP tool is also accessible via the REST API on ``. 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.


  -H "Content-Type: application/json" \
  -d '{"query": "your search", "limit": 5}'

A ready-to-use skill is included at skills/documentation-server/SKILL.md — it teaches your agent every endpoint with examples. Install it:

npx skills add https://github.com/Unity-Billal-mesloub/mcp-documentation-server --skill documentation-server

Basic workflow

  1. Add documents using add_document or place .txt / .md / .pdf files in the uploads folder and call process_uploads.
  2. Search across everything with search_all_documents, or within a single document with search_documents.
  3. Use get_context_window to fetch neighboring chunks and give the LLM broader context.

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

{
  "mcpServers": {
    "documentation": {
      "command": "npx",
      "args": ["-y", "@Unity-Billal-mesloub/mcp-documentation-server"]
    }
  }
}

With environment variables (all optional)

{
  "mcpServers": {
    "documentation": {
      "command": "npx",
      "args": ["-y", "@Unity-Billal-mesloub/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)

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

~/.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

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

git clone https://github.com/Unity-Billal-mesloub/mcp-documentation-server.git
cd mcp-documentation-server
npm install
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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/name
  3. Follow Conventional Commits for messages
  4. Open a pull request

Support


Star History

Star History Chart

Built with FastMCP, Orama, and TypeScript

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured