Skip to content

Using with AI

Let your coding agent find, read about and install Knowns UI. Connect the MCP server, point it at one item's JSON, or give it the docs as llms.txt. Free items need no key.

On this page

The MCP server

A remote MCP server at https://knowns-ui.com/mcp (Streamable HTTP). It answers from these docs: what each item is for, when to use it and when not, props, examples and the install command.

ToolArgumentsKey neededReturns
list_componentskind?, category?, tier?NoEvery component and block with its tier and a one-line description.
search_componentsquery, limit?NoFinds items by what you need, such as "approve a tool call" or "date picker".
search_docsquery, limit?, kind?For Pro detailSearch across all the docs: the passages that answer a question, with links.
get_componentname, include_source?For Pro detailDescription, when to use, install command, dependencies, usage, props and, on request, the source.
get_install_instructionsnames[]NoThe npx knowns-ui@latest add command for several items, plus npx knowns-ui@latest login when one of them is Pro. The shadcn command comes last, labelled as a fallback.

Without a key, Free items come back in full and Pro items as a summary marked as needing a license. With a key you get Pro props, examples and source. Calls are limited to 300 an hour per IP address without a key, and 2,000 an hour per key.

search_docs finds the passages that answer a question, such as “show approvals inside the chat thread”. Exact names work too: useAgentRun, onDecision. It only retrieves; your own model writes the answer. Narrow it with kind: component, guide, example or prop.

AccessSearchesWhat comes back
No key50 a day per IP addressFree docs in full; Pro passages as a short summary.
Pro or Monthly key1,000 a dayEverything in full.
Team key1,000 a day per memberEverything in full.

Past the limit, searches fall back to keyword results and say so. Limits reset at 00:00 UTC.

Connect your client

Terminal
claude mcp add --transport http knowns-ui https://knowns-ui.com/mcp
# With a Pro license
claude mcp add --transport http knowns-ui https://knowns-ui.com/mcp --header "Authorization: Bearer YOUR_LICENSE_KEY"

Add --scope user to use it in every project. Run /mcp to check the connection.

npx knowns-ui@latest mcp --client cursor (or claude, vscode) prints the config for your client, with the key as an environment reference. Other clients that speak MCP over Streamable HTTP can use the same URL, with the key as a Bearer header.

With the shadcn MCP server

The shadcn CLI has its own MCP server that browses and installs from the registries in your components.json. Add the Knowns UI Pro registry (see Installing Pro), then set it up for your client:

Terminal
npx shadcn@latest mcp init --client claude

One item by address

Every Free item is a JSON file at https://ui.knowns.dev/r/<name>.json with its description, dependencies and source, the same file the CLI installs. Paste the address into any assistant, no MCP needed. Pro items need a key; ask through the MCP server instead.

Prompt
Read https://ui.knowns.dev/r/approval-prompt.json and add an approval step before my
agent runs a shell command. Install it with
npx shadcn@latest add @knowns-ui/approval-prompt
and wire onDecision to my tool runner.

Install with AI

Every Installation section has a With AI tab next to CLI and Manual. It holds one prompt for your coding agent, built from the registry item: check the project, add the registry, run the exact command, handle overwrite prompts, and verify. For Pro items the agent asks you to put your key in .env.local yourself; the key is never in the prompt. Free items also get a usage snippet. This is the prompt for Approval Prompt:

Install prompt
Install Approval prompt from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.

Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/approval-prompt

1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).

2. Run:
```bash
npx knowns-ui@latest add approval-prompt
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/icons/actor-icon.tsx
- lib/knowns/icons/model-icons.tsx
- lib/knowns/icons/tool-icons.tsx
- lib/knowns/icons/model-icons.data.ts
- lib/knowns/icons/tool-icons.data.ts
- lib/knowns/icons/LICENSES.md
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/code-block/code-block.tsx
- components/ui/knowns/code-block/code-block-utils.ts
- components/ui/knowns/approval-prompt/approval-prompt.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.

3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.

4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.

5. Use it. A starting point from the docs:
```tsx
import { useAgentRun } from "@/lib/knowns/run";
import { ApprovalPrompt } from "@/components/ui/knowns/approval-prompt/approval-prompt";

export function Approvals() {
  const run = useAgentRun();
  return <ApprovalPrompt run={run} onDecision={(a, d) => console.log(a.id, d)} />;
}
```
Adapt it to my data, and ask me if anything about my data is unclear.

If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "approval-prompt" }) or search_docs for details.

Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.

On every page

Copy page copies the page as Markdown. The Copy prompt button under the install command copies a prompt that installs the item and wires its props to your own data; the MCP server returns the same text from get_component. Copy page for AI copies a brief for your assistant: what the item is, when to use it, the install command, the import, the props and an example. Open in Claude, ChatGPT or Cursor starts a chat with a shorter brief. For assistants that read docs as text, /llms.txt indexes every page and /llms-full.txt holds the docs in one file, without component source.

Need help?

Stuck on Using with AI, or found something off? We read every message.