Skip to main content

Documentation Authoring Guide

Last Updated: 2025-11-17 Purpose: Establish clear documentation standards and prevent content drift

Documentation Philosophy

Single Source of Truth: Every piece of user-facing documentation should exist in exactly one canonical location. Discoverability First: If documentation isn’t linked from Mintlify navigation (docs.json), most users will never find it.

File Format Policy

✅ USE .mdx for All Documentation in docs/

Location: docs/**/*.mdx (registered in docs/docs.json) Policy: The docs/ directory is exclusively for Mintlify .mdx files. No .md files allowed. When to use:
  • Getting started guides
  • API documentation
  • Deployment guides
  • Architecture documentation
  • Tutorials and examples
  • Troubleshooting guides
  • Security and compliance docs
  • Contributor documentation (this guide!)
Requirements:
  1. Frontmatter (required):
SEO Field Guidelines:
  • seoTitle: Optimized for search engines (50-60 characters), typically {title} - MCP Server LangGraph
  • seoDescription: Expanded version of description (150-160 characters) for search engine snippets
  • keywords: Array of 5-10 relevant keywords including domain keywords (mcp server, langgraph)
  1. Navigation (required):
    • Must be registered in docs/docs.json
    • Place in appropriate tab and group
    • Use logical ordering
  2. Links (required):
    • Use Mintlify-style paths: /getting-started/introduction
    • NOT relative paths: ../getting-started/introduction.md
    • NOT file extensions: /getting-started/introduction (not .mdx)
  3. Special Characters (required):
    • Escape < as &lt; in tables and text
    • Escape > as &gt; in tables and text
    • Escape & as &amp; if not part of HTML entity
  4. File Naming (required):
    • Use lowercase kebab-case: my-guide-name.mdx
    • NOT UPPERCASE: MY_GUIDE_NAME.mdx
    • NOT snake_case: my_guide_name.mdx
    • NOT camelCase: myGuideName.mdx

⚠️ .md Files Allowed ONLY Outside docs/

Allowed .md files (outside docs/ directory):
  • Root-level files: README.md, CHANGELOG.md, SECURITY.md, CONTRIBUTING.md
  • docs-internal/*.md - Internal contributor documentation
  • Development notes, research, scratch files
NOT allowed:
  • Any .md files in docs/ directory
  • User-facing guides in .md format
  • Duplicates of .mdx files

Directory Structure


Common Mistakes to Avoid

❌ DON’T: Create Duplicate Documentation

Why: Creates content drift, confusion about source of truth Fix: Keep only the .mdx version in the appropriate location

❌ DON’T: Forget Frontmatter

Why: Mintlify won’t render metadata, icons, or SEO correctly Fix: Always start with proper frontmatter

❌ DON’T: Use UPPERCASE File Names

Why: Violates Mintlify best practices, inconsistent URLs Fix: Use lowercase kebab-case

Why: Mintlify routing doesn’t use file extensions Fix: Use path-style links

❌ DON’T: Forget to Register in docs.json

Even if the file exists, it won’t be accessible unless it’s in docs.json:

❌ DON’T: Use < or > Unescaped

Why: MDX interprets < as start of JSX tag Fix: Use HTML entities

Creating New Documentation

Step 1: Choose the Right Location

Step 2: Use a Template

Available templates (in docs-templates-mintlify/):
  • adr-template.mdx - Architecture Decision Records
  • guide-template.mdx - How-to guides
  • deployment-template.mdx - Deployment guides
  • reference-template.mdx - API reference

Step 3: Add Frontmatter

Step 4: Write Content

  • Start with context: Why does this page exist?
  • Use headings: Organize with ##, ###, ####
  • Add examples: Code blocks with syntax highlighting
  • Link related docs: Help users navigate
  • Test locally: Run mintlify dev to preview

Step 5: Register in docs.json

Step 6: Validate


Migration Policy

When converting .md to .mdx:
  1. Read the original .md file
  2. Add frontmatter with appropriate metadata
  3. Preserve all content exactly as-is
  4. Fix any </> escaping issues in tables
  5. Update internal links to Mintlify format
  6. Use lowercase kebab-case for filename
  7. Register in docs.json at appropriate location
  8. Delete the original .md file
  9. Run validation: mintlify broken-links


Icon Selection

See Icon Selection Guide for comprehensive icon reference. Common icons:
  • rocket - Getting started, quickstart
  • book - Guides, tutorials
  • code - API, SDK
  • server - Deployment, infrastructure
  • shield - Security
  • chart-line - Metrics, observability
  • infinity - CI/CD
  • cloud - Cloud providers
  • book-open - Documentation, authoring

Content Quality Standards

Writing Style

  • Be concise: Respect reader’s time
  • Be specific: “Run make test” not “Run tests”
  • Be actionable: Focus on “how” more than “what”
  • Be consistent: Use same terminology throughout

Code Examples

Screenshots/Diagrams

  • Prefer Mermaid for diagrams (see Mermaid Guide)
  • Optimize images: Compress before committing
  • Add alt text: For accessibility

Pre-Commit Checklist

Before committing documentation changes:
  • Frontmatter complete and accurate (including contentType)
  • File name is lowercase kebab-case
  • Added to docs.json navigation
  • All < and > escaped in tables
  • Internal links use Mintlify format (/path/to/page)
  • No duplicate .md version exists
  • Ran mintlify broken-links (no errors)
  • Tested with mintlify dev (renders correctly)
  • Spell-checked and grammar-checked

Validation

Pre-commit Hooks

The following validations run automatically: Pre-commit stage (local):
  • Frontmatter quote style check
  • File naming conventions (lowercase)
  • ADR synchronization
Pre-push stage (local + CI):
  • mintlify broken-links - PRIMARY validator
    • Checks: frontmatter, links, navigation, syntax, images
    • Duration: ~8-12 seconds
    • This is the single source of truth for docs validation

Manual Validation


Troubleshooting

”Syntax error - Unable to parse”

Cause: Unescaped < or > characters, or code blocks missing language tags Fix:
  • Replace < with &lt; and > with &gt;
  • Add language tags to code blocks: ```python instead of ```

”Page not found” in Mintlify

Cause: Not registered in docs.json Fix: Add page path to appropriate group in docs.json

”Broken link” warning

Cause: Link uses wrong format or points to non-existent page Fix:
  • Use /path/to/page format (no extension)
  • Verify target page exists and is in docs.json

”Could not parse import/exports with acorn”

Cause: Code block containing import statement doesn’t have language tag Fix: Add python, javascript, or appropriate language tag to code block

Maintenance

Weekly

  • Review new documentation PRs for compliance
  • Check mintlify broken-links output

Monthly

  • Audit for orphaned .md files (should be ZERO in docs/)
  • Review docs.json for logical organization
  • Update this guide as patterns emerge

Getting Help


Remember: All user-facing documentation belongs in .mdx files registered in docs.json. The docs/ directory is exclusively for Mintlify .mdx files - no exceptions.