The Wensity MCP server.
@wensity/mcp connects your AI coding agent to Wensity. Ask Claude Code, Cursor, VS Code, or Codex for "animated testimonials" or "a pricing section" and the agent can search the live Wensity library, explain what an item does, check what your machine can install, show you an installation plan, and then install exactly that plan into your project.
It 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.
What it does
Searches every component, primitive, and block by need, name, category, tag, or npm dependency, and labels each one Free, Pro, or Needs Pro.
Returns the description, props, dependencies, usage snippet, and links to the live preview, without sending component source to the model.
Shows every file it would create or change, the Tailwind 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+ 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
Each snippet pins an exact version, @wensity/mcp@0.1.0. 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.
The formats below were checked against each client's official documentation on 2026-10-11.
Claude Code
Add the server to the current project from a terminal:
claude mcp add --transport stdio --scope project wensity -- npx -y @wensity/mcp@0.1.0
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.0"]}}}
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
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.0"]}}}
Then open Cursor Settings, find the server under MCP, and make sure it is enabled.
VS Code
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.0"]}}}
Start the server from the code lens VS Code shows in that file, then use it from Copilot Chat in agent mode.
Codex
Codex reads TOML, not JSON. Add the server from a terminal:
codex mcp add wensity -- npx -y @wensity/mcp@0.1.0
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.0"]
Other clients
Any client that starts a local stdio server works. Give it the command npx with the arguments -y and @wensity/mcp@0.1.0, 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; 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:
| 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
- Find a Wensity component for animated testimonials.
- List all Wensity primitives.
- What does the Wensity <slug> component do, and what are its dependencies?
- Show me Wensity hero sections that are free.
- Which Wensity components use framer-motion?
- Plan installing <slug> into this project, show me the plan, and wait for my OK.
- Install it.
Replace <slug> with an item from a search result. After an install, ask "show me the code" and the agent reads the installed file from your project.
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. 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
- The agent calls
wensity_plan_install. Source is downloaded into the server process only, run through the same engine asnpx wensity add, and dropped. Nothing in your project changes. - The agent shows you the plan: the files, the dependency command, and the caveat that package-manager changes are not rolled back. You decide.
- The agent calls
wensity_installwith the plan token. Plans expire after 10 minutes and run at most once. - Under a lock in
.wensity-tmp/, the server downloads the source again (so 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.0"]
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.0. Change `@wensity/mcp@0.1.0` 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. |
Privacy
- 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.
Security
- 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. - Package-manager operations are not transactional and may run dependency lifecycle scripts. The exact command is shown in the plan before it runs.
- Pin an exact version (see Updating).
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.
Rate limits
| Endpoint | Limit |
|---|---|
| /api/registry, /api/blocks | 60 requests per minute per IP |
| /api/cli/* | 120 requests per minute per token |
You will rarely get near them: the server keeps the catalog in memory for 60 seconds, so a burst of searches makes one request. When a limit is hit, the agent is told how long to wait.
Known limitations
- The Wensity credentials file is plaintext at mode 0600 — the same as the CLI and most developer tools.
- Never paste a Wensity API token into an AI conversation or a tool argument. Authenticate with
npx wensity loginin a terminal; the Wensity MCP server reads the credential the CLI wrote and provides no way to submit a token through the model. - The Wensity MCP server does not return component source to the AI agent. Source is written to your project during installation, after which your agent can read it like any other file.
- Package-manager operations are not rolled back. Wensity's own file writes are rolled back on a handled failure, but
package.json, the lockfile,node_modules, and any dependency lifecycle scripts are not. The exact command is always shown before it runs. - Wensity's file writes are not crash-safe. If the process is killed (
SIGKILL, power loss, a container stop), an installation can be left incomplete. Wensity detects this on the next run and blocks with a recovery message listing the journal path, the affected files, and which backups exist. Do not delete a.wensity-tmpjournal that Wensity has reported — it may hold the only copy of your original file. Follow the recovery steps, verify withgit diff, then delete it. - On Windows, replacing an existing file is not guaranteed to be atomic. Wensity always writes a backup before attempting a replacement, so recovery remains possible either way.
- Pin an exact
@wensity/mcpversion in your client configuration. This server can write files into your project and run your package manager;@latestwould grant those capabilities to an unreviewed release on every launch. To update, bump the pinned version and restart your client. - The MCP server sends no separate analytics or telemetry requests and contacts no host other than the configured Wensity API origin. Normal Wensity API requests include the documented
User-AgentandX-Wensity-Client: mcpidentifier and are covered by Wensity's existing server-side logging and retention policy. - JavaScript-only projects receive
.tsxfiles, because Wensity source is TypeScript. - Templates cannot be installed through MCP.
- Free component source updates become visible after a Wensity deploy (the public source route is statically generated).
- Renamed or removed items do not redirect; a removed slug returns "not found" with suggestions.
- Block metadata does not include an npm dependency list, so
dependencysearch filters components only. Block dependencies are resolved and shown at plan time. wensity_get_itemreturns the item's description, dependencies, usage snippet, and props — not its code examples. Those are rendered on the linked detail page.- Formatting and type-checking after installation are your agent's responsibility.
Troubleshooting
The server does not appear, or shows as failed
Run npx -y @wensity/mcp@0.1.0 in a terminal. It should wait silently for input (press Ctrl+C to stop). If it errors, check 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 limitation 5 above.
"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. After several failures in a row the server pauses for 30 seconds instead of hanging your agent.