Skip to main content

servemd

Serve docs to humans and AI.

Beautiful markdown documentation with native llms.txt support. Zero configuration, production-ready.

PyPI Docker Hub Python 3.11+ FastAPI MCP Tests License: Apache 2.0 CodeQL


Why servemd?

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.


✨ Features

  • 🎨 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 .md files 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

🚀 Quick Start

Install

pip install servemd

Run

# 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

Alternative: Docker

# 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.

Alternative: uvx (no install)

uvx servemd ./my-docs

📚 Complete Setup Guide →

For Contributors

git clone https://github.com/servemd/servemd
cd servemd
uv sync
uv run python -m docs_server

🤖 AI-Native: llms.txt & MCP Support

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)

llms.txt - Static Index

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 documentation
  • get_doc_page — Retrieve specific pages with section filtering
  • list_doc_pages — List all available pages by category

See MCP Integration Guide for details.


✨ Key Features

For Humans

  • 🎨 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

For AI

  • 🤖 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

For Developers

  • ⚡ 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

📁 File Structure

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

⚙️ Configuration

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.


🎯 Use Cases

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

📘 Deployment

Method Best For
Local Development Development, previewing
Docker Production, CI/CD
Cloud Platforms Heroku, Railway, Fly.io, DigitalOcean
Kubernetes k8s, k3s, Helm charts

🛠️ Examples

Check examples/ for ready-to-use templates:

  • Dockerfile.user-template — Custom Docker image
  • docker-compose.user.yml — Docker Compose setup
  • k8s-simple.yaml — Kubernetes deployment

🏗️ Architecture

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

🧪 Testing

uv run pytest tests/ -v

# 208 tests, 100% passing ✅

🔧 Development

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

📊 Performance

Endpoint First Request Cached
Rendered HTML 50-100ms <5ms
Raw Markdown <10ms <10ms
LLMs.txt 100-200ms <5ms

📖 Documentation


🙋 Support


📜 License

MIT License — use freely for any project.


🎉 Get Started Now

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

Metadata

Release files for servemd 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for servemd 1.3.0
File Size Uploaded Provenance
servemd-1.3.0.tar.gz 172.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for servemd 1.3.0
File Interpreter ABI Platform
servemd-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 239.1 kB

Release files / servemd-1.3.0.tar.gz

Download URL servemd-1.3.0.tar.gz
Size 172.1 kB
Tags Source
SHA-256 checksum
How to use checksums
82906489d54d006fe96816f2f545f67541606d46db3e57dd55c62076cc0c6e10
BLAKE2b-256 checksum
How to use checksums
09d57e5700fdad1459f1b8d35e4316897cbf755e5689726b907ab25cb0d9bd43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 15, 2026.

Transparency log

Release files / servemd-1.3.0-py3-none-any.whl

Download URL servemd-1.3.0-py3-none-any.whl
Size 66.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c293c3effdd8882e34813760409731bf64b474e62971fced99a7b8d52e5cdee5
BLAKE2b-256 checksum
How to use checksums
5fb41ced38f942037f2785d3afbd245d01f247820a4cfef92bc32da1bcb37223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 15, 2026.

Transparency log

Security for servemd 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for servemd-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page