Skip to content
Elements · By Sages

Guide

AI Integration

The docs assistant, an MCP server, and llms.txt — let AI agents use the Elements docs directly.

The Elements documentation ships three ways in for AI agents: a conversational assistant on the site, an MCP server for coding tools, and raw Markdown you can fetch wholesale.

#Docs assistant

The site ships a built-in AI assistant that answers questions about the documentation in natural language:

  • Floating input — ask from any docs page
  • Grounded in the docs — backed by the same MCP tools (list-pages to search, get-page to read), so it answers rather than guesses
  • Cited sources — replies link to the doc pages they draw on
  • Code examples — copyable usage snippets

The assistant itself is built from Elements' own Ai component family and Drawer — the library dogfoods.

#MCP server

The site exposes an MCP server at /mcp with two tools:

ToolWhat it does
list-pagesList every docs page with title, path and description, for discovery
get-pageRead one page's full Markdown content

#Claude Code

bash
claude mcp add --transport http elements https://elements.bysages.com/mcp

Or add it to a config file (~/.claude/settings.json, or .claude/settings.json in a project):

json
{
  "mcpServers": {
    "elements": {
      "type": "http",
      "url": "https://elements.bysages.com/mcp"
    }
  }
}

#OpenAI Codex CLI

bash
codex mcp add elements --url https://elements.bysages.com/mcp

#LLMs.txt

Following the llms.txt spec, the site generates two files for agents that fetch documentation wholesale:

Every page also has a raw Markdown route: /raw/<path>.md.

#In CLAUDE.md

Reference it from a project's CLAUDE.md:

markdown
For the Elements component library, refer to:

- https://elements.bysages.com/llms.txt

#Generative UI

The library reads as well as it renders — for machines, too. Every component family carries a generative face: a zod-typed catalog entry (props, slots, description) that lives beside the component itself. The faces compose into a json-render catalog, and each framework package exposes a renderer under @bysages/<fw>/generative:

  • Constrained by design — the model may only compose components you registered; there is no free-form HTML and no way around the design system
  • Typed vocabulary — props are zod schemas, so requests validate before they render
  • One vocabulary, four frameworks — React, Vue, Solid and Svelte share the same faces; only the renderer differs

Point an AI SDK stream at the renderer and a prompt becomes a working, on-brand interface — the generative studio in the docs examples is a live demo.

#Summary

MethodBest for
Docs assistantInteractive Q&A on the documentation site
MCP serverLive doc lookup inside AI coding tools
LLMs.txtFetching documentation in bulk for context
Generative UIAssembling real components from a prompt