How MCP mode works

SpecDrive MCP scans your repo and returns generation bundles (prompts + context). You (Cursor/Claude) generate the markdown using your host API key, then call write_spec_document. SpecDrive never calls an LLM in MCP mode.

Install

npm install -g @specdrive/mcp @specdrive/cli

# Or use npx without global install (recommended)
npx -y @specdrive/mcp

Run spec init in your project before using MCP tools.

Cursor

Add to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "specdrive": {
      "command": "npx",
      "args": ["-y", "@specdrive/mcp"],
      "cwd": "${workspaceFolder}"
    }
  }
}

Restart Cursor or reload MCP servers from settings.

Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "specdrive": {
      "command": "npx",
      "args": ["-y", "@specdrive/mcp"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

Replace cwd with your project root. Restart Claude Desktop.

Global install alternative

npm install -g @specdrive/mcp
{
  "mcpServers": {
    "specdrive": {
      "command": "specdrive-mcp",
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

MCP workflow

create_spec → requirements bundle write_spec_document → save requirements.md update_spec → approve requirements generate_gap_analysis → gap-analysis bundle write_spec_document → save gap-analysis.md generate_design → design bundle write_spec_document → save design.md generate_tasks → tasks bundle get_next_task → implement

Figma + Design2Code (figma-to-code)

SpecDrive MCP can call your Design2Code integration for UI tasks only. State, BLoC, navigation, validation, and tests stay with Cursor/Claude via get_next_task.

Figma token (Personal Access Token)

Figma does not use OAuth popups like GitHub. You generate a token once:

  1. Open figma.com/settings
  2. Scroll to Personal access tokens
  3. Generate → copy token (starts with figd_)
# Option A — Design2Code config (recommended)
design2code login --figma-token figd_YOUR_TOKEN

# Option B — shell profile
export FIGMA_TOKEN="figd_YOUR_TOKEN" >> ~/.zshrc

# Option C — Cursor MCP env
"env": { "FIGMA_TOKEN": "figd_YOUR_TOKEN" }

Link Figma file to project

# .specdrive/figma.json
{
  "fileKey": "YOUR_FIGMA_FILE_KEY"
}

Auto-run UI tasks

# MCP — pass autoFigma: true on get_next_task
# UI tasks → Design2Code generates widgets/screens (component scope)
# Logic tasks → skipped, returns normal implement context

# CLI
spec implement --spec my-feature --next --auto-figma
Task typeWho implements
Scaffold screen, UI componentsDesign2Code (if installed + Figma linked)
Wire state / BLoC / navigation / validation / testsCursor/Claude via SpecDrive context

Available MCP tools

ToolDescription
create_specScaffold spec + return generation bundle
write_spec_documentSave host-generated markdown
update_specApprove workflow gate
generate_gap_analysisGap-analysis generation bundle
generate_designDesign generation bundle
generate_tasksTasks generation bundle
scan_codebaseScan repo for source context
get_next_taskImplementation context; autoFigma: true runs Design2Code on UI tasks
figma_statusCheck Design2Code + FIGMA_TOKEN setup
figma_importImport Figma/MCP Figma file to Design AST
figma_generateGenerate code from Figma/AST
figma_generate_for_specGenerate using spec stack + Figma
figma_previewPreview generated code (no writes)
review_codeReview against design.md
search_specsList all specs

Marketplace listing

For one-click install via Cursor Marketplace or Claude Connectors Directory, see the marketplace submission guide on GitHub.