Vue Harvest

io.github.virgilvoxPublished by GitHub account virgilvoxv0.0.3Updated Oct 24, 2026

Extract reusable component libraries and design tokens from Vue applications

VerifiedSTDIODesktop onlyDeveloper ToolsMedia & Design

Overview

AI-generated overview

Analyzes a Vue project to find reusable components and design tokens, and gives an assistant tools to reason about hard-to-extract components.

What you can do
  • Run the full analysis pipeline on a Vue project path and list components filtered by tier or confidence
  • Inspect a single component with its props, emits, slots, dependencies and coupling issues
  • Extract components into standalone bundles, including a rewrite-and-extract option
  • Deep-analyze coupling and generate before/after refactor suggestions or composable wrappers for store-bound components
  • Triage reviewable components in batch and produce a project-wide coupling report
  • Extract design tokens (colors, typography, spacing, radii, shadows) and return them filtered by type
When to use it
Useful when you want to lift a component library or design system out of an existing Vue application, or when a component sits in the 30-70% confidence band and needs judgment about decoupling from stores, routers or i18n before extraction.
Requirements
Runs as a local stdio process on the desktop, installed from the npm package vue-harvest-mcp (Node.js). It reads a Vue project directory on the local machine, including .vue files and tsconfig.json for path aliases. No accounts, API keys or environment variables are declared.
Before you install
Analysis and extraction write output into the project, by default a .vue-harvest directory containing extracted component bundles, registry, catalog and reports. Extraction rewrites import paths and can be forced past the confidence threshold, so review generated bundles before adopting them. The assistant reads source code from the analyzed project.

Installation

In SourceWeft

  1. Open Vue Harvest in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

vue-harvest

Point it at a Vue project. It finds every component, figures out which ones are reusable, and extracts them. It also pulls out your design tokens (colors, spacing, typography) and gives you a visual report.

The hard cases that need judgment (store-coupled components, ambiguous dependencies) get handled by an MCP server that feeds structured analysis to an LLM.

What it does

Component extraction. Parses every .vue file in a project using @vue/compiler-sfc. For each component it extracts the full interface (props, emits, slots), maps out the dependency graph, detects coupling issues, and scores a confidence level for safe extraction. Components above the threshold get auto-extracted into standalone bundles with rewritten imports and a manifest of peer dependencies.

Design token extraction. Scans all CSS (scoped styles, standalone stylesheets) and pulls out colors, font families, font sizes, font weights, spacing values, border radii, and shadows. Outputs a CSS custom properties file, a JSON dump, and a visual HTML explorer showing swatches and scales.

MCP server. Twelve tools that give an LLM the structured data it needs to reason about the harder cases: components in the 30-70% confidence range that could be extracted with some refactoring. The LLM can deep-analyze coupling, generate decoupling suggestions with before/after code, create composable wrappers for store-bound components, and do full rewrite-and-extract in one shot.

Install

bash
npm install -g vue-harvest
# or run directlynpx vue-harvest analyze ./my-app

For the MCP server:

bash
npm install -g vue-harvest-mcp

CLI

vue-harvest analyze [path]

Full analysis pipeline. Discovers .vue files, parses interfaces, builds the dependency graph, classifies every component, auto-extracts the safe ones, and generates a registry + catalog.

bash
vue-harvest analyzevue-harvest analyze ./path/to/projectvue-harvest analyze --threshold 60vue-harvest analyze --output ./harvestedvue-harvest analyze --json | jq '.summary'

Output goes to .vue-harvest/ by default:

.vue-harvest/  registry.json       Component registry (shadcn-compatible format)  catalog.html        Browsable catalog with tier filters  analysis.json       Full analysis dump for the MCP server  SUMMARY.md          Human-readable report  components/         Extracted component bundles    Button/      Button.vue      manifest.json    Card/      Card.vue      manifest.json

vue-harvest list [path]

Lists all components sorted by extraction confidence.

