tdpxl

AI agents

Built for humans and AI agents. llms.txt, markdown pages, an MCP server, AGENTS.md rules and tdpxl check give a coding agent the same guidance a person reads.

Every page, rule and example in these docs also exists in a form a coding agent can read without a browser. All of it is generated from the same sources as the human docs, so an agent and a person never read two different APIs.

ResourceWhat it holdsWhere
llms.txtOverview, install, and a link to every doc page as markdown (llmstxt.org convention)/llms.txt
llms-full.txtThe guides in full, plus a condensed entry per item: purpose, API summary, when to use and avoid, accessibility contract, focused example code/llms-full.txt
Markdown pagesAny docs page as plain markdown: add .md to its path/docs/components/button.md
RegistryOne JSON document per item, with source and <name>.meta.json/r/registry.json, /r/<name>.json
Agent manifestExports and props from source, contracts, accessibility requirements, usage metadata/ai/manifest.json
MCP serverThe above as tools, plus the contrast check@tdpxl/mcp (local build, below)

llms.txt and markdown pages

Point an agent at /llms.txt when it needs to find its way, and at /llms-full.txt when it should load the whole system at once (about 1 MB). Each docs page is also served as markdown at the same path plus .md, for example /docs/theming.md or /docs/components/dialog.md; links inside those pages point at other .md pages.

The files are generated by pnpm llms:build (part of pnpm build). Links are root-relative unless TDPXL_BASE_URL is set at build time, in which case they are absolute.

MCP server

@tdpxl/mcp (binary tdpxl-mcp) is a read-only Model Context Protocol server over stdio. It reads the registry, the agent manifest and these docs, and reaches no network beyond the registry you configure.

ToolReturns
list_itemsItems filtered by kind (component, hook, chart, block), category or search words
get_itemUsage metadata v2, source-derived API, accessibility contract, dependencies, files and docs link
get_examplesFocused official example code with consumer import paths; source files for charts and blocks
get_install_commandThe @tdpxl/cli add command, resolved registry dependencies and npm packages
get_rulesThe consumer AGENTS.md section, tdpxl/rules.json and the visual rules; per component with component
check_themeThe same contrast check as tdpxl check contrast, on stylesheet text or a project path, with suggested fixes
search_docsRanked doc sections with snippets and markdown links

Use the local build

Not published yet

@tdpxl/mcp is not on npm. Build it from a clone of the tdpxl repository and point your editor at packages/mcp/dist/index.js with an absolute path.

pnpm install
pnpm mcp:build    # writes packages/mcp/dist/index.js
pnpm mcp:test     # unit, in-process and stdio tests

Claude Code, from your project:

claude mcp add tdpxl -- node /absolute/path/to/tdpxl/packages/mcp/dist/index.js

or commit a project-scoped .mcp.json:

{
  "mcpServers": {
    "tdpxl": {
      "command": "node",
      "args": ["/absolute/path/to/tdpxl/packages/mcp/dist/index.js"]
    }
  }
}

Cursor: the same mcpServers object in .cursor/mcp.json (project) or ~/.cursor/mcp.json (global).

VS Code (Copilot agent mode), in .vscode/mcp.json:

{
  "servers": {
    "tdpxl": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/tdpxl/packages/mcp/dist/index.js"]
    }
  }
}

Configuration

VariableDefaultEffect
TDPXL_REGISTRYthe repository's public/rRegistry folder or URL, e.g. http://localhost:4000/r while pnpm dev runs. Its parent holds ai/ and llms-full.txt.
TDPXL_MCP_ROOTSthe server's working directoryDirectories check_theme may read a project from (separated like PATH). Paths are resolved through symlinks, and the stylesheet must stay inside the project.
TDPXL_MCP_LIVEoff1 re-reads data that changed instead of keeping the first copy for the life of the server. Same as the --live flag.

Working on tdpxl itself: live data

By default the server reads each file once and keeps it until it restarts, and the files it reads are generated. While you change tdpxl, that means an agent can answer from components, metadata or docs that are no longer true, with nothing to tell it so. Two pieces close that gap:

pnpm mcp:dev    # regenerates the MCP data on every change to registry/, lib/,
                # governance/, content/docs/ and components/demos/

and the server started with --live, so it re-reads whatever changed:

claude mcp add tdpxl -- node /absolute/path/to/tdpxl/packages/mcp/dist/index.js --live

A local file is re-read when its modification time or size changes; with a URL registry, --live fetches on every call. If a generator fails, mcp:dev says so and the server keeps serving the last good data: it reads a complete copy in .mcp-data/ that only a fully successful rebuild replaces. Consumers reading a released registry do not need either.

Once published (placeholder)

Placeholder: this does not work yet

When @tdpxl/mcp is published, the local path becomes a package run, and the registry default becomes the hosted one:

claude mcp add tdpxl -- npx -y @tdpxl/mcp

AGENTS.md and rules

npx @tdpxl/cli add guide (installed with the theme) merges a tdpxl section into your project's AGENTS.md and writes tdpxl/rules.json. Agents that read AGENTS.md (Claude Code, Cursor, Copilot, Codex and others) then know where components live, that they use semantic roles instead of palette classes and dark: variants, that Button uses intent and emphasis rather than variant, and that each component's <name>.meta.json says when to use it and what is safe to change. The MCP get_rules tool returns the same content.

Check the result

After an agent changes the theme or a component, run:

npx @tdpxl/cli check

It recomputes every semantic contrast pair in both themes and flags raw palette classes, dark: variants and hex classes. See Customizing for your brand. The MCP check_theme tool runs the same contrast math, so an agent can test values before writing them.

Automated checks do not replace a keyboard pass, a screen-reader pass or a design review; see Accessibility.

On this page