The Wensity MCP server.
Beta · @wensity/mcp@0.1.2The Wensity MCP server (@wensity/mcp) is a Model Context Protocol server for React UI components. It lets AI coding agents such as Claude Code, Cursor, GitHub Copilot in VS Code, and Codex search the Wensity library of React and Tailwind CSS components, primitives, and blocks, explain what each one does, plan an installation, and install the real source into your Next.js or React project.
Ask your agent for "animated testimonials" or "a pricing section" and it works from the live catalog instead of guessing. Installed components are plain source files in your project, with no Wensity runtime package to depend on.
The server runs on your machine over stdio, started by your MCP client with npx. It complements the Wensity CLI: both use the same install engine and write the same files, so an install from your agent matches npx wensity add.
- Package
- @wensity/mcp@0.1.2 on npm, MIT license
- Works with
- Claude Code, Cursor, VS Code, Codex, and any stdio MCP client
- Runs
- Locally over stdio, started by your client with npx
- Requires
- Node.js 20+, and a React 18+ project for installs
- Tools
- Six: five read only, one that installs
- Cost
- Free. Pro items need an active Pro license
What your agent can do
The server gives your agent four abilities, in the order a careful developer would use them.
Searches every component, primitive, block, and agent skill by need, name, category, tag, or npm dependency, and labels each one Free, Pro, or Needs Pro. Skills install into the folders your agents read; see Skills.
Returns the description, props, npm dependencies, usage snippet, and links to the live preview, without ever sending component source to the model.
Shows every file it would create or change, the Tailwind CSS token diff, and the exact package-manager command, so you can say no.
Re-checks the plan under a project lock, writes the files with rollback on a handled failure, then runs the planned dependency command.
Requirements
- Node.js 20 or newer, with
npxon yourPATH. - An MCP client that starts local stdio servers: Claude Code, Cursor, VS Code with GitHub Copilot agent mode, Codex, or any other.
- For installs, a React 18 or newer project. Wensity is built for Next.js and Tailwind CSS v4. Run
npx wensity initonce if the project has nowensity.json. - No account and no token for free items.
Set up your client
Every snippet pins an exact version, @wensity/mcp@0.1.2. That is deliberate: this server can write files into your project and run your package manager, so you choose when a new version gets those capabilities. See Updating.
Each client stores MCP servers in a slightly different place and format:
| Client | Config file | Format | Server key |
|---|---|---|---|
| Claude Code | .mcp.json | JSON | mcpServers |
| Cursor | .cursor/mcp.json | JSON | mcpServers |
| VS Code | .vscode/mcp.json | JSON | servers |
| Codex | ~/.codex/config.toml | TOML | [mcp_servers.wensity] |
The formats below were checked against each client's official documentation on 2026-10-11.
Claude Code MCP setup
Add the server to the current project from a terminal with claude mcp add:
claude mcp add --transport stdio --scope project wensity -- npx -y @wensity/mcp@0.1.2
That writes .mcp.json in the project root. You can also create the file yourself:
{"mcpServers": {"wensity": {"command": "npx","args": ["-y", "@wensity/mcp@0.1.2"]}}}
Claude Code asks you to approve a project server from .mcp.json the first time. Drop --scope project to add it for yourself only.
Cursor MCP setup
Create .cursor/mcp.json in the project, or ~/.cursor/mcp.json to use it in every project:
{"mcpServers": {"wensity": {"command": "npx","args": ["-y", "@wensity/mcp@0.1.2"]}}}
Then open Cursor Settings, find the server under MCP, and make sure it is enabled.
VS Code and GitHub Copilot MCP setup
VS Code uses servers, not mcpServers. Create .vscode/mcp.json in the workspace:
{"servers": {"wensity": {"type": "stdio","command": "npx","args": ["-y", "@wensity/mcp@0.1.2"]}}}
Start the server from the code lens VS Code shows in that file, then use it from Copilot Chat in agent mode.
Codex MCP setup
Codex reads TOML, not JSON. Add the server from a terminal:
codex mcp add wensity -- npx -y @wensity/mcp@0.1.2
Or add the table to ~/.codex/config.toml yourself. A trusted project can also use .codex/config.toml.
[mcp_servers.wensity]command = "npx"args = ["-y", "@wensity/mcp@0.1.2"]
Other MCP clients
Any client that starts a local stdio server works. Give it the command npx with the arguments -y and @wensity/mcp@0.1.2, in whatever format that client documents. No environment variables are needed for free items.
Check the connection
Restart the client (or reload its MCP servers), then ask:
Use the Wensity MCP server. Is it connected, and which Wensity tools do you have?
The agent should list six tools whose names start with wensity_. The first start can take a few seconds while npx downloads the package.
Authentication
Free components, primitives, and blocks need nothing. Pro items need a token from an account with an active Pro license, saved on your machine by the Wensity CLI:
- Create a token at ui.wensity.com/dashboard/tokens.
- In a terminal, run
npx wensity loginand paste the token at the prompt. - Ask your agent again. The MCP server reads the credential the CLI saved, so there is nothing to restart.
npx wensity login
A Wensity token unlocks paid source. Anything you type into an AI conversation can be stored in the chat history, sent to the model provider, and written to logs you do not control. The Wensity MCP server has no way to accept a token through the model, on purpose: no tool takes a token, and it only reads the file npx wensity login writes. If an agent ever asks you for a token, say no and use the terminal.
The CLI saves the token to ~/.config/wensity/credentials.json (or under $XDG_CONFIG_HOME/wensity/) with 0600 permissions, readable only by your user. A token is only ever sent to the Wensity origin it was issued for. To revoke one, delete it on the tokens page; it stops working on the next request. Run npx wensity logout to remove the saved file. More on tokens in the API tokens guide.
Free, Pro, and Needs Pro
Every item your agent shows you carries one of three labels, so you know before planning whether this machine can install it:
| Label | Meaning |
|---|---|
| Free | Anyone can install it. No account, no token. |
| Pro | A Pro item, unlocked on this machine: your saved token belongs to an account with an active Pro license. |
| Needs Pro | A Pro item this machine cannot install yet: no token saved, an account without an active Pro license, or access that could not be confirmed just now. |
Pro items are never hidden, so you can see everything Pro includes. When you pick a Needs Pro item, the agent says so before planning and suggests a free alternative when there is one.
To unlock Needs Pro items: if you already have Pro, run npx wensity login in a terminal. If you do not, see pricing. One Pro license unlocks every Pro component and block. The label is a hint; the Wensity API decides access again when you plan and when you install.
If the agent reports that your token was rejected (invalid, revoked, or its user deleted), that is not a Pro problem: create a new token and run npx wensity login again.
Example prompts
Talk to your agent the way you would describe the UI to a designer. These prompts work in any connected client.
Find a component
- Find a Wensity component for animated testimonials.
- Show me Wensity hero sections that are free.
- List all Wensity primitives.
- Which Wensity components use framer-motion?
Understand it before you install
- What does the Wensity <slug> component do, and what are its dependencies?
- Which props does <slug> take, and what does each one control?
Install with a plan
- Plan installing <slug> into this project, show me the plan, and wait for my OK.
- Install it.
- Show me the code of the component you just installed.
Replace <slug> with an item from a search result. The agent reads installed code from your project, not from Wensity, so "show me the code" works only after the install.
The six tools
Your agent picks these on its own. Five only read. wensity_install is the only one that changes your project, and your client marks it as a write so it can ask you first. There are no MCP resources or prompts.
| Tool | What it does |
|---|---|
| wensity_search | Searches components, primitives, and blocks by need, name, slug, category, tag, tier, kind, npm dependency, or similarity to another item. Each result has a Free, Pro, or Needs Pro label. |
| wensity_get_item | Public details for one item: description, usage snippet, props, npm dependencies, install command, and links to the detail page and live preview. It returns props, not code examples, and never source. |
| wensity_auth_status | Whether this machine has a Wensity credential and what it unlocks, with terminal instructions when it does not. |
| wensity_inspect_project | Reads your project setup: framework, language, package manager, aliases, Tailwind CSS file, cn helper, and installed Wensity files. Local only, and never returns file contents. |
| wensity_plan_install | Everything an installation would do, with nothing written: each file and its action, the Tailwind token diff, the npm packages and exact command, conflicts, and compatibility checks. |
| wensity_install | Runs one recorded plan, once, given only its plan token. Re-checks everything, writes the files, then runs the planned package-manager command. |
How an install works
Installing is always two calls, a plan and then the install, so nothing reaches your project until you have seen what will change.
The agent plans, and nothing is written
The agent calls
wensity_plan_install. Source is downloaded into the server process only, run through the same engine asnpx wensity add, and dropped. Your project does not change.You review the plan
The agent shows you the files, the dependency command, and the caveat that package-manager changes are not rolled back. You decide whether to continue.
The agent installs that exact plan
The agent calls
wensity_installwith the plan token. A plan expires after 10 minutes and runs at most once. Calling it again with the same token returns the first result, markedreplayed: true, and changes nothing.The server re-checks, then writes
Under a lock in
.wensity-tmp/, the server downloads the source again (so your access is checked again), confirms nothing changed since the plan, writes the files, and runs the planned command without a shell.
If anything changed since the plan (a file you edited, a new dependency, a different package manager), the install stops with nothing written and the agent plans again. If a write fails, every file is restored. Running the same install again reports that the item is already installed and changes nothing.
.wensity-tmp/ is removed after every install. Do not commit it.
New components appear automatically
The server contains no list of Wensity items. Every search asks the live site, so a component or block published to Wensity shows up for you within about a minute or two, with nothing to update, reinstall, or restart. The same goes for new categories, changed descriptions, changed dependencies, and items that move between Free and Pro.
A new version of @wensity/mcp is only needed when the server itself gains a new capability, such as a new tool.
Updating
Your configuration pins an exact version. To update, change the version in your client configuration and restart the client:
"args": ["-y", "@wensity/mcp@0.1.2"]
There is nothing to uninstall first: npx fetches the version you name.
The update notice. When a newer version is out, the agent passes on a one-time message such as:
A newer Wensity MCP (0.2.0) is available; you're on 0.1.2. Change `@wensity/mcp@0.1.2` to `@wensity/mcp@0.2.0` in your MCP config and restart your editor. No reinstall needed.
That is the whole change: one version number in your config. The server never updates itself, never edits your config, and keeps working while you decide. If a version is ever marked unsupported, the notice says so, and some installs may fail until you change it.
You can write @wensity/mcp@latest to always run the newest release. It is opt-in, not the default: @latest grants an unreviewed version file-write and package-manager capability every time your client starts.
Uninstalling
- Remove the
wensityentry from your client configuration (or runclaude mcp remove wensity, orcodex mcp remove wensity), then restart the client. - Optionally run
npx wensity logoutto delete the saved credential. - Files the server installed are ordinary source files in your project. Keep or delete them like any other code.
Configuration
Nothing is required. These environment variables go in the env block of your client configuration when you need them:
| Variable | Purpose |
|---|---|
| WENSITY_MCP_PROJECT_PATH | Your project root, for clients that start the server somewhere else. A path the agent passes to a tool wins over it. |
| WENSITY_API_URL | The Wensity API origin. Defaults to https://ui.wensity.com. Must be HTTPS, or HTTP on localhost. |
| WENSITY_CREDENTIALS_FILE | Where to read the CLI credential from, if you moved it. |
| WENSITY_MCP_LOG_LEVEL | silent, error, warn (default), info, or debug. Logs go to stderr, which your client shows in its MCP log. |
| WENSITY_MCP_TIMEOUT_MS | Per-request timeout. Defaults to 20000. |
Security
Your token and your code
- Authenticate only in a terminal with
npx wensity login. No tool accepts a token. The credential file lives at~/.config/wensity/credentials.jsonwith0600permissions; revoke a token on the tokens page. - The server sends no analytics or telemetry and contacts no host other than the Wensity API. Requests carry a
User-Agentofwensity-mcp/<version>and anX-Wensity-Client: mcpheader, covered by Wensity's normal server logs. - Your search queries, file contents, and project paths are never logged, and nothing about your project is sent to Wensity. Project inspection is local.
- Component source is never returned to the AI agent and never cached. It goes from the Wensity API into your project files during an install.
- Package-manager operations are not transactional and may run dependency lifecycle scripts. The exact command is shown in the plan before it runs.
Reporting a vulnerability
To report a vulnerability, email hey@wensity.com with "Security" in the subject. Please report it privately by email and don't post the details publicly. We acknowledge reports within 3 business days and ask for up to 90 days to fix an issue before it is disclosed publicly.
Known limitations
These are the edges to know about before you rely on the server, each with what to do about it.
| Limitation | What to do |
|---|---|
| Package-manager changes are not rolled back | Wensity's own file writes are rolled back on a handled failure, but package.json, the lockfile, node_modules, and dependency lifecycle scripts are not. The exact command is shown in the plan before it runs, so read it there. |
| File writes are not crash-safe | If the process is killed mid-install (SIGKILL, power loss, a container stop), the next run blocks with a recovery message listing the journal path, the affected files, and which backups exist. Follow its steps and check git diff before deleting anything. |
| Windows file replacement is not atomic | Nothing to do. Wensity always writes a backup before replacing a file, so recovery stays possible either way. |
JavaScript projects receive .tsx files | Wensity source is TypeScript. Make sure your build compiles TypeScript and TSX. |
wensity_get_item returns props, not code examples | Examples are on the item's detail page, which the result links to. |
| Dependency search covers components only | Block metadata has no npm dependency list, so the dependency filter skips blocks. A block's dependencies are resolved and shown in its plan. |
| Templates cannot be installed | Templates are standalone projects. Get them from the templates page. |
| Free source updates follow a deploy | The public source route is statically generated, so a change to a free component's source becomes visible after the next Wensity deploy. |
| Renamed or removed items do not redirect | A removed slug returns "not found" with suggestions. Search again by what you need. |
| No formatting or type-checking after install | Ask your agent to run your formatter, linter, and type checker once the files are in. |
After an interrupted install, the .wensity-tmp journal may hold the only copy of your original file. Follow the recovery steps in the message, verify with git diff, and only then delete it.
Frequently asked questions
What is an MCP server for UI components?
An MCP server for UI components connects an AI coding agent to a component library through the Model Context Protocol (MCP), the open standard agents use to call outside tools. Instead of writing a component from memory, the agent searches the real catalog, reads each item's props and dependencies, and installs the actual source. The Wensity MCP server does this for Wensity's React and Tailwind CSS components, primitives, and blocks.
Is the Wensity MCP server free?
Yes. The server is published on npm under the MIT license, and every free Wensity item installs without an account or a token. Pro components and blocks need an active Wensity Pro license, which you connect by running npx wensity login in a terminal.
Which AI coding tools does it work with?
Claude Code, Cursor, VS Code with GitHub Copilot agent mode, Codex, and any other MCP client that can start a local stdio server.
Do I need Next.js to use it?
No. Wensity components and blocks are built for Next.js with the App Router and Tailwind CSS v4, and they work in any React 18 or newer app. Before anything is written, the plan checks your project: React older than 18, or import aliases that do not resolve, stop the install, while differences such as an older Tailwind CSS version come back as warnings.
Can the AI model see the source code of Pro components?
No. Source never appears in anything the server returns to the model. During an install it goes straight from the Wensity API into your project files.
Does it send my project code to Wensity?
No. Project inspection runs on your machine and never returns file contents, and the server sends no analytics or telemetry.
How is the MCP server different from the Wensity CLI?
They share one install engine and write the same files, so an install from your agent matches npx wensity add. Use the CLI when you type the commands yourself. Use the MCP server when you want your AI agent to find the right component, show you a plan, and install it for you. The MCP server reads the login the CLI saves, so you sign in once.
Is this the same as the shadcn MCP server?
No. The Wensity MCP server is a separate server for the Wensity catalog, including Pro items and blocks, and it installs through the same engine as the Wensity CLI. Free Wensity components are also published to a public shadcn registry under the @wensity namespace for shadcn workflows. Pro components are never published there.
Do I need to update the server when Wensity adds new components?
No. Every search reads the live Wensity catalog, so new components and blocks reach your agent within about a minute or two.
Troubleshooting
The server does not appear, or shows as failed
First run npx -y @wensity/mcp@0.1.2 --version in a terminal. It should print 0.1.2 and exit; if it fails, the problem is Node or npx, not your client config. Then run npx -y @wensity/mcp@0.1.2 without the flag. It should wait silently for input (press Ctrl+C to stop). If it errors, check that node --version is 20 or newer and that npx works. Then restart the client, and in Claude Code run /mcp, or claude mcp list from a terminal. The first start downloads the package and can be slow; in Codex, raise startup_timeout_sec in the [mcp_servers.wensity] table if it times out.
"Needs Pro" on an item you paid for
Run npx wensity whoami in a terminal. If it shows no Pro plan or no saved token, run npx wensity login with a token from the account that holds the license. The server rechecks your access at most once a minute, so ask again after a moment.
"Token rejected" or "create a new token"
The saved token is invalid, revoked, or belongs to a deleted user. Create a new token on the tokens page and run npx wensity login again in a terminal.
The agent picks the wrong project, or says the project is ambiguous
The server looks for your project in this order: a path the agent passes, WENSITY_MCP_PROJECT_PATH, a workspace root your client shares, then the directory the client started it in. It never guesses your home directory. Ask the agent to pass your project path, or set WENSITY_MCP_PROJECT_PATH in the client configuration.
"Plan stale" or "plan expired"
Something changed since the plan was made, or more than 10 minutes passed. Ask the agent to plan again. Nothing was written.
"Recovery required"
A previous install was interrupted. Follow the numbered steps in the message, check git diff, and only then delete the .wensity-tmp journal it names. See Known limitations.
"Installed with a dependency failure"
The files were written but the package-manager command failed. Run the command shown in the result yourself; the files stay in place.
"Rate limited" or "network error"
Wait the number of seconds the agent reports and retry. The limits are 60 requests per minute per IP for /api/registry and /api/blocks, and 120 per minute per token for /api/cli/*. You will rarely reach them: the server keeps the catalog in memory for 60 seconds, so a burst of searches makes one request. After several failures in a row the server pauses for 30 seconds instead of hanging your agent.