Beautiful markdown documentation server for humans and AI
4.4K
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.
.md files and gopip install servemd
# Serve docs from current directory
servemd
# Or specify a directory
servemd ./my-docs
Visit 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-docs
git clone https://github.com/servemd/servemd
cd servemd
uv sync
uv run python -m docs_server
servemd 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:
Available MCP Tools:
search_docs — Semantic search across documentationget_doc_page — Retrieve specific pages with section filteringlist_doc_pages — List all available pages by categorySee MCP Integration Guide for details.
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:
| 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 deploymentClean, 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 |
MIT License — use freely for any project.
pip install servemd
servemd ./my-docs
Visit 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
Content type
Image
Digest
sha256:a28d7bda9…
Size
59.3 MB
Last updated
6 days ago
docker pull jberends/servemd