MCP setup
The Shavin MCP server gives your AI agent 32 tools for looking up, planning, checking and building Shavin UI. It runs locally through npx; no account or API key is needed.
Claude Code
claude mcp add shavin -- npx -y @shavin/mcpOr commit a .mcp.json in your project root so the whole team gets it. npx @shavin/cli init writes this file for you.
{
"mcpServers": {
"shavin": { "command": "npx", "args": ["-y", "@shavin/mcp"] }
}
}Cursor
Add the same block to .cursor/mcp.json. init writes this file too.
VS Code
VS Code uses a servers key in .vscode/mcp.json. init writes this file for you:
{
"servers": {
"shavin": { "type": "stdio", "command": "npx", "args": ["-y", "@shavin/mcp"] }
}
}Check it works
Ask your agent to run inspect_environment. It reports a setup score and what is missing: the package, Tailwind wiring, ThemeProvider, SHAVIN.md, AGENTS.md and the skills.
The tools
| Group | What for | Tools |
|---|---|---|
| Plan | Turn a brief into a section-by-section page plan, and check the page against it | plan_pagecheck_page |
| Look up | Real props, tokens, blocks and project settings instead of guesses | get_project_contextget_componentsget_tokensget_block_templateget_studio_schemaget_guidelinesget_setup_instructions |
| Skills | Load the playbook for the task at hand | list_skillsget_skillget_skill_modelist_commandsinstall_skills |
| Check and fix | Validate snippets and files, fix what can be fixed, score the setup | validate_codeaudit_sourceautofix_codeinspect_environmentshavin_steersynthesize_layout |
| Live page | Read problems from the page running in your browser | get_live_audittrigger_live_rescanwait_for_live_clean |
| Studio | Build on a Shavin Studio canvas while you watch | connect_studiocompose_to_canvasinject_blocksget_studio_stateset_studio_themeclear_studio_canvasdisconnect_studio |
How agents combine them is in Working with AI.
Live audit
The live tools read from a small local server, the bridge, that receives audit results from the Shavin inspector in your browser. init wires it to start with your dev server. To wire it by hand:
// next.config.mjs
import { withShavinBridge } from "@shavin/mcp/next";
export default withShavinBridge({ /* your Next config */ });
// vite.config.ts
import { shavinBridge } from "@shavin/mcp/vite";
export default defineConfig({ plugins: [shavinBridge()] });The bridge listens on port 7036. The Next.js and Vite wrappers only start it in development, and SHAVIN_BRIDGE=0 turns them off. You can also run npx @shavin/cli bridge in a separate terminal; add --port to use another port.