capy-mcp
v1.1.2
Published
MCP server that inspects a repo, returns a structured /preview brief, and writes a design-system JSON artifact for AI coding agents
Maintainers
Readme
capy-mcp
capy-mcp is a stdio MCP server that inspects a React or Next.js repo and returns a structured brief for building or updating a local /preview route.
It does not generate the preview page itself. It gives an AI coding agent the repo map, inspection order, constraints, warnings, and target preview file so the agent can implement /preview in the host app.
What it exposes
The server currently registers three MCP tools:
get_preview_briefupdate_previewget_design_system
The tool accepts:
task:"build_preview"or"update_preview"changedFiles?: a list of changed files to bias incremental updatesuserGoal?: the end-user request so the brief stays aligned with the task
The tool returns structured content with:
project_factsinspection_planconstraintsdeliverable_specupdate_strategywarningsinstructions
get_design_system writes a stable JSON artifact, by default at .capy/design-system.json, and returns a summary plus the artifact contents. This file is meant to be the machine-readable source of truth that later coding sessions can load before making UI changes.
update_preview writes .capy/preview-state.json, diffs the current repo against the prior snapshot, refreshes .capy/design-system.json, and returns an incremental /preview update brief. This works even if the repo is not using git.
Install
npm install capy-mcpRun it directly:
npx capy-mcpMCP config
Example stdio MCP config:
{
"mcpServers": {
"capy": {
"command": "npx",
"args": ["-y", "capy-mcp"]
}
}
}Library usage
import {
buildDesignSystemArtifact,
buildPreviewBrief,
buildPreviewStateSnapshot,
detectFramework,
runPreviewUpdate,
writeDesignSystemArtifact,
writePreviewStateSnapshot,
} from "capy-mcp";
const framework = await detectFramework(process.cwd());
const brief = await buildPreviewBrief(process.cwd(), {
task: "build_preview",
});
const designSystem = await buildDesignSystemArtifact(process.cwd());
await writeDesignSystemArtifact(process.cwd());
const previewState = await buildPreviewStateSnapshot(process.cwd());
await writePreviewStateSnapshot(process.cwd(), ".capy/preview-state.json", previewState);
const update = await runPreviewUpdate(process.cwd());Local development
npm install
npm test
npx capy-mcpPublish checklist
npm test
npm publishIf capy-mcp is not owned by your npm account, rename the package before publishing.