bash
vue-harvest listvue-harvest list --tier primitivevue-harvest list --json

vue-harvest inspect <name>

Full breakdown of a single component: props, events, slots, dependencies, coupling issues, style analysis.

bash
vue-harvest inspect Buttonvue-harvest inspect UserProfileCard --json

vue-harvest extract <name>

Extracts a specific component and all its local dependencies into a standalone bundle.

bash
vue-harvest extract Buttonvue-harvest extract UserProfileCard --forcevue-harvest extract Card --output ./my-components

vue-harvest tokens [path]

Extracts design system tokens from the project.

bash
vue-harvest tokensvue-harvest tokens --jsonvue-harvest tokens --output ./design-system

Outputs:

  • tokens.css with CSS custom properties
  • tokens.json with the full token dataset
  • design-system.html with a visual explorer (color swatches, font scales, spacing visualization)

vue-harvest init

Creates a harvest.config.json with detected project settings.

Configuration

Optional. Place a harvest.config.json in the project root:

json
{  "include": ["**/*.vue"],  "exclude": [    "node_modules/**",    "dist/**",    "**/*.test.*",    "**/*.story.*"  ],  "extractionThreshold": 70,  "outDir": ".vue-harvest",  "registry": "json"}

Path aliases are auto-detected from tsconfig.json. If your project has @ mapped to ./src, vue-harvest picks that up.

Component classification

Every component gets classified into a reusability tier based on its interface, dependencies, and coupling:

TierConfidenceWhat it means
Primitive85-100%Pure UI, no business logic. Button, Input, Card.
Composite70-85%Built from primitives, minimal logic. FormField, DataTable.
Feature50-70%Has business logic but potentially reusable. UserAvatar, SearchBar.
Page-bound30-50%Tightly coupled to a specific page or route.
App-specific0-30%Deeply coupled to app state. Not reusable as-is.

Components at or above the extraction threshold (default 70%) are auto-extracted. The 30-70% band is where the MCP server comes in.

Coupling issues

The analyzer detects these coupling patterns:

IssueSeverityDescription
direct-store-accesswarningImports a Pinia/Vuex store directly
hardcoded-apiwarningContains hardcoded API endpoint URLs
router-dependencyinfoUses vue-router
i18n-dependencywarningUses vue-i18n
global-injectwarningUses inject() for app-level provides
env-variablewarningReferences import.meta.env
unscoped-csswarningHas unscoped styles that leak globally
deep-provide-chainwarningRelies on provide/inject chains
implicit-globalwarningUses globally registered components without importing them
side-effect-importwarningHas imports that execute side effects

MCP server

Setup with Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "vue-harvest": {      "command": "vue-harvest-mcp"    }  }}

Setup with Claude Code

bash
claude mcp add vue-harvest vue-harvest-mcp

Available tools

ToolWhat it does
analyze-projectRuns the full pipeline on a project path
list-componentsLists components with filters (tier, confidence range)
inspect-componentFull analysis with source code
extract-componentExtracts with force option
deep-analyzeStructured coupling analysis for LLM reasoning
suggest-refactorBefore/after code for decoupling
generate-wrapperCreates composable wrappers for store-bound components
adapt-and-extractFull rewrite + extract in one step
batch-triagePrioritizes all reviewable components with effort estimates
coupling-reportProject-wide coupling patterns
analyze-design-systemExtracts design tokens
get-design-tokensReturns tokens filtered by type

Resources

The server exposes these as MCP resources after analysis:

  • harvest://registry : full registry JSON
  • harvest://graph : dependency graph
  • harvest://summary : analysis summary
  • harvest://component/{name} : individual component analysis
  • harvest://design-system : extracted design tokens

Prompts

  • analyze-new-project : guided first analysis
  • extraction-sprint : batch refactor and extract session
  • refactor-component : single component deep refactor
  • extract-design-system : design token extraction and analysis

Example conversations

