STEP 1 of the LogicStamp MCP workflow. Run this first to create a snapshot of your codebase.
logicstamp_refresh_snapshot runs LogicStamp Context analysis on a project and creates a snapshot. This command executes stamp context under the hood and generates context bundles for all components in your codebase.
Important: This command only returns a high-level summary (component counts, token estimates, folder structure). It does NOT contain component details, props, dependencies, or style metadata. You must use logicstamp_list_bundles and logicstamp_read_bundle to access that detailed information.
- Before making edits - Create a baseline snapshot to compare against later
- Initial codebase analysis - First step when analyzing a new project
- After major changes - Refresh the snapshot when you've made significant code changes
- Style analysis - Set
includeStyle: truewhen you need visual/design information
- Type:
'llm-chat' | 'llm-safe' | 'ci-strict' - Default:
'llm-chat' - Description: Analysis profile that controls how components are analyzed
llm-chat- Balanced analysis for AI chat assistants (default)llm-safe- More conservative analysis, suitable for productionci-strict- Strict validation mode: contracts only (no code), strict dependency checks, fails on missing dependencies. Useful for validation workflows (note: git baseline comparison is not yet implemented)
- Type:
'header' | 'full' | 'none' - Default:
'header' - Description: Code inclusion mode
none- Contracts only (smallest, ~79% token savings)header- Contracts with JSDoc headers (balanced, ~65% token savings)full- Complete source code (largest, no savings)
-
Type:
boolean -
Default:
false -
Description: Include style metadata in context bundles. When
true, extracts:- Tailwind CSS classes - Categorized by layout, spacing, colors, typography, borders, effects
- SCSS/CSS Modules - Module imports, selectors, properties, SCSS features
- framer-motion - Motion components, animation variants, gesture handlers
- Color palettes - Extracted color classes
- Spacing patterns - Padding and margin utilities
- Layout metadata - Flex/grid patterns, responsive breakpoints
- Animation metadata - Animation types and triggers
Style data appears in the
stylefield of component contracts when you read bundles withlogicstamp_read_bundle. The summary fromrefresh_snapshotdoes NOT show style info - you must read bundles to see it.Use
includeStyle: truefor:- Design system analysis
- Visual consistency checks
- When the user asks about styling, colors, spacing, animations, or visual design
- Type:
string - Description: CRITICAL: Absolute path to project root. REQUIRED - must always be provided. When
stamp inithas been run, MCP clients may omit this parameter, causing hangs. This parameter is REQUIRED for the tool to work correctly. The server will resolve relative paths to absolute paths automatically.
- Type:
boolean - Default:
false - Description: Manually force cleanup of
.logicstampcache directory. Cache is automatically cleaned if corruption or path mismatches are detected. Only set totrueif you're experiencing cache-related issues.
-
Type:
boolean -
Default:
true -
Description: Skip regeneration if watch mode (
stamp context --watch) is active. Whentrue:- If watch mode is active: Skips expensive regeneration and reads existing context files (fast path)
- If watch mode is NOT active: Performs normal regeneration (slow path)
Use this when: You want to avoid redundant regeneration when watch mode is already keeping context fresh. This is especially useful in MCP workflows where watch mode may be running in the background.
Benefits:
- Faster execution when watch mode is active
- Avoids duplicate work (watch mode already regenerates affected bundles)
- Smart fallback: still regenerates if watch mode isn't running
Note: The default is
true- regeneration is automatically skipped when watch mode is active. Set tofalseonly if you need to force regeneration even when watch mode is running.
Returns a RefreshSnapshotOutput object with:
- Type:
string - Description: Unique identifier for this snapshot (e.g.,
"snap_1764033034172_0"). Use this ID in subsequent commands.
- Type:
string - Description: Absolute path to the analyzed project
- Type:
string - Description: The analysis profile used
- Type:
string - Description: The code inclusion mode used
- Type:
boolean - Description: Whether style metadata was included
High-level statistics about the codebase:
totalComponents- Total number of components analyzedtotalBundles- Total number of bundles generatedtotalFolders- Total number of folders with context filestotalTokenEstimate- Overall token count estimatetokenEstimates- Per-model token estimates:gpt4oMini- GPT-4o-mini token countgpt4oMiniFullCode- GPT-4o-mini token count with full codeclaude- Claude token countclaudeFullCode- Claude token count with full code
missingDependencies- Array of missing dependency paths
Array of folder metadata objects, each containing:
path- Relative path from project rootbundles- Number of bundles in this foldercomponents- Array of component file namestokenEstimate- Estimated token count for this folderisRoot- Whether this is an application entry pointrootLabel- Human-readable label (e.g., "Next.js App", "Project Root")
{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"projectPath": "/absolute/path/to/project"
}
}This creates a snapshot with default settings (profile: 'llm-chat', mode: 'header', includeStyle: false). Note: projectPath is required.
{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"projectPath": "/absolute/path/to/project",
"profile": "llm-safe"
}
}{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"projectPath": "/absolute/path/to/project",
"includeStyle": true
}
}{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"projectPath": "/absolute/path/to/project",
"mode": "full"
}
}{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"projectPath": "/absolute/path/to/project",
"skipIfWatchActive": true
}
}This skips regeneration if watch mode is active, reading existing context files instead. If watch mode is not active, it performs normal regeneration.
{
"name": "logicstamp_refresh_snapshot",
"arguments": {
"profile": "llm-safe",
"mode": "header",
"includeStyle": true,
"projectPath": "/absolute/path/to/project",
"skipIfWatchActive": true
}
}{
"snapshotId": "snap_1764033034172_0",
"projectPath": "/path/to/project",
"profile": "llm-chat",
"mode": "header",
"includeStyle": false,
"summary": {
"totalComponents": 45,
"totalBundles": 45,
"totalFolders": 8,
"totalTokenEstimate": 125000,
"tokenEstimates": {
"gpt4oMini": 125000,
"gpt4oMiniFullCode": 450000,
"claude": 120000,
"claudeFullCode": 420000
},
"missingDependencies": []
},
"folders": [
{
"path": "src/components",
"bundles": 20,
"components": ["Button.tsx", "Card.tsx", "Modal.tsx"],
"tokenEstimate": 50000,
"isRoot": false
},
{
"path": "src/pages",
"bundles": 5,
"components": ["index.tsx", "about.tsx"],
"tokenEstimate": 30000,
"isRoot": true,
"rootLabel": "Next.js App"
}
]
}This is STEP 1 of the LogicStamp MCP workflow:
- Call
logicstamp_refresh_snapshot- Creates snapshot and returns summary - Call
logicstamp_list_bundles- Lists available bundles using thesnapshotId - Call
logicstamp_read_bundle- Read specific bundles to get detailed component information
- Summary Only: The output does NOT contain component details, props, dependencies, or style metadata. You must use
logicstamp_list_bundlesandlogicstamp_read_bundleto access that data. - Style Metadata: If
includeStyle: true, style data will be available in bundles when you read them withlogicstamp_read_bundle, but NOT in the summary. - Non-Interactive: The command uses
--skip-gitignoreand--quietflags to ensure non-interactive operation. - Snapshot Storage: The snapshot is stored in the MCP server's state and can be referenced by
snapshotIdin subsequent commands. - Watch Mode Integration: Use
skipIfWatchActive: trueto avoid redundant regeneration when watch mode is already keeping context fresh. You can check watch mode status withlogicstamp_watch_statusbefore calling this command.
logicstamp_list_bundles- List bundles in a snapshot (STEP 2)logicstamp_read_bundle- Read detailed bundle information (STEP 3)logicstamp_compare_snapshot- Compare snapshots to detect changeslogicstamp_watch_status- Check if watch mode is active before calling this command
If the command fails, it will throw an error with a descriptive message. Common errors:
- Project path not found - The specified
projectPathdoesn't exist - No components found - The project doesn't contain any analyzable components
- Permission errors - Insufficient permissions to read project files
- Invalid project structure - The project structure is incompatible with LogicStamp
- Cache corruption - If you encounter cache-related errors, the cache is automatically cleaned. Use
cleanCache: trueto force cleanup if needed
- MCP Integration Guide - Complete MCP server documentation
- Tool Description - LogicStamp Context capabilities
- Quick Start - Getting started guide