Use with AI agents

Give Claude Code, Cursor, Codex, VS Code and other coding agents Glyph's real API.

Glyph is built for coding agents. They write better code when they can look up the real API instead of recalling it from training data, which is often a version or two behind. Glyph gives them three ways in: an MCP server for agents that call tools, Markdown versions of every page for agents that read the web, and a short block for your project's agent instructions.

Set up with one prompt

Pick your agent, copy the prompt and paste it into a chat in your project. It connects the MCP server, installs and wires up Glyph, and adds the project instructions. The sections below cover each step by hand.

Prompt for Claude Code:

Set up Glyph (https://glyphui.xyz), a React + Tailwind CSS v4 UI library, in this project.

1. If there is no React app here yet, create one with Vite (React + TypeScript) first.
2. Add Glyph's MCP server for this project: run `claude mcp add --scope project glyph -- npx -y @glyphui/mcp`.
3. Install and wire up Glyph. If the glyph MCP tools are available, call `get_setup` for this project's framework and follow it. Otherwise (they load after a restart) follow https://glyphui.xyz/docs/getting-started.md. That means: install @glyphui/ui, add its CSS imports, create the theme file and wrap the app in GlyphProvider.
4. Add this section to CLAUDE.md at the project root, creating the file if needed:

   ## UI

   This app uses Glyph (@glyphui/ui and friends) for all UI. Before using a component, look it up with the glyph MCP server (get_component, search_docs) or at https://glyphui.xyz/llms.txt. Don't guess props.

   - Import from the entry each component lists, such as @glyphui/ui/form.
   - Style through the theme file and token utilities (bg-primary, text-muted-foreground), not hard-coded colors.
   - Prefer an existing block or pattern over building from primitives.
   - Keep labels, aria-label on icon-only buttons, and keyboard behavior.
5. Run the app (or its build) to check it works, then tell me what you changed.

Prompts for Cursor, VS Code, Codex, Windsurf and other agents: https://glyphui.xyz/docs/ai

MCP server

@glyphui/mcp is a Model Context Protocol server. Your editor starts it on demand with npx; there is nothing to install in your project. Everything it serves is bundled in the package and generated from these docs for that release, so it works offline and answers for one exact Glyph version.

Claude Code

claude mcp add glyph -- npx -y @glyphui/mcp

To share it with your team, add it to the project's .mcp.json instead: claude mcp add --scope project glyph -- npx -y @glyphui/mcp. Run /mcp in Claude Code to check that it's connected.

Cursor

{
  "mcpServers": {
    "glyph": { "command": "npx", "args": ["-y", "@glyphui/mcp"] }
  }
}

VS Code

For GitHub Copilot's agent mode:

{
  "servers": {
    "glyph": { "type": "stdio", "command": "npx", "args": ["-y", "@glyphui/mcp"] }
  }
}

Codex

[mcp_servers.glyph]
command = "npx"
args = ["-y", "@glyphui/mcp"]

Windsurf

{
  "mcpServers": {
    "glyph": { "command": "npx", "args": ["-y", "@glyphui/mcp"] }
  }
}

Claude Desktop

Settings → Developer → Edit Config, then add the server to claude_desktop_config.json and restart the app:

{
  "mcpServers": {
    "glyph": { "command": "npx", "args": ["-y", "@glyphui/mcp"] }
  }
}

Match your Glyph version

npx -y @glyphui/mcp runs the latest release. If your project is on an older version, pin the server to it, such as npx -y @glyphui/[email protected]. Or add it as a dev dependency, so it upgrades with the rest of Glyph, and run its glyphui-mcp command instead of npx.

What the server provides

ToolUse it to
get_setupAdd Glyph to a Vite, Next.js or other app: install commands with the peers you need, CSS imports, color mode, a theme file and the provider tree.
list_componentsBrowse components by category, status or package.
search_docsSearch components, props, guide sections and release notes, such as "server side pagination".
get_componentGet one component's import, peer dependencies, props for each export, theme slots and variants, keyboard behavior and examples.
get_exampleRead the full source of one example.
list_guides, get_guideRead a guide, such as Forms or Data tables, as Markdown.
get_themingSee the presets, every token a theme sets, and a complete theme file.

It also serves the docs as resources (glyph://llms-full, glyph://components/button, glyph://guides/forms), which some clients let you attach to a chat, and a build-with-glyph prompt that asks the agent to check each API before using it.

You don't need to name the tools. Ask for what you want ("add a settings page with a profile form") and the agent calls them as it goes.

llms.txt and Markdown pages

For agents that read the web instead of calling tools:

curl -H "Accept: text/markdown" https://glyphui.xyz/components/data-table

Project instructions

Agents read a project file before they start: AGENTS.md (Codex, Cursor, VS Code and others), CLAUDE.md (Claude Code) or .cursor/rules. A few lines there keep them on Glyph's conventions:

## UI

This app uses Glyph (@glyphui/ui and friends) for all UI. Before using a component,
look it up with the glyph MCP server (get_component, search_docs) or at
https://glyphui.xyz/llms.txt. Don't guess props.

- Import from the entry each component lists, such as @glyphui/ui/form.
- Style through src/glyph.theme.ts and the token utilities (bg-primary,
  text-muted-foreground), not hard-coded colors.
- Prefer an existing block or pattern over building from primitives.
- Keep labels, aria-label on icon-only buttons, and keyboard behavior.

Live page: https://glyphui.xyz/docs/ai