SPARDA — Claude Code MCP server: what it does, how to install
Deterministic local verification gate for AI backend edits. It maps routes to a behavior graph and blocks changes that drop guards or invariants.
claude mcp add --env SPARDA_FLYWHEEL=<SPARDA_FLYWHEEL> --env SPARDA_RECORD_SEQUENCES=<SPARDA_RECORD_SEQUENCES> --transport stdio sparda -- npx -y sparda-mcpWhat SPARDA does
SPARDA parses backend handlers, database queries, and state mutations into a Unified Behavior Graph (.sparda/ubg.json). It natively inspects route trees in Express, FastAPI, Flask, Next.js, NestJS, and Medusa. Codebases on other stacks can feed in OpenAPI specifications instead.
During live editing, the gate command compares graph snapshots across revisions. If an agent deletes a guard or exposes a protected route, the process terminates with exit code 2. When tied to Claude Code's PostToolUse hook, this immediately halts the agent's modification loop. The apocalypse command runs pre-deploy checks and emits SARIF findings for CI.
Running the tool requires Node.js 18 or higher. Analysis stays entirely on the local machine without cloud services or external API keys. When visibility across the codebase is incomplete, the engine marks the result as PROVEN (PARTIAL) or PREMISE NOT VERIFIED rather than returning an unearned green check.
What it helps with
- Block AI edits that drop route guards or authorization checks
- Interrupt agent modification loops when regressions occur
- Generate a deterministic behavior graph for backend handlers
- Verify transactional safety before deployment via CI gates
Example prompts for the agent
- Run sparda apocalypse to verify that recent edits kept all route guards intact
- Generate the Unified Behavior Graph for our Next.js backend using ubg
- Run the prove command and print the verification verdict with coverage
How to install SPARDA
Platform CLI
claude mcp add --env SPARDA_FLYWHEEL=<SPARDA_FLYWHEEL> --env SPARDA_RECORD_SEQUENCES=<SPARDA_RECORD_SEQUENCES> --transport stdio sparda -- npx -y sparda-mcpReplace <…> with your own values
Platform CLI
codex mcp add sparda --env SPARDA_FLYWHEEL=<SPARDA_FLYWHEEL> --env SPARDA_RECORD_SEQUENCES=<SPARDA_RECORD_SEQUENCES> -- npx -y sparda-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"sparda": {
"command": "npx",
"args": [
"-y",
"sparda-mcp"
],
"env": {
"SPARDA_FLYWHEEL": "<SPARDA_FLYWHEEL>",
"SPARDA_RECORD_SEQUENCES": "<SPARDA_RECORD_SEQUENCES>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"sparda": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sparda-mcp"
],
"env": {
"SPARDA_FLYWHEEL": "<SPARDA_FLYWHEEL>",
"SPARDA_RECORD_SEQUENCES": "<SPARDA_RECORD_SEQUENCES>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SPARDA_FLYWHEEL=<SPARDA_FLYWHEEL> -e SPARDA_RECORD_SEQUENCES=<SPARDA_RECORD_SEQUENCES> sparda npx -y sparda-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about SPARDA
How to install SPARDA in Claude Code?
Run claude mcp add sparda-mcp -- npx -y sparda-mcp. For configurations requiring environment flags, run `claude mcp add --env SPARDA_FLYWHEEL=<SPARDA_FLYWHEEL> --env SPARDA_RECORD_SEQUENCES=<SPARDA_RECORD_SEQUENCES> --transport stdio sparda -- npx -y sparda-mcp`.
What does SPARDA do?
It translates backend routes and data operations into a static behavior graph to mathematically verify edits. It flags dropped security checks, unguarded endpoints, and non-atomic writes locally.
Which web frameworks does SPARDA support out of the box?
Native parsing covers Express, FastAPI, Flask, Next.js, NestJS, and Medusa. Any alternative backend architecture can be analyzed by supplying an OpenAPI specification.