diff --git a/packages/docs/src/content/docs/ai-tools/llms-txt.mdx b/packages/docs/src/content/docs/ai-tools/llms-txt.mdx new file mode 100644 index 00000000..4cfa4a8d --- /dev/null +++ b/packages/docs/src/content/docs/ai-tools/llms-txt.mdx @@ -0,0 +1,29 @@ +--- +title: "LLMs.txt" +name: "LLMs.txt" +description: "LLM-optimized documentation endpoints for CoreUI for React — llms.txt, llms-full.txt, and a Markdown version of every page." +--- + +## Introduction + +[llms.txt](https://llmstxt.org) is an emerging standard that helps AI models understand and navigate documentation. The CoreUI for React docs expose three LLM-friendly endpoints so assistants can retrieve accurate, up-to-date content straight from the source. + +For a richer, tool-based integration, see [MCP Server](/react/docs/ai-tools/mcp/). + +## /llms.txt + +A structured index of the documentation — every page as a titled, described link, grouped by section. It gives an LLM a compact map of what exists and where. + +[Open llms.txt](/react/docs/llms.txt) + +## /llms-full.txt + +The entire documentation concatenated into a single Markdown file, so a model can ingest the whole set in one request. + +[Open llms-full.txt](/react/docs/llms-full.txt) + +## Markdown version of any page + +Append `.md` to any documentation page URL to get its clean Markdown version, without the site chrome. + +For example: [/react/docs/components/accordion.md](/react/docs/components/accordion.md) diff --git a/packages/docs/src/content/docs/ai-tools/mcp.mdx b/packages/docs/src/content/docs/ai-tools/mcp.mdx new file mode 100644 index 00000000..9d657eed --- /dev/null +++ b/packages/docs/src/content/docs/ai-tools/mcp.mdx @@ -0,0 +1,135 @@ +--- +title: "MCP Server" +name: "MCP Server" +description: "Bring the CoreUI for React documentation into your AI coding assistant with the @coreui/docs-mcp Model Context Protocol server." +--- + +## Introduction + +[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that lets AI assistants connect to external tools and data sources. The **`@coreui/docs-mcp`** server gives your assistant direct access to the official CoreUI documentation, so it answers from the current docs instead of relying on stale training data. + +It provides: + +- **Component documentation** — pages, props, events, and slots. +- **Live content** — read on demand from `coreui.io`, always matching the latest release. +- **Cross-framework links** — where each component is documented for Angular, Bootstrap, React, and Vue. +- **Coverage of Bootstrap, React, and Vue** from a single server. + +The server runs locally over stdio via `npx` — no global install required. + +## Installation + +### Claude Code + +Add the server with the CLI, then start a new session and run `/mcp` to verify the connection: + +```bash +claude mcp add coreui-docs -s user -- npx -y @coreui/docs-mcp --framework react +``` + +### Cursor + +Create `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for global configuration): + +```json +{ + "mcpServers": { + "coreui-docs": { + "command": "npx", + "args": ["-y", "@coreui/docs-mcp", "--framework", "react"] + } + } +} +``` + +### VS Code + +Create `.vscode/mcp.json` in your project. Note that VS Code uses the `servers` key: + +```json +{ + "servers": { + "coreui-docs": { + "type": "stdio", + "command": "npx", + "args": ["-y", "@coreui/docs-mcp", "--framework", "react"] + } + } +} +``` + +### Windsurf + +Edit `~/.codeium/windsurf/mcp_config.json`: + +```json +{ + "mcpServers": { + "coreui-docs": { + "command": "npx", + "args": ["-y", "@coreui/docs-mcp", "--framework", "react"] + } + } +} +``` + +### Claude Desktop + +Edit `claude_desktop_config.json` (Settings → Developer → Edit Config): + +```json +{ + "mcpServers": { + "coreui-docs": { + "command": "npx", + "args": ["-y", "@coreui/docs-mcp", "--framework", "react"] + } + } +} +``` + +### OpenAI Codex + +Add it with the CLI, or edit `~/.codex/config.toml` directly: + +```bash +codex mcp add coreui-docs -- npx -y @coreui/docs-mcp --framework react +``` + +```toml +[mcp_servers.coreui-docs] +command = "npx" +args = ["-y", "@coreui/docs-mcp", "--framework", "react"] +``` + +## Tools + +Once connected, your assistant can call the following tools: + +| Tool | Description | +| --- | --- | +| `list_components` | List documentation pages, optionally filtered by section or a substring. | +| `search_docs` | Search the documentation and return the best matching pages. | +| `get_doc_page` | Fetch the full Markdown of a page by slug, component name, or URL. | +| `get_component_api` | Get the structured API (props, events, slots) for a component. | +| `get_cross_framework_links` | Get documentation URLs for a component across every CoreUI framework. | + +## Configuration + +| Flag | Environment variable | Default | Description | +| --- | --- | --- | --- | +| `--framework ` | `COREUI_DOCS_FRAMEWORKS` | `bootstrap,react,vue` | Enabled editions (comma-separated). The first is the default for tools. | +| `--base-url ` | `COREUI_DOCS_BASE_URL` | `https://coreui.io` | Origin of the CoreUI site. The `//docs` path is appended automatically — override only for a staging or self-hosted mirror. | +| `--ttl ` | `COREUI_DOCS_TTL_MINUTES` | `360` | Cache freshness window. | +| — | `COREUI_DOCS_CACHE_DIR` | OS cache directory | On-disk cache location. | + +## Example prompts + +Once installed, try asking your AI assistant: + +- "How do I use the CoreUI React Multi Select component?" +- "What props does the CoreUI React Date Picker accept?" +- "Show me the CoreUI React Modal documentation." +- "Where is the Accordion documented across CoreUI frameworks?" + +The package is open source and published as [`@coreui/docs-mcp`](https://www.npmjs.com/package/@coreui/docs-mcp). diff --git a/packages/docs/src/content/docs/getting-started/ai-tools.mdx b/packages/docs/src/content/docs/getting-started/ai-tools.mdx deleted file mode 100644 index 738a793f..00000000 --- a/packages/docs/src/content/docs/getting-started/ai-tools.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "AI Tools (MCP)" -name: "AI Tools (MCP)" -description: "Bring the CoreUI for React documentation into your AI coding assistant with the @coreui/docs-mcp Model Context Protocol server." ---- - -## What is the CoreUI Docs MCP server? - -[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that lets AI assistants connect to external tools and data sources. The **`@coreui/docs-mcp`** server exposes the official CoreUI documentation — components, props, events, slots, and examples — so your assistant answers from the current docs instead of relying on stale training data. - -It covers Bootstrap, React, and Vue, and reads the live documentation from `coreui.io` on demand, so it always reflects the latest release. - -## Installation - -The server runs over stdio via `npx` — no global install required. - -### Claude Code - -```bash -claude mcp add coreui-docs -- npx -y @coreui/docs-mcp --framework react -``` - -### Cursor, Windsurf, VS Code, and Claude Desktop - -Add the server to your MCP configuration (`.cursor/mcp.json`, `.vscode/mcp.json`, `claude_desktop_config.json`, and similar): - -```json -{ - "mcpServers": { - "coreui-docs": { - "command": "npx", - "args": ["-y", "@coreui/docs-mcp", "--framework", "react"] - } - } -} -``` - -## Tools - -Once connected, your assistant can call the following tools: - -| Tool | Description | -| --- | --- | -| `list_components` | List documentation pages, optionally filtered by section or a substring. | -| `search_docs` | Search the documentation and return the best matching pages. | -| `get_doc_page` | Fetch the full Markdown of a page by slug, component name, or URL. | -| `get_component_api` | Get the structured API (props, events, slots) for a component. | -| `get_cross_framework_links` | Get documentation URLs for a component across every CoreUI framework. | - -## Configuration - -| Flag | Environment variable | Default | Description | -| --- | --- | --- | --- | -| `--framework ` | `COREUI_DOCS_FRAMEWORKS` | `bootstrap,react,vue` | Enabled editions (comma-separated). The first is the default for tools. | -| `--base-url ` | `COREUI_DOCS_BASE_URL` | `https://coreui.io` | Origin of the CoreUI site. The `//docs` path is appended automatically — override only for a staging or self-hosted mirror. | -| `--ttl ` | `COREUI_DOCS_TTL_MINUTES` | `360` | Cache freshness window. | -| — | `COREUI_DOCS_CACHE_DIR` | OS cache directory | On-disk cache location. | - -The package is open source and published as [`@coreui/docs-mcp`](https://www.npmjs.com/package/@coreui/docs-mcp). diff --git a/packages/docs/src/data/sidebar.yml b/packages/docs/src/data/sidebar.yml index 3ee21fc7..786c4513 100644 --- a/packages/docs/src/data/sidebar.yml +++ b/packages/docs/src/data/sidebar.yml @@ -5,8 +5,13 @@ to: /getting-started/introduction/ - title: Accessibility to: /getting-started/accessibility/ - - title: AI Tools (MCP) - to: /getting-started/ai-tools/ +- title: AI Tools + icon: + pages: + - title: LLMs.txt + to: /ai-tools/llms-txt/ + - title: MCP Server + to: /ai-tools/mcp/ - title: Customize icon: pages: