Installing a Module via AI
This guide explains how to use Claude Code with the shadcn MCP server to browse, install, and fully wire @saas registry modules — hands-free. The AI agent handles the shadcn CLI install, reads the module.manifest.json, and drives all post-install steps using the module's paired install-* skill.
Prerequisites
- Claude Code installed and running in this repo
- Node.js >= 18
next-app/dependencies installed:pnpm installinsidenext-app/- Dev server running locally:
pnpm devinsidenext-app/(registry endpoint athttp://localhost:3000/r)
1. MCP Server Configuration
The repo ships a .mcp.json at the root that connects Claude Code to the local @saas registry:
{
"mcpServers": {
"shadcn": {
"command": "npx",
"args": ["-y", "@shadcn/mcp-server@latest"],
"env": {
"REGISTRY_URL": "http://localhost:3000/r",
"REGISTRY_NAME": "saas"
}
}
}
}Claude Code auto-discovers .mcp.json at session start — no manual init needed.
2. Browse Available Modules
Ask Claude Code to list available modules:
"What @saas modules are available?"
The agent will invoke the shadcn MCP list tool against http://localhost:3000/r/registry.json and display the catalog. You can also browse the Module Catalog in these docs.
Inspect a specific module before installing:
curl http://localhost:3000/r/landing.json | jq '{name, title, registryDependencies, envVars: .files[].target}'3. Install a Module
Option A — AI-driven (recommended)
Tell Claude Code to install the module:
"Install @saas/account"
The agent will:
- Run
npx shadcn@latest add @saas/accountfromnext-app/ - Confirm the files landed in the correct target paths
- Parse
module.manifest.jsonfor wiring requirements - Invoke the paired
install-accountskill automatically
Option B — Manual CLI install
cd next-app
npx shadcn@latest add @saas/accountThen invoke the install skill in Claude Code:
/install-account4. Paired install-* Skills
Every @saas module has a companion Claude Code skill that drives the post-install wiring.
| Module | Install Skill |
|---|---|
@saas/landing | /install-landing |
@saas/account | /install-account |
@saas/admin | /install-admin |
@saas/billing-stripe | /install-stripe-billing |
@saas/billing-ecpay | /install-ecpay-billing |
@saas/hello-module | (no post-install steps) |
Each skill:
- Reads
module.manifest.jsonto verify allfiles[].targetpaths exist - Checks for required env vars in
.env.local - Runs DB migrations if
dbTablesis non-empty - Walks through each
postInstallstep in order - Confirms
pnpm typecheck && pnpm lintpass before declaring success
5. What Gets Installed
When you run npx shadcn@latest add @saas/<id>, the shadcn CLI:
- Downloads the item JSON from
http://localhost:3000/r/<id>.json - Resolves and installs
registryDependencies(shadcn/ui components or other@saas/*modules) - Writes all module files to their
targetpaths insidenext-app/ - Installs any
npmDependencieslisted in the manifest (via pnpm)
The install-* skill then handles everything the CLI cannot do automatically:
- Setting env vars
- Running DB migrations (Drizzle Kit)
- Manual wiring (sidebar nav, branding, pricing tiers)
- Verification (
typecheck+lint)
6. End-to-End Example — Install @saas/landing
Tell Claude Code:
"Install the landing page module and wire it up."
What the agent does:
Step 1 — Browse: Queries http://localhost:3000/r/landing.json. Sees:
registryDependencies:["button", "badge", "card"]envVars: []— no secrets neededdbTables: []— no migrations
Step 2 — Install:
cd next-app && npx shadcn@latest add @saas/landingExpected output:
Installing registry dependencies: button, badge, card
Installing @saas/landing...
+ components/marketing/hero.tsx
+ components/marketing/features.tsx
+ components/marketing/pricing.tsx
+ app/(marketing)/layout.tsx
+ app/(marketing)/page.tsx
Done.Step 3 — Read manifest:
cat next-app/registry/landing/module.manifest.json | jq '.postInstall[].description'Step 4 — Invoke skill:
/install-landingThe skill walks through:
- Pre-flight: confirms
app/(marketing)/page.tsxexists - Remove placeholder: archives
app/page.tsx - Branding: updates site name in
marketing-nav.tsxandmarketing-footer.tsx - Hero copy: updates headline/subheadline
- Verify: runs
pnpm typecheck && pnpm lint
Step 5 — Verify:
cd next-app && pnpm dev
# open http://localhost:3000The landing page renders at / with full dark mode support.
7. Uninstall
The registry/MCP provide no automated uninstall. Each module's docs page includes a manual uninstall checklist derived from its
module.manifest.json.
To uninstall, follow the "Uninstall (Manual Checklist)" section in the module's docs page:
- Delete files listed in
module.manifest.json→files - Drop DB tables via a down-migration (
pnpm db:generate+ edit the SQL) - Unset env vars from
.env.localand your deployment environment - Remove npm packages if no longer needed
8. Hosted Registry
If the registry is hosted (Cloudflare Pages / Zeabur), update .mcp.json and next-app/components.json:
{
"mcpServers": {
"shadcn": {
"command": "npx",
"args": ["-y", "@shadcn/mcp-server@latest"],
"env": {
"REGISTRY_URL": "https://your-registry.example.com/r",
"REGISTRY_NAME": "saas",
"REGISTRY_TOKEN": "${SAAS_REGISTRY_TOKEN}"
}
}
}
}The install command remains the same — npx shadcn@latest add @saas/<id>.
Reference
| Path | Purpose |
|---|---|
.mcp.json | MCP server config — points shadcn MCP at the @saas registry |
next-app/public/r/registry.json | Registry index — lists all available modules |
next-app/public/r/<module>.json | Per-module item JSON |
next-app/registry/<module>/module.manifest.json | Manifest — env/db/post-install wiring spec |
.claude/skills/install-<module>/SKILL.md | Paired install skill for each module |
See Also
- Module Catalog — all available
@saasmodules - Authoring a Module — build a new module