"Analyze my Vue project at /Users/me/projects/my-app"

"Show me all the components that need review"

"Deep analyze the UserProfileCard component and suggest how to decouple it from the auth store"

"Do an extraction sprint, go through all reviewable components and extract what you can"

"Extract the design system tokens and recommend a naming convention"

Programmatic API

vue-harvest exports its analysis engine for use in other tools:

typescript
import { analyze, writeOutput, analyzeTokens } from 'vue-harvest'
const report = await analyze('./my-vue-app', {  extractionThreshold: 0.6,})
console.log(report.summary)// { totalFiles: 42, analyzed: 40, autoExtracted: 12, needsMCP: 8, ... }
await writeOutput(report)
// Design tokensconst tokens = await analyzeTokens('./my-vue-app')console.log(tokens.palette)    // [{ hex: '#3b82f6', usageCount: 14 }, ...]console.log(tokens.spacing)    // ['4px', '8px', '12px', '16px', '24px']

Architecture

vue-harvest (monorepo)  packages/    cli/                        Published as "vue-harvest" on npm      src/        types.ts                Type system shared across the whole project        index.ts                Pipeline orchestrator        cli.ts                  CLI entry point (citty)        analyzers/          sfc-analyzer.ts       SFC parsing, interface extraction, coupling detection          graph-builder.ts      Dependency graph with Tarjan's SCC for cycle detection          design-system-analyzer.ts   Token extraction from CSS        extractors/          component-extractor.ts   Import rewriting, file bundling, manifest generation        generators/          registry.ts           Registry JSON + catalog HTML generation        commands/               CLI command definitions        utils/          config.ts             Config resolution, alias detection from tsconfig      tests/        fixtures/               A real mini Vue project used as test input        unit/                   66 tests across 5 suites
    mcp/                        Published as "vue-harvest-mcp" on npm      src/        index.ts                MCP server (12 tools, resources, prompts)

The split between CLI and MCP is deliberate. The CLI handles everything deterministic: parsing, graph building, classification, extraction. The MCP handles the 20% that needs reasoning: decoupling suggestions, refactoring code generation, ambiguity resolution.

Development

bash
git clone https://github.com/virgilvox/vue-harvest.gitcd vue-harvestpnpm installpnpm buildpnpm test

Watch mode for the CLI:

bash
pnpm --filter vue-harvest dev

Run a specific test file:

bash
npx vitest run packages/cli/tests/unit/sfc-analyzer.test.ts

How it works internally

  1. Discovery. Globs for .vue files, reads tsconfig.json for path aliases.
  2. SFC parsing. @vue/compiler-sfc splits each file into template, script, and style blocks.
  3. Interface extraction. Regex-based extraction of defineProps, defineEmits, <slot> tags. Handles generic type syntax, withDefaults, and object syntax with nested options.
  4. Dependency analysis. es-module-lexer parses imports. Each import gets classified by kind (internal component, composable, store, util, external package, etc).
  5. Coupling detection. Pattern matching on the script and template AST for store access, hardcoded APIs, router usage, i18n, inject, env vars, unscoped CSS.
  6. Classification. Confidence scoring starts at 1.0 and gets penalized for coupling issues, store access, and page-path patterns. Boosted for props/slots interfaces and UI-path patterns.
  7. Graph building. Resolves import paths, builds adjacency lists, runs Tarjan's strongly connected components algorithm for cycle detection, computes transitive dependency closures.
  8. Extraction. For components above threshold: collects the component plus all its local deps (composables, utils, types, styles), rewrites import paths to be relative within the extracted bundle, generates a manifest listing peer dependencies and required globals.
  9. Token extraction. PostCSS value parser identifies colors (hex, rgb, hsl), font properties, spacing values, radii, and shadows from CSS declarations. Deduplicates, normalizes hex values, and groups by type.

License

MIT

Source: README.md at commit 47c29cf

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.0.3LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts