Local MCP Integration Free
SnapBack integrates with AI coding assistants through the Model Context Protocol (MCP), enabling seamless context sharing while working entirely offline. The local MCP integration is available on all tiers and requires no cloud connectivity.
Privacy Guarantee
π 100% Local, 100% Private: Local MCP integration works entirely on your machine. No data is sent to SnapBack servers. No internet connection required.
Available MCP Tools
The local MCP server provides a small, focused set of core commands by default:
Core Commands (7):
pulse,advise,guide- Workspace health, recommendations, and workflow plans (PERCEIVE/REASON)snap,check- Task management and validation (ACT)snap_learn,snap_end- Learning capture and session completion (REFLECT)snap_fix,snap_help- Snapshot operations and help (UTILITY)
Advanced Tools (opt-in via SNAPBACK_MCP_INTELLIGENCE_SURFACE=full):
snap_violation- Report code violationslearning_gc- Learning lifecycle management- Intelligence Layer (5): External context integration (GitHub, Sentry, Context7)
snapback_validate_change,snapback_get_risk_score,snapback_query_patternssnapback_get_context,snapback_suggest_rollback
- Learning Intelligence (5): Pattern-based learning system
intelligence.capture,intelligence.patterns,intelligence.insightsintelligence.explain,intelligence.outcome
Default Surface: SnapBack exposes only the 7 core commands by default for a clean, focused tool list. This follows Anthropicβs MCP best practices for tool discovery and invocation efficiency. Advanced users can enable the full surface with 11 additional tools for proactive risk assessment and pattern-based learning.
1. snap - Universal Entry Point
Start tasks, get context, or quick check. This is the primary tool AI assistants should call first.
Parameters:
{
mode?: 'start' | 'check' | 'context'; // or legacy: 's' | 'c' | 'x'
task?: string; // Task description (for start mode)
files?: string[]; // Files to work on
keywords?: string[]; // Keywords for learning retrieval
intent?: 'implement' | 'debug' | 'refactor' | 'review' | 'explore';
}
Modes:
start(ors): Start a task, creates snapshot, loads learningscheck(orc): Quick validation of filescontext(orx): Get current context without starting a task
Usage Example:
// AI assistant starts a task
await mcp.call('snap', {
mode: 'start',
task: 'Refactor authentication module',
files: ['src/auth.ts', 'src/config.ts'],
intent: 'refactor'
});
2. check - Code Validation
Validate code against patterns, run builds, check for issues.
Parameters:
{
mode?: 'quick' | 'full' | 'patterns' | 'build' | 'impact' | 'circular' | 'docs';
files?: string | string[]; // Files to check
code?: string; // Code to validate (for patterns mode)
tests?: boolean; // Run tests
}
Modes:
quick(orq): Fast TypeScript + lint checkfull(orf): Comprehensive 7-layer validationpatterns(orp): Pattern-only style compliancebuild(orb): Build verificationimpact(ori): Bundle size ROI analysiscircular(orc): Circular dependency checkdocs(ord): Documentation freshness
Usage Example:
// Quick validation before commit
const result = await mcp.call('check', {
mode: 'quick',
files: ['src/auth.ts']
});
3. snap_end - Complete Task
Complete a task and capture learnings.
Parameters:
{
ok: 0 | 1; // 1 = success, 0 = failed
outcome: 'completed' | 'abandoned' | 'blocked';
l?: string[]; // Learnings captured
}
Usage Example:
await mcp.call('snap_end', {
ok: 1,
outcome: 'completed',
l: ['Auth refactor reduced complexity by 40%']
});
4. snap_fix - Snapshot Operations
List snapshots, restore, or compare.
Parameters:
{
id?: string; // Snapshot ID to restore
diff?: string; // Second snapshot ID for comparison
dry?: boolean; // Preview restore without applying
}
Usage Example:
// List available snapshots
await mcp.call('snap_fix', {});
// Restore a specific snapshot
await mcp.call('snap_fix', { id: 'snap_abc123' });
5. snap_help - Help and Discovery
Get help with SnapBack operations.
Parameters:
{
q?: 'tools' | 'status' | 'wire'; // Query type
}
6. snap_learn - Capture Learning
Capture mid-session insights for future reference.
Parameters:
{
t: string; // Trigger (when this applies)
a: string; // Action (what to do)
type: 'pat' | 'pit' | 'eff' | 'disc' | 'wf';
// pat=pattern, pit=pitfall, eff=efficiency, disc=discovery, wf=workflow
}
Usage Example:
await mcp.call('snap_learn', {
t: 'modifying auth middleware',
a: 'always validate session before token refresh',
type: 'pit'
});
7. snap_violation - Report Violation
Report a mistake for pattern learning.
Parameters:
{
type: string; // Violation category
file: string; // File where violation occurred
what: string; // What went wrong
why: string; // Why it happened
prevent: string; // How to prevent in future
}
Supported AI Assistants
SnapBack supports multiple AI assistants. Each client has specific configuration requirements.
Automatic Setup: Run snap tools configure βall to automatically configure all detected AI assistants.
Claude Desktop (macOS/Windows App)
Important: Claude Desktop only supports stdio transport. It cannot use HTTP/URL-based connections.
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
// %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"snapback-claude": {
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/path/to/project"]
}
}
}
Full Claude Desktop setup guide β
Cursor
Cursor supports both stdio and HTTP transport. Recommended: stdio for reliability.
// ~/.cursor/mcp.json (global) or .cursor/mcp.json (project)
{
"mcpServers": {
"snapback-cursor": {
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/path/to/project"]
}
}
}
VS Code (Native MCP Support)
VS Code uses a different config format with servers instead of mcpServers:
// .vscode/mcp.json (project-level)
{
"servers": {
"snapback-vscode": {
"type": "stdio",
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "${workspaceFolder}"]
}
}
}
Windsurf
Windsurf uses the standard MCP format:
// ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"snapback-windsurf": {
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/path/to/project"]
}
}
}
Cline (VS Code Extension)
// ~/.cline/mcp.json
{
"mcpServers": {
"snapback": {
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/path/to/project"]
}
}
}
Configuration
Enabling Local MCP
Local MCP is enabled by default. To configure settings:
// .snapbackconfig
{
"mcp": {
"local": {
"enabled": true,
"port": 3333, // Optional: custom port
"autoStart": true // Start MCP server when extension activates
}
}
}
VS Code Extension Settings
// VS Code settings.json
{
"snapback.mcp.local.enabled": true,
"snapback.mcp.local.autoStart": true,
"snapback.mcp.local.logLevel": "info" // debug | info | warn | error
}
How It Works
The local MCP server operates entirely on your machine:
- Startup: SnapBack extension starts a local MCP server on
localhost:3333 - Connection: AI assistants connect to the local server via stdio or HTTP
- Tool Invocation: Assistants call MCP tools to interact with SnapBack
- Response: SnapBack processes requests locally and returns results
- No Network: All operations happen offlineβno external requests
Context Shared Locally
The local MCP integration provides AI assistants with:
Protection Levels
File protection metadata to avoid risky modifications:
{
"protectionLevels": {
"src/config.ts": "warn",
"src/.env": "block",
"src/secrets.json": "block"
}
}
Session Context
Current session information for better assistance:
{
"currentSession": {
"id": "session_12345",
"name": "Implement authentication",
"duration": 2400, // seconds
"filesModified": ["src/auth.ts", "src/config.ts"],
"snapshotCount": 3
}
}
Risk Analysis Results
Recent security findings to avoid introducing similar risks:
{
"recentFindings": [
{
"type": "secret",
"file": "src/config.ts",
"severity": "high",
"resolved": true,
"timestamp": "2024-01-15T10:30:00Z"
}
]
}
Privacy and Security
What Stays on Your Machine
- Everything: All data, snapshots, and analysis results remain local
- File contents and code
- Protection levels and policies
- Session metadata
- Risk analysis findings
- Configuration settings
Whatβs Never Shared
Local MCP integration never sends data externally:
- β No file contents to cloud
- β No code snippets to servers
- β No personal information transmitted
- β No usage telemetry (unless you opt-in separately)
Troubleshooting
Transport Configuration Errors
Most common error: Using HTTP transport (url) with clients that only support stdio transport (command + args).
Error: βcommandβ field expected but received undefined
[{"code": "invalid_type", "expected": "string", "received": "undefined",
"path": ["mcpServers", "snapback", "command"]}]
Cause: The client received HTTP transport config but requires stdio transport.
Solution: Use command + args instead of url:
// β Wrong - HTTP transport (not supported by Claude Desktop)
{
"mcpServers": {
"snapback": {
"url": "http://localhost:3333"
}
}
}
// β
Correct - stdio transport
{
"mcpServers": {
"snapback": {
"command": "npx",
"args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/your/project"]
}
}
}
Quick fix:
snap tools configure --force # Regenerates with correct transport
Transport Compatibility Matrix
| Client | stdio (command+args) | HTTP (url) |
|---|---|---|
| Claude Desktop | β Required | β |
| Claude Code (CLI) | β | β |
| Cursor | β Recommended | β |
| VS Code | β Recommended | β |
| Windsurf | β Recommended | β |
| Cline | β | β |
MCP Server Not Starting
# Test MCP server manually
snap mcp --help
# Run MCP server with verbose output
snap mcp --stdio --workspace .
# If @snapback/cli isn't installed globally
npm install -g @snapback/cli
Command Not Found
If npx or snap isnβt found:
-
Find the correct path:
which npx # e.g., /usr/local/bin/npx which snap # e.g., /usr/local/bin/snap -
Use absolute path in config:
{ "command": "/usr/local/bin/npx", "args": ["@snapback/cli", "mcp", "--stdio", "--workspace", "/your/project"] } -
Or use node directly:
npm root -g # Find global modules path{ "command": "node", "args": ["/usr/local/lib/node_modules/@snapback/cli/dist/cli.js", "mcp", "--stdio"] }
AI Assistant Canβt Connect
- Verify command works:
snap mcp --help - Check workspace is valid (has .git/, package.json, or .snapback/)
- Restart your AI assistant
- Set
MCP_QUIET=1env var to suppress logging
Performance Issues
If MCP operations are slow:
- Reduce snapshot retention to free up disk space
- Exclude large files from risk analysis via
.snapbackignore - Disable auto-snapshots during heavy AI assistance sessions
CLI Commands
# Start local MCP server (stdio transport)
snap mcp --stdio
# Check MCP server status
snapback mcp status
# Stop MCP server
snapback mcp stop
# View MCP logs
snapback mcp logs [--tail 100]
# Test MCP connection
snapback mcp test
# Show shared context (for debugging)
snapback mcp context --format json
Best Practices
π― Enable Before AI Sessions
Start the MCP server before beginning intensive AI-assisted coding sessions.
π‘οΈ Trust but Verify
Even with MCP context, always review AI suggestions before accepting them.
π Monitor Risk Scores
Check risk analysis results regularly to ensure your codebase stays secure.
π Update Protection Levels
Keep protection levels current so AI assistants have accurate safety context.
Upgrade to Backend MCP
Want cloud-powered features like advanced AI scoring and team collaboration?
Backend MCP (available on Solo, Team, and Enterprise plans) adds:
- β Cloud-based Guardian AI risk scoring
- β Team snapshot sharing
- β Cloud backup and restore
- β API access with authentication
Related Documentation
- Protection Levels - Configure file protection
- AI Detection - Understand risk analysis
- Session Time-Travel - Navigate your coding history
- CLI Reference - Command-line tools
Privacy First: SnapBack works 100% offline on the Free plan. MCP is optional and requires explicit consent on paid plans. Learn more β