SnapBack MCP Server

SnapBack MCP Server

Enables AI-powered code safety analysis including risk detection, secret scanning, dependency checking, and code snapshot management. Works offline for basic features with optional cloud integration for advanced ML analysis and team collaboration.

Category
访问服务器

README

SnapBack MCP Server

npm version License

AI-powered code analysis and snapshot management via Model Context Protocol

Integrate SnapBack's code safety features directly into Claude Desktop, Cursor, and any MCP-compatible AI tool.

Quick Start

npm install -g @snapback/mcp-server
snapback-mcp

Works immediately - no configuration required!

Features

🆓 Free (No Account Needed)

  • Risk Analysis: Detect secrets, vulnerabilities in code changes
  • Dependency Checking: Validate package.json changes
  • Local Analysis: Basic secret detection and security scanning
  • Offline Mode: Works without internet connection
  • Context7 Integration: Library documentation and code search

☁️ Pro Features (Optional API Key)

Get a free API key from snapback.dev to unlock:

  • 🔐 Advanced ML Analysis: AI-powered risk detection
  • 🔐 Snapshot Management: Create and restore code snapshots
  • 🔐 Cloud Sync: Access snapshots across devices
  • 🔐 Team Sharing: Collaborate on code safety

Installation

Claude Desktop

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

{
  "mcpServers": {
    "snapback": {
      "command": "npx",
      "args": ["-y", "@snapback/mcp-server"]
    }
  }
}

With API Key (Optional)

{
  "mcpServers": {
    "snapback": {
      "command": "npx",
      "args": ["-y", "@snapback/mcp-server"],
      "env": {
        "SNAPBACK_API_KEY": "your_api_key_here"
      }
    }
  }
}

Cursor / Other MCP Clients

# Install globally
npm install -g @snapback/mcp-server

# Run with stdio transport
snapback-mcp

Available Tools

snapback.analyze_risk

Analyze code changes for potential security risks before applying them.

When to use:

  • Before accepting AI-generated code
  • When reviewing complex changes
  • For critical files (auth, database, config)

Example:

// AI detects you want to add authentication
// Before applying changes, it calls:
snapback.analyze_risk({
  changes: [
    { added: true, value: "const API_KEY = 'sk_live_...';" }
  ]
})
// Returns: ⚠️ HIGH RISK: Hardcoded secret detected

snapback.check_dependencies

Check for dependency-related risks when package.json changes.

Example:

snapback.check_dependencies({
  before: { "lodash": "^4.17.15" },
  after: { "lodash": "^4.17.21" }
})
// Returns: ℹ️ Security update available

snapback.create_snapshot (Pro)

Create a code snapshot before risky changes.

Example:

snapback.create_snapshot({
  reason: "Before major refactor",
  files: ["src/auth.ts", "src/db.ts"]
})
// Returns: ✅ Snapshot created: snap_xyz123

snapback.list_snapshots (Pro)

List all available snapshots.

snapback.restore_snapshot (Pro)

Restore code from a previous snapshot.

Context7 Tools

  • ctx7.resolve-library-id: Find library documentation
  • ctx7.get-library-docs: Fetch library docs and examples

Configuration

Environment Variables

# Optional: SnapBack API key for Pro features
SNAPBACK_API_KEY=sk_...

# Optional: Custom API URL
SNAPBACK_API_URL=https://api.snapback.dev

# Optional: Context7 API key for enhanced docs
CONTEXT7_API_KEY=...

# Optional: Log level
LOG_LEVEL=info

Offline Mode

Works perfectly without any configuration or API keys:

# No env vars needed!
npx @snapback/mcp-server

What works offline:

  • Risk analysis (basic)
  • Dependency checking
  • Secret detection
  • Context7 library search (cached)

What requires API key:

  • Advanced ML risk analysis
  • Snapshot creation/restoration
  • Cloud sync
  • Team features

Architecture

┌─────────────────┐
│   AI Tool       │  (Claude, Cursor, etc.)
│   (MCP Client)  │
└────────┬────────┘
         │ MCP Protocol
         │
┌────────▼─────────────────────────────────┐
│  SnapBack MCP Server                     │
│  ┌──────────────┐  ┌──────────────────┐ │
│  │ Free Tools   │  │  Pro Tools       │ │
│  │ - analyze    │  │  - snapshots     │ │
│  │ - check_deps │  │  - cloud sync    │ │
│  └──────────────┘  └──────────────────┘ │
└───────────┬──────────────────────────────┘
            │
        ┌───┴────┐
        │        │
   ┌────▼───┐ ┌─▼─────────┐
   │ Local  │ │ SnapBack  │
   │Analysis│ │    API    │
   └────────┘ └───────────┘

Development

Running Locally

git clone https://github.com/snapback-dev/mcp-server.git
cd mcp-server

pnpm install
pnpm build
pnpm start

Testing

# Run tests
pnpm test

# Test without API key (offline mode)
unset SNAPBACK_API_KEY
pnpm start

# Test with API key
export SNAPBACK_API_KEY=sk_test_...
pnpm start

Building

pnpm build

# Output: dist/index.js (ESM)

Troubleshooting

Server won't start

  1. Check Node.js version: node -v (requires 18+)
  2. Clear cache: rm -rf node_modules && npm install
  3. Check permissions: chmod +x $(which snapback-mcp)

API key not working

  1. Verify key format: sk_live_... or sk_test_...
  2. Check env var: echo $SNAPBACK_API_KEY
  3. Get new key: snapback.dev/settings/api

Tools not showing in Claude

  1. Restart Claude Desktop completely
  2. Check config file syntax (JSON must be valid)
  3. Look for errors in Claude's console logs

Security

  • All secrets handled via environment variables
  • No data sent to SnapBack without API key
  • Local analysis runs offline
  • Open source - audit the code yourself

Report security issues: security@snapback.dev

Links

License

Apache-2.0 © SnapBack

Related

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选