Serve docs to humans and AI.
Beautiful markdown documentation with native llms.txt support. Zero configuration, production-ready.
Unlike basic markdown servers, servemd is built for the AI era:
Markdown β Beautiful HTML β Humans
β llms.txt β AI/LLMs
β llms-full.txt β Complete AI context
β /mcp endpoint β AI assistants (250x less context)
For humans: Nuxt UI-inspired design, three-column layout, zero configuration. For AI: Native llms.txt support, structured context, ready for the Model Context Protocol era.
- π¨ Beautiful Design β Nuxt UI-inspired three-column layout (sidebar, content, TOC)
- π€ AI-Native β Built-in llms.txt and llms-full.txt for Claude, ChatGPT, Cursor, etc.
- π MCP Support β Model Context Protocol endpoint for interactive AI queries (250x less context)
- β¨ Zero Configuration β Drop
.mdfiles and go - β‘ Fast β Smart disk caching, <5ms cached responses
- π³ Docker Ready β Production-optimized container
- π§ͺ Well Tested β 208 tests, 100% passing
- π± Responsive β Mobile, tablet, and desktop support
pip install servemd# Serve docs from current directory
servemd
# Or specify a directory
servemd ./my-docsVisit http://localhost:8080 β your documentation is live.
Live demo: https://servemd.me.cloudns.cl
# Quick start - mount your docs
docker run -p 8080:8080 -v $(pwd)/docs:/app/__docs__ jberends/servemd:latest
# Or build custom image with docs baked in
FROM jberends/servemd:latest
COPY ./my-docs/ /app/__docs__/See DOCKER_README.md for complete Docker usage guide.
uvx servemd ./my-docsgit clone https://github.com/servemd/servemd
cd servemd
uv sync
uv run python -m docs_serverservemd automatically serves your docs in AI-friendly formats:
| Endpoint | Purpose | Audience | Context Size |
|---|---|---|---|
/{page}.html |
Rendered HTML with navigation | Humans | N/A |
/{page}.md |
Raw markdown | AI/LLMs | Per-page |
/llms.txt |
Documentation index | AI assistants | Small (~5KB) |
/llms-full.txt |
Complete context (all pages) | AI deep context | Large (~500KB+) |
/mcp |
Interactive queries | AI (MCP clients) | Minimal (250x less) |
Example: Give an AI assistant your docs:
"Read my documentation at https://docs.example.com/llms.txt"
The AI gets a structured index with absolute URLs to every page. For complete context, use /llms-full.txt which includes all page content inline.
Model Context Protocol provides on-demand documentation access with 250x less context:
POST /mcp
{
"method": "tools/call",
"params": {
"name": "search_docs",
"arguments": {
"query": "authentication",
"limit": 5
}
}
}Benefits:
- π― Precise β AI queries only what it needs
- β‘ Fast β No sending entire documentation every time
- π° Cost-effective β 250x less tokens than llms-full.txt
- π Smart β Full-text search with Whoosh
Available MCP Tools:
search_docsβ Semantic search across documentationget_doc_pageβ Retrieve specific pages with section filteringlist_doc_pagesβ List all available pages by category
See MCP Integration Guide for details.
- π¨ Nuxt UI-inspired three-column layout (sidebar, content, TOC)
- π¨ Syntax highlighting with Pygments
- π¨ Responsive design (mobile, tablet, desktop)
- π¨ Dark mode ready
- β Tables, task lists, footnotes, Mermaid diagrams
- π€ llms.txt β Structured documentation index (5KB)
- π€ llms-full.txt β Complete context export (500KB+)
- π MCP endpoint β Interactive queries via Model Context Protocol
- 250x less context than llms-full.txt
- Full-text search with Whoosh
- On-demand page retrieval
- Section filtering
- π€ Automatic link transformation to absolute URLs
- π€ Curated or auto-generated indexes
- β‘ Fast β disk caching, <5ms cached responses
- π₯ Hot reload in debug mode
- π§ Zero configuration required
- π Python 3.11-3.14, FastAPI, Pydantic
- π§ͺ 208 tests, 100% passing
Your documentation needs just 3 required files:
docs/
βββ index.md # Homepage (required)
βββ sidebar.md # Navigation (required)
βββ topbar.md # Top bar (required)
βββ llms.txt # AI index (optional)
βββ your-content.md # Your pages
Configure via environment variables:
DOCS_ROOT=./docs # Documentation directory
CACHE_ROOT=./__cache__ # Cache directory
PORT=8080 # Server port
DEBUG=true # Enable debug mode
BASE_URL=https://docs.site.com # Base URL for llms.txt
MCP_ENABLED=true # Enable MCP endpoint (default: true)
MCP_RATE_LIMIT_REQUESTS=120 # MCP rate limit (requests per window)
MCP_RATE_LIMIT_WINDOW=60 # MCP rate limit window (seconds)See Configuration Guide for details.
servemd is perfect for:
- SaaS Documentation β Customer-facing support docs with AI assistant integration
- Open Source Projects β Self-hosted, beautiful docs
- Internal Teams β Company knowledge bases and wikis
- API Documentation β REST/GraphQL API docs
- Technical Writing β Blogs and tutorials
| Method | Best For |
|---|---|
| Local Development | Development, previewing |
| Docker | Production, CI/CD |
| Cloud Platforms | Heroku, Railway, Fly.io, DigitalOcean |
| Kubernetes | k8s, k3s, Helm charts |
Check examples/ for ready-to-use templates:
Dockerfile.user-templateβ Custom Docker imagedocker-compose.user.ymlβ Docker Compose setupk8s-simple.yamlβ Kubernetes deployment
Clean, modular FastAPI application:
src/docs_server/
βββ config.py # Settings & environment
βββ helpers.py # Utilities & navigation
βββ caching.py # Smart caching
βββ markdown_service.py # Markdown rendering
βββ llms_service.py # LLMs.txt generation
βββ templates.py # HTML templates
βββ main.py # FastAPI routes
βββ mcp/ # Model Context Protocol
βββ server.py # MCP JSON-RPC handler
βββ tools.py # MCP tools (search, get, list)
βββ search.py # Full-text search with Whoosh
βββ indexer.py # Documentation indexing
uv run pytest tests/ -v
# 208 tests, 100% passing β
git clone https://github.com/servemd/servemd
cd servemd
uv sync --group dev
uv run pytest tests/ -v
DEBUG=true uv run python -m docs_server| Endpoint | First Request | Cached |
|---|---|---|
| Rendered HTML | 50-100ms | <5ms |
| Raw Markdown | <10ms | <10ms |
| LLMs.txt | 100-200ms | <5ms |
- Quick Setup β Get running in 5 minutes
- Markdown Features β Tables, code blocks, diagrams
- LLMs.txt Guide β AI assistant integration
- MCP Integration β Interactive queries for LLMs
- Navigation β Sidebar and topbar configuration
- Configuration β Environment variables
- API Reference β HTTP endpoints
- π Documentation: docs.servemd.dev or run locally
- π Live demo: servemd.me.cloudns.cl
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
MIT License β use freely for any project.
pip install servemd
servemd ./my-docsVisit http://localhost:8080 β beautiful docs for humans, structured context for AI.
servemd β Serve docs to humans and AI
Built with Python, FastAPI, and Markdown
Documentation Β· Live Demo Β· PyPI Β· GitHub