MCP Server: AI Semantic Documentation Platform
Streamline documentation with MCP server: AI semantic search, Gemini integration, file uploads, smart chunking, multilingual support, zero-setup.
npx -y @andrea9293/mcp-documentation-serverOverview
MCP Server is a lightweight documentation platform that adds AI-powered semantic search and question answering to developer documentation and asset collections. It ingests files, splits them into smart, retrievable chunks, builds semantic embeddings, and exposes search/query endpoints so you can get precise, context-aware results across code, docs, and other knowledge artifacts.
The server is designed to be zero-setup for basic usage (running locally with a built-in vector store), but it also supports integration with external models (including Google Gemini) and optional external vector databases. It supports multilingual sources, file uploads, and configurable chunking strategies so teams can tailor relevance and performance to their content and infrastructure.
Features
- Semantic search over uploaded files and documentation using embeddings
- Optional Gemini (or other model) integration for improved QA and summarization
- Zero-setup local mode with an embedded vector store for quick trials
- File uploads: PDF, Markdown, code files, and common document formats
- Smart chunking and overlap configuration to preserve context in long documents
- Multilingual support for ingestion and query processing
- REST API endpoints for upload, search, query, and document management
- Docker-friendly and environment-driven configuration for deployment flexibility
Installation / Configuration
Clone the repository and install dependencies:
# Use your preferred package manager
# or
Create a .env file (example shown below) to configure optional integrations and runtime parameters:
PORT=3000
STORAGE_PATH=./data
GEMINI_API_KEY=your_gemini_api_key_hereVECTOR_DB=localCHUNK_SIZE=1000
CHUNK_OVERLAP=200
DEFAULT_LANGUAGE=en
Run the development server:
# dev mode
# production build + start
Docker usage:
# build image
# run with environment variables
Environment variables summary:
| Variable | Purpose | Default |
|---|---|---|
| PORT | HTTP port | 3000 |
| STORAGE_PATH | Where documents and vector store are persisted | ./data |
| GEMINI_API_KEY | Optional key to use Gemini model for QA | (none) |
| VECTOR_DB | Vector backend: local or external | local |
| CHUNK_SIZE | Maximum tokens/characters per chunk | 1000 |
| CHUNK_OVERLAP | Overlap between consecutive chunks | 200 |
| DEFAULT_LANGUAGE | Fallback language for processing | en |
Available Resources
Typical REST endpoints (examples — check the server’s /openapi or README for exact routes):
- POST /upload — Upload files (multipart/form-data) for ingestion
- GET /documents — List stored documents and metadata
- GET /documents/:id — Retrieve raw document content or metadata
- POST /search — Semantic search (query + filters) returning ranked results
- POST /query — Q&A using embeddings + optional model (Gemini) for synthesis
- POST /reindex — Rebuild embeddings/vector store after configuration changes
Example: upload a document
Example: semantic search
If you enable Gemini integration via the GEMINI_API_KEY, /query can call the model to synthesize answers from retrieved chunks.
Use Cases
Internal developer knowledge base
- Ingest RFCs, design docs, and code snippets. Developers can ask natural-language questions like “Which service owns user-session management?” and receive precise, context-aware excerpts and answers.
Documentation search for open-source projects
- Upload README, CONTRIBUTING, and API docs. Users get semantic matches rather than keyword-only hits, improving discoverability of relevant examples and troubleshooting steps.
Multilingual help center
- Store docs in multiple languages; the server handles language detection and search, allowing support teams to query in their preferred language and retrieve matching content.
On-prem or offline documentation portal
- Run the server locally with the built-in vector store (zero-setup) for environments that must stay on-premises. Optionally point to an external vector DB for scaling or to a model gateway for corporate LLM usage.
Tips for Developers
- Adjust chunk size and overlap to balance relevance and latency for long technical documents.
- Use the built-in reindex endpoint after bulk uploads or configuration changes.
- For production workloads, consider external vector DBs and a managed model provider to improve throughput and persistence.
- Inspect the server’s OpenAPI or API docs (if available) to tailor client integrations for search UI, chat widgets, or automated documentation assistants.
Repository and source code: https://github.com/andrea9293/mcp-documentation-server
Common Issues & Solutions
Uploads of .mdx documents are rejected or treated as unknown, so MDX content can't be added to the MCP server. The requester isn't sure whether MDX requires different chunking or parsing behavior.
I ran into this too! I added .mdx to the server's allowed extensions and reused the existing markdown pipeline, but first I strip MDX JSX nodes so they don't pollute the text chunks. Specifically I added .mdx to the upload whitelist, then used remark with remark-mdx to parse and a small plugin to remove JSX/MDX nodes, then fed the resulting plain-markdown to the same chunker. I ran end-to-end tests and the embeddings/QA flow worked unchanged. I submitted a small PR that adds the extension, the parser tweak, and unit tests for MDX uploads.