StackBridge

by zainulabideen02

Not rated
GitHub

About

Sub-1ms cross-stack AST contract layer and compiler verification engine mapping React/Next.js routes to FastAPI and SQLAlchemy models for AI coding agents.

Details

Author
zainulabideen02
Categories
Developer Tools, AI, Other

Setup

Install StackBridge in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/zainulabideen02/StackBridge-MCP

Follow the installation instructions in the repository README, then restart your MCP client.

Sub-1ms Cross-Stack AST Contract & Verification Layer for AI Coding Agents

Quick Start•Client Config•Benchmarks•MCP Tools•CLI Reference•Docs

When AI coding agents (Cursor, Claude Code, Windsurf, Antigravity) edit backend models or API routes in full-stack codebases, backend unit tests frequently pass while the frontend silently breaks in production:
- An agent modifies an API parameter or Pydantic/SQLAlchemy field inbackend/routes.py.
- Backend tests pass in isolation. Nothing warns the agent.
- The React/Next.js client calling that endpoint across the boundary fails with runtime errors.

StackBridge-MCPis an always-warmModel Context Protocol (MCP)server that parses full-stack AST relationships, discovers cross-stack blast radii in0.75 ms, and verifies changes using baseline-diffed compiler checks with zero false positives.

React / Next.js Client FastAPI Routes SQLAlchemy ORM Models (TypeScript AST) ───► (Python AST) ───► (Schema AST) UserProfile.tsx get_user_billing() BillingAccount

- 🌲 Tree-sitter AST Graph:Parses Next.js (fetch, Axios, React Query) ↔ FastAPI routes ↔ SQLAlchemy ORM models without heavy LSP sidecars or runtime imports.
- ⚡ Sub-1ms Traversal:Persistent SQLite WAL database with recursive Common Table Expressions (0.75 mstraversal query latency).
- 📉 99.74% Prompt Token Reduction:Replaces massive multi-file code dumps with compact, mathematically precise AST contract slices.
- 🛡️ Root-Cause Diagnostic Ranking:Graph-distance BFS ranks errors (🔴 PRIMARY ROOT CAUSEvs⚠️ CASCADING BREAKAGE) and outputs immediate Git diff patches.
- 🧪 Test Impact Selection:Isolates test suites impacted by a schema change and highlights untested blast-radius paths (0% coverage).
- 🌐 Interactive Canvas:Built-in localhost tripartite visualizer (stackbridge ui) onhttp://127.0.0.1:3456.
- 🔄 Continuous Intelligence:Background file watcher daemon (stackbridge watch) and living
AGENTS.mdcontext generator.

Empirical performance measured onfastapi-realworld-example-app(44 files, 23 AST dependency nodes, 10 cross-boundary edges):

See full benchmark methodology indocs/benchmarks.mdandREAL_WORLD_BENCHMARK.md.

Option 1: Zero-Install Execution (Recommended viauvx)

pip install stackbridge stackbridge serve

Connect StackBridge to your AI pair programmer over standard JSON-RPC 2.0 stdio:

{ "mcpServers": { "stackbridge": { "command": "uvx", "args": ["stackbridge", "serve"] } } }

2. Claude Desktop (claude_desktop_config.json)

{ "mcpServers": { "stackbridge": { "command": "python", "args": ["-m", "stackbridge.main", "serve", "--transport", "stdio"] } } }

StackBridge exposes high-ergonomics tools to coding agents:

# Index a repository and export the dependency graph stackbridge index --repo-path . --force # Trace blast radius for a model or route stackbridge trace --target BillingAccount # Run pre-commit boundary verification guard stackbridge guard --fail-on-error # Launch interactive tripartite web visualizer stackbridge ui --port 3456 # Start continuous background watcher daemon stackbridge watch # Generate living AGENTS.md boundary architecture guide stackbridge init-agents # Execute performance and token reduction benchmarks stackbridge benchmark --runs 3 --output BENCHMARK.md
StackBridge-MCP/ ├── .github/ │ ├── workflows/ci.yml # CI pipeline (Python 3.10-3.13 on Ubuntu/Windows/macOS) │ ├── ISSUE_TEMPLATE/ # Bug report and feature request issue templates │ └── PULL_REQUEST_TEMPLATE.md # Standard PR checklist ├── docs/ │ ├── architecture.md # Subsystem breakdown and Mermaid diagrams │ ├── benchmarks.md # Benchmark methodology and raw metrics │ └── ast_extraction_spec.md # Tree-sitter extractor grammar specifications ├── stackbridge/ │ ├── core/ # Unified StackGraph, SQLite CTE store, watcher, route matcher │ ├── parsers/ # Tree-sitter parsers (TS fetch, Python routes, SQLAlchemy) │ ├── verifier/ # Baseline-diffed verifier, root-cause ranker, test impact selector │ ├── mcp_server/ # FastMCP stdio server and JSON-RPC tools │ ├── benchmarks/ # Benchmark runner and markdown report generator │ └── ui/ # Localhost tripartite interactive canvas ├── tests/ # 56 automated test suites (parsers, verifiers, MCP E2E, CTE) ├── AGENTS.md # Living agent architecture guide ├── CHANGELOG.md # Version release notes ├── CONTRIBUTING.md # Contribution and development guidelines ├── LICENSE # MIT License └── pyproject.toml # Package metadata and tool configurations

This project is licensed under theMIT License.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

Instead of direct calling MCP tools, mcpcode server transforms MCP tool calls into TypeScript programs, enabling smarter, lower-latency orchestration by LLMs.

Supercharge your Agent with Semantic Code Intelligence and save 💰 in the process!

AI-to-AI code review platform — Claude, Codex, and Gemini cross-check each other via MCP, REST API, and CLI for consensus-based results.

A code sandbox for AI assistants to safely execute arbitrary code. Requires a 302AI API key for authentication.

Agent-native developer Q&A API with MCP + A2A endpoints for citations, job pickup, and answer submission.

MCP server to dynamically load Claude Code skills into AI agents

MCP bridge that lets Claude Code delegate heavy tasks to the Antigravity CLI (agy) — purpose-built tools, model routing with fallback, session continuity, and output truncation to save Claude's context and tokens.

Exposes local execution of Aider commands as a detached process using MCP.

An MCP server for offloading AI coding tasks to Aider, enhancing development efficiency and flexibility.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.