Built for AI agents

AI and agents•5 min read|
|

DocsLit is designed to be the documentation platform that AI tools generate docs with. An agent can learn the whole component set from the CLI, write a page, check it, and fix what the checks report, all without guessing and without a browser. A published site is just as easy for an agent to read.

Everything on this page is open source and runs locally. DocsLit does not call a language model itself. It gives your agent accurate reference data and strict, machine-readable feedback.

The authoring loop

Agents write better docs when they can look things up and get precise errors back. DocsLit gives them four steps:

Discover components and config

Ask the CLI instead of relying on training data. The component list is generated from the same manifest the validators use.

docslit components --json # every wc-* component docslit components wc-tabs --json # attributes, nesting, a working example docslit schema # JSON Schema for docslit.json docslit schema frontmatter # JSON Schema for page frontmatter
Create and write the page

docslit new never prompts and can print JSON, so an agent can script it.

docslit new guides/webhooks --title "Webhooks" \ --description "How to receive and verify webhook events." \ --group "Guides" --json { "id": "guides/webhooks", "file": "docs/guides/webhooks.md", "sidebarUpdated": true, "group": "Guides" }

The agent then writes the Markdown in docs/guides/webhooks.md.

Check it as JSON

validate answers "is it broken?" and lint answers "is it good?". Both print one JSON document with stable issue codes, a line number and a suggested fix.

docslit validate --format json docslit lint --format json
Fix and repeat

The agent edits the file at the reported file and line, then runs both commands again until ok is true. Both commands exit with code 1 when they find errors, so the loop is easy to script.

See Machine-readable CLI for real output and the full list of issue codes.

docslit validate flags unknown wc-* tags, unknown attributes, invalid attribute values, missing required attributes, bad nesting and unclosed tags. The MCP tool check_markup runs the same checks on a snippet before you write it, and create_page and update_page run them on what they write. Check an attribute you are unsure of with docslit components <tag> --json.

Pick an interface

Situation Use
Your agent supports MCP and you want the shortest path MCP server: npx docslit mcp
Your agent reads instruction files (Claude Code, Cursor, Copilot, Windsurf, Codex, Gemini) docslit agents init
Your agent runs shell commands, or you want to script checks in CI Machine-readable CLI
You want an agent to answer questions from published docs Reader mode
You want agents to install task instructions from your site Publish agent skills
You are moving docs over from Mintlify, Fern, GitBook or MkDocs Migrate with your AI agent: docslit import, then the MCP tool convert_mdx

What a published site exposes

Every docslit build also produces files for reading agents:

  • llms.txt and llms-full.txt for the page index and the full text
  • a .md file next to every page
  • .well-known/agent.json listing those endpoints
  • search-index.json for search
  • sitemap.md and changes.md, your navigation and recent updates as Markdown
  • skill.md and .well-known/agent-skills/, which publish agent skills
  • mcp-server.js, a standalone MCP server over stdio

The Markdown copies are served with noindex, point back to the HTML page as canonical, and can carry title, url, updated and tokens frontmatter. For a page that needs a different version for agents, add a .agent.md rendition.

Sites on DocsLit Cloud also get a hosted MCP endpoint and Accept: text/markdown negotiation with no extra setup. How agents read your site covers each file.

Write for agents and people differently

Some context helps a model but would clutter the page for a person, and some page elements mean nothing in plain Markdown. The wc-if component includes content only for agents (for="agents") or only for people (for="humans"), decided at build time. See Conditional content.

The MCP server also knows your look and your migration path. get_project_info reports the current theme and the available themes and palettes, so an agent can change them with docslit theme use, and convert_mdx converts a Mintlify, Fern, GitBook or MkDocs page without writing anything.

Get started in two commands

npx docslit agents init npx docslit mcp --print-config claude

The first writes AGENTS.md and any tool files it detects. The second prints the MCP server config to paste into your client.