Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

For LLMs & Agents

logic2b ui is designed to be consumed by AI agents. Here is the machine-readable surface.

Everything on this site is available in machine-friendly formats. If you are an LLM or building an agent, use these endpoints instead of scraping HTML.

Endpoints

Endpoint Content
/llms.txt Index of all documentation with absolute URLs
/llms-full.txt The entire documentation in one Markdown file
/docs/<page>.md Any docs page as plain Markdown (append .md)
/r/index.json Registry index: every component with its description
/r/<name>.json Full component payload: metadata, source code, generated API and UI accessibility contract
/r/versions.json Release index: exact versions, dates and channels
/r/versions/<version>.json Immutable manifest with content URLs and SHA-256 integrity
/r/changelog/<name>.json Machine-readable release history for one item
/tokens/default/manifest.json SHA-256 manifest for the portable default token exports
/tokens/default/logic2b.tokens.json DTCG-shaped global/light/dark semantic tokens
/mcp Remote MCP endpoint (streamable HTTP): registry tools for agents

Installing components programmatically

The registry uses an open registry-item JSON schema. Each item includes dependencies (npm), registryDependencies (other registry items) and files[].content (the full TypeScript source):

curl https://ui.logic2b.com/r/button.json

Every registry:ui payload also includes api, generated from its public TypeScript exports, and accessibility: its support model, semantic/ARIA behavior, keyboard interactions, responsibilities left to the consumer and any known limitations. Agents should preserve those requirements when composing or modifying an installed component.

To install into a user project, either run the logic2b CLI:

npx logic2b@next add button

or resolve a release through /r/versions.json, fetch the content-addressed payload referenced by its immutable manifest, verify its SHA-256 integrity, write files[].content to the mapped project path, install the listed dependencies, and recurse into registryDependencies.

Copy Prompt

Every install surface on this site (component docs, blocks, charts and the /create theme studio) has a Copy Prompt action next to the CLI command. It copies a self-contained brief for a coding agent: the CLI happy path, a manual fallback against the raw registry JSON, the exact theme CSS when a preset is involved, the path-mapping table, and a verification checklist. Paste it into Claude Code, Cursor or Copilot and the agent has everything it needs — no scraping, no guessing.

MCP server

Host requirements and beta versions

The MCP tools return data and plans. Applying a plan requires a host that can write project files; installing dependencies, running builds and browser checks requires a runtime with the appropriate package manager. A chat client with only remote MCP can inspect source and request plans, but cannot complete those steps by itself. The remote server cannot access your filesystem.

Local stdio requires Node.js 18+ and npm. Use @logic2b/mcp@next for the beta, and logic2b@next for CLI commands. These npm selectors are independent of the registry version. Record the MCP handshake version and CLI --version because next can move. The remote MCP and current source provide structured results, verified default registry reads, input limits and list_presets. The npm @next package still resolves to 1.0.0-rc.2: it returns JSON text and does not yet include those additions. Use the remote endpoint for the full catalog described below until the next npm release.

/mcp is a protocol endpoint, not a browser page. A GET returning HTTP 405 is expected; use an MCP client handshake to check the connection.

Prefer a live connection? The registry speaks the Model Context Protocol two ways, with the npm release gap noted above. Reading the registry: list_components, search_components, get_component (full source of every file) and get_demo (real usage examples, imports rewritten to project paths — also served raw at /r/demos/index.json). list_registry_versions resolves the available releases/channels and get_changelog exposes per-item history. Registry read/install/theme tools accept an optional version containing an exact semver, a range or a channel; omitting it resolves the next registry channel. Every call resolves one immutable release, verifies each payload’s SHA-256 before returning it and reports the exact registryVersion; a failed verification is an error, never a fallback. Inputs are bounded (at most 32 items per call, 1 MB of caller CSS, 2 MB request bodies); invalid arguments are JSON-RPC errors while execution failures return isError. Planning project changes: install_plan (the exact files to write and npm deps to add for any set of items, registry dependencies resolved) and scaffold_plan (a complete runnable Next.js, Vite or Astro app from a marketing, dashboard or auth starter, including routing, exact-pinned dependencies and an optional /create preset). get_theme, decode_preset and apply_preset rebuild or patch theme.css; list_presets discovers the same curated configurations rendered at /themes, including canonical ids, studio links and measured audit notes. contrast_audit verifies WCAG 2.2 and APCA contrast per token pair before you ship it. lint_theme statically checks an existing theme.css for missing, duplicate or invalid tokens, derived-token drift and contrast regressions; include a preset id to require exact preset fidelity. With a shell, add_command returns the validated CLI invocation instead. export_tokens resolves any preset into the portable global/light/dark token bundle that drives the Style Dictionary CSS, iOS and Android outputs.

For example, an agent can call scaffold_plan with framework: "vite", starter: "dashboard", version: "next" and a preset id, write the returned files into an empty directory, then install dependencies. The response records the exact resolved registry version in components.json. The same contract is available for next and astro; all three generated projects are compiled in CI.

Remote (no local MCP server installation) — connect any streamable-HTTP MCP client to:

https://ui.logic2b.com/mcp

With Claude Code:

claude mcp add --transport http logic2b https://ui.logic2b.com/mcp

Or in any client that takes a JSON config:

{
  "mcpServers": {
    "logic2b": { "type": "http", "url": "https://ui.logic2b.com/mcp" }
  }
}

Local (stdio) — npx -y @logic2b/mcp@next runs the published package as a local process, with the release differences described above. See the repo for details.

Conventions an agent can rely on

  • Every component uses the cn() helper from @/lib/utils.
  • Colors are always theme tokens (bg-primary), never raw palette classes.
  • Variants are defined with class-variance-authority and exported (e.g. buttonVariants).
  • Every root element has a data-slot attribute for reliable selection.

Project inspection in the source candidate

The source candidate adds logic2b inspect --json --details full and the network-free MCP inspect_project tool. Confirm availability in CLI --help or MCP tools/list before using them. They inspect existing configuration and file hashes, report confirmed aliases and installed modifications, and retain unknowns. The remote tool needs a host-supplied snapshot; it cannot read your disk. Limits include 128 KiB configuration input, 1,000 file hashes and 256-character relative paths. Summary output is compact; request full detail before reconciling install destinations. Existing install plans do not consume this context automatically. Source availability does not imply publication.

Managed agent instructions (source candidate)

The current source adds agent_rules to MCP and rules to the CLI. Confirm availability in the running tool catalog or CLI help; this does not imply that the installed npm package has received the source change.

init, add and update generate or refresh AGENTS.md and DESIGN.md. Use --no-agent-rules to opt out. rules --format agents,claude,cursor,copilot adds Claude’s @AGENTS.md import, a Cursor rule and a Copilot section. Text outside managed markers remains the project’s own. Malformed markers require repair; automatic installs report a rules failure separately.

For a shell-less host, agent_rules returns these files from optional preset, stack, iconLibrary, formats, exact installed registryVersion and installed items (name, optional type/categories). Inventory is unknown when omitted; it is not inferred from the available catalog. Merge the returned managed block with existing instructions, never replace the whole document. Existing Cursor frontmatter must stay intact. Rules are capped at 6 KiB; large inventories state how many names are shown. DESIGN.md remains a separate preset reference, and actual CSS overrides take precedence.

scaffold_plan includes the two documents by default (agentRules: false omits them). The MCP tarball contains skills/logic2b-ui/SKILL.md for optional copying to your host’s skill location; npx does not install it there automatically. The skill uses available tools and project checks. Review, composition and proposal tools remain planned. Rules and plans do not grant execution authority or require a second approval for work already authorized by the user.