MCPDiet Documentation

Version 1.0 · Requires Node.js >= 20 · Support: support@runglab.dev

1. Quickstart (Free CLI)

Run MCPDiet directly via npx without modifying any files:

# Auto-discover Claude Code, Cursor, VS Code, Windsurf, and Claude Desktop
npx mcpdiet audit

# Audit a specific file with custom daily tool-turn volume
npx mcpdiet audit ./mcp.json --calls-per-day 200

# Live-probe stdio or HTTP MCP servers via tools/list for exact schema size
npx mcpdiet audit ./mcp.json --live

# Emit JSON for scripts
npx mcpdiet audit --json

2. Activating MCPDiet Pro

After purchasing a lifetime license via Creem.io ($15) or Afdian (¥79), activate your key once per machine (up to 3 machines):

npx mcpdiet activate YOUR-LICENSE-KEY
npx mcpdiet status

Your local license state and 30-day signed offline grace token are stored at ~/.mcpdiet/license.json.

3. Canonical mcp.profiles.yaml Schema (Pro)

Generate a starter file automatically from your existing IDE configs (hardcoded secrets are automatically converted into ${env:VAR} references):

npx mcpdiet init
version: 1
active: minimal
targets:
  - claude-code
  - cursor
  - vscode
  - windsurf
  - claude-desktop
servers:
  filesystem:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-filesystem@2025.1.14", "."]
  postgres:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-postgres@2025.1.14", "${env:DATABASE_URL}"]
  github:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-github@2025.1.14"]
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: "${env:GITHUB_TOKEN}"
profiles:
  minimal:
    description: "Lean everyday coding (~4.6k tokens)"
    servers: [filesystem]
  coding:
    description: "Code + Database + GitHub (~21.8k tokens)"
    servers: [filesystem, postgres, github]

4. Switching Profiles, Syncing & Restoring (Pro)

# Switch active profile and sync immediately to all configured IDEs
npx mcpdiet use minimal --sync

# Sync to specific IDE targets only (creates atomic timestamped backup first)
npx mcpdiet sync --ide cursor,vscode,claude-code

# Preview changes without writing to disk
npx mcpdiet sync --dry-run

# List or restore prior atomic backups
npx mcpdiet restore --list
npx mcpdiet restore

Secret-Safe Guarantee: mcpdiet sync validates that referenced ${env:VAR} values exist in .env.local or your environment while keeping placeholders intact on disk. It refuses to write raw plaintext API keys into mcp.json.

5. Security Rules & GitHub Actions SARIF Gate (Pro)

# Export valid SARIF 2.1.0 and fail CI if any high or critical finding is present
npx mcpdiet scan --sarif mcpdiet.sarif --fail-on high

6. VS Code & Cursor Extension

Install MCPDiet from the VS Code / Open VSX Marketplace to display your active profile and live token overhead right in the status bar. Open Command Palette (Ctrl/Cmd+Shift+P) for: