Grasp — Code Architecture Suite > [English](README.md) · [हिन्दी](README.hi.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [简体中文](README.zh.md)

CI npm License GitHub Pages
**150 MCP tools + 8 Resources + 2 Prompts · 35 languages · 11 AI providers + 200+ models via OpenRouter · 10 graph views · multimodal knowledge graph · zero data collection**
Browser App   VS Code   MCP Server   JetBrains   Firefox Add-ons   Chrome Web Store   Safari sideload   Raycast Store   Zed Extension
🌐 Browser App  ·  📦 MCP Server  ·  🐛 Report Bug  ·  ✨ Request Feature  ·  🔒 Privacy
--- ## What's New in v3.21.0 **New — Multimodal Knowledge Graph (MCP server).** Seven new MCP tools ingest your documents — PDF, DOCX, XLSX, HTML, images (OCR), audio/video (local Whisper via `@xenova/transformers` + ffmpeg), YouTube, and URLs — alongside your code into a queryable knowledge graph, then answer natural-language questions with citations: `grasp_ingest`, `grasp_kg_ask`, `grasp_kg_trace`, `grasp_kg_explain`, `grasp_kg_stats`, `grasp_kg_export`, `grasp_llm_status`. A **local-first** multi-LLM layer auto-detects Ollama before any cloud key and falls back to a zero-credential deterministic engine. Server-side only (Node MCP server, not the browser app) — see **Multimodal Knowledge Graph** under [Code Intelligence](#code-intelligence). **+3 native AST languages** — Bash, Elixir, and Julia take tree-sitter-backed function extraction, call counting, and complexity scoring to **19 languages**. **Optional MCP-over-HTTP bridge** — set `GRASP_HTTP_MCP=1` to expose the MCP server over Streamable HTTP (bearer-token auth) so a whole team can share one Grasp instance instead of each running their own stdio server. **Previously in v3.20.0:** Full security scanning suite — `grasp_vulnerabilities` covers **5 threat vectors** (OSV.dev dependency CVEs, NIST NVD container/runtime CVEs, local supply-chain integrity checks, Socket.dev behavioral analysis, and scheduled `grasp_vuln_watch` monitoring) with `skip_container` / `skip_socket` / `skip_integrity` fast-scan flags. **Previously in v3.19.0:** Full visual + UX parity between `team-dashboard.html` and `index.html` — teal brand sweep, SVG icons, 7-provider auth, mobile More menu, keyboard shortcut popover. **Previously in v3.18.0:** 9 new MCP tools (graph analytics + LLM-context), 11 graph export formats, TypeScript path-alias + Python import resolvers, Claude Code slash commands, token-reduction eval harness (3,241× on `got@v14`). Total as of v3.21.0: **150 MCP tools · 8 Resources · 2 Prompts · 35 languages · 11 graph export formats · 10 graph views · multimodal knowledge graph · 19 themes**. --- ## What is Grasp? **Grasp** turns any GitHub or GitLab repository — cloud or self-hosted — or local codebase into an interactive architecture map in seconds. **150 MCP tools** (plus 8 Resources and 2 guided Prompts) expose the full analysis engine to Claude Code, Cursor, and any MCP-compatible agent. ``` Paste URL / Open Folder → AST Analysis Engine → Architecture Map + 150 MCP Tools ``` | | | |---|---| | **No installation** | Runs 100% in your browser — two HTML files, no build step | | **No data collection** | Your code never leaves your machine | | **No accounts** | Paste a URL and go | | **Works offline** | Analyse local folders without internet | | **35 languages** | JS/TS, Python, Go, Java, Rust, C/C++, C#, Ruby, Swift, Kotlin, Scala, Dart, Elixir, Erlang, Haskell, OCaml, F#, Clojure, Julia, Lua, R, Perl, Shell, PowerShell, Groovy, Zig, V, Nim, Crystal, VBA, Ada/SPARK, Vue, Svelte, PHP | | **150 MCP tools** | Dependency graphs, security, **OSV.dev SCA vulnerability scanning**, DORA, brain store, Kuzu graph schema v3, communities, ORM tracker, git change impact, architecture drift detection, test coverage gap map, org dashboard, PR impact action, MCP Resources/Prompts, `grasp setup` editor auto-config | | **11 AI providers** *(+ unlimited via routers)* | Direct: Anthropic Claude (3 models), OpenAI (GPT-4o + o-series), Google Gemini (3), Mistral (2), Groq (3), DeepSeek (chat + reasoner), Ollama (local), LM Studio (local), Custom OpenAI-compatible endpoint. Routers: OpenRouter (200+ models via slug) and Together AI (50+ open-source models). **Switchable mid-conversation**, **fully off by default** (chat panel closed = zero network calls), **API keys stored in `localStorage` only** — Grasp has no proxy or telemetry. | | **10 graph views** | Force graph, 3D, arch, treemap, matrix, tree (dendrogram), flow (sankey), bundle, cluster (disjoint), heatmap | | **Grasp Brain** | SQLite + Kuzu persistent store — index once, query instantly. FTS5 + 384D vector embeddings + Cypher graph queries | | **Supply chain signed** | SLSA Level 2 npm provenance + Cosign keyless Docker signing on every release | --- ## Who is Grasp for? | You are… | Grasp helps you… | Start with | |----------|------------------|------------| | **Tech lead** joining a new team | Map the codebase in 60s, find the riskiest hotspots, identify good first issues | `Try expressjs/express` chip → ISS tab + ACT tab | | **Engineering manager** | Track health across all team repos, see DORA metrics, identify bus-factor risks | `team-dashboard.html` | | **Open-source maintainer** | Generate a wiki, label good first issues, post PR impact comments | `grasp_wiki` + GitHub Action `grasp-pr-impact` | | **Security reviewer** | Spot hardcoded secrets, scan dependencies for CVEs, generate SBOM/SARIF | VULN tab + `grasp_sbom` + `grasp_sarif` | | **AI agent (Claude Code, Cursor, Copilot)** | Get sub-100-token repo orientation + token-budget-aware traversal | MCP server: `grasp_minimal_context` → `grasp_traverse` | | **Developer onboarding** | Get an ordered reading path, plain-English explanations of any file | `grasp_onboard` + `grasp_explain` | | **Refactoring contractor** | Plan migrations with topological ordering, preview renames, find duplicate code | `grasp_migration_plan` + `grasp_apply_refactor` | | **CTO evaluating tech debt** | Quantify debt in dev-days, flag legacy hotspots, justify rewrite budget | Health Score + Technical Debt + Org Dashboard | --- ## What makes Grasp different Grasp is intentionally additive to whatever static-analysis or graph tool you already use. The axes that matter: | Capability | Grasp | |-----------|-------| | Run on a stranger's repo without cloning | ✅ Paste URL → instant analysis in browser | | Zero install, zero account | ✅ Single HTML file, runs entirely in browser | | MCP-native — works with Claude Code, Cursor, Copilot, Continue, etc. | ✅ 150 tools, 8 Resources, 2 Prompts | | Supply-chain CVE scanning | ✅ OSV.dev across npm/PyPI/Go/Cargo/Maven | | 35 languages with native AST | ✅ Tree-sitter | | Local — your code never leaves your machine | ✅ Browser fetches direct; MCP runs as subprocess | | Persistent architecture intelligence | ✅ Brain store + Kuzu graph DB | | Multi-channel — Chrome/Firefox/Safari/VS Code/JetBrains/Docker/Raycast/Zed | ✅ 13 distribution channels | --- ## Screenshots ### 🕸️ Dependency Graph — see exactly how files connect Grasp dependency graph view ### 🏛️ Architecture Diagram — your codebase by layer Grasp architecture diagram view ### 📦 Treemap — files sized by line count Grasp treemap view ### 🏢 Team Dashboard — health across all your repos at a glance Grasp team dashboard --- ## Quick Start ### Option 1 — Browser (zero setup) ```bash git clone https://github.com/ashfordeOU/grasp.git open index.html # Main app open team-dashboard.html # Team Dashboard ``` No build step. No `npm install`. **Two HTML files.** ### Option 2 — CLI ```bash npm install -g grasp-mcp-server grasp ./my-project # Analyse a local folder grasp facebook/react # Analyse a GitHub repo grasp . # Analyse current directory grasp . --watch # Live mode — browser reloads on every file save grasp . --timeline # Time-travel — last 30 commits as a scrubber grasp . --report # Terminal-only report + JSON output grasp . --format=sarif # Export SARIF for GitHub Code Scanning grasp . --pr-comment # Print GitHub PR comment markdown to stdout grasp . --check # Enforce grasp.yml architecture rules (CI gate) ``` ### Option 3 — IDE Extensions | IDE | Install | |-----|---------| | **VS Code** | [Install (.vsix)](https://github.com/ashfordeOU/grasp/releases/latest) — download `grasp-vscode-3.21.0.vsix` and run **Extensions: Install from VSIX…** (`Cmd+Shift+P`) | | **JetBrains** | [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/31362-grasp--code-architecture-visualizer) — search **Grasp** in Settings → Plugins | | **Raycast** | [Raycast Store](https://www.raycast.com/ashfordeOU/grasp) — or search **Grasp** in the Raycast extension store | | **Zed** | [Zed Extensions](https://zed.dev/extensions?query=grasp) — or search **grasp** in Zed → Extensions | ### Option 4 — Browser Extension | Browser | Install | |---------|---------| | **Chrome** | [Chrome Web Store](https://chromewebstore.google.com/detail/grasp-%E2%80%94-code-architecture/pipmlammandfhfbodllcjolgeolkhapj) | | **Firefox** | [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/grasp-code-architecture) — ID: `grasp@ashforde.org` | | **Safari** | [GitHub Releases](https://github.com/ashfordeOU/grasp/releases) — see [sideload instructions](#safari-sideload) | A floating **Grasp** button appears on every GitHub and GitLab page. Supports self-hosted GitLab, GitHub Enterprise, and any custom host via on-demand permission grants. --- ### Distribution at a Glance Every tagged release auto-publishes to all channels: | Channel | Status | Link | |---------|--------|------| | **npm** (`grasp-mcp-server`) | [![npm](https://img.shields.io/npm/v/grasp-mcp-server?style=flat-square)](https://www.npmjs.com/package/grasp-mcp-server) | `npm install -g grasp-mcp-server` | | **MCP Registry** | Listed | [modelcontextprotocol.io](https://mcpregistry.com) | | **Docker** (`ghcr.io/ashfordeou/grasp`) | [![ghcr](https://img.shields.io/badge/ghcr.io-latest-blue?style=flat-square)](https://github.com/ashfordeOU/grasp/pkgs/container/grasp) | `docker pull ghcr.io/ashfordeou/grasp:latest` | | **VS Code** | `.vsix` on Releases | [GitHub Releases](https://github.com/ashfordeOU/grasp/releases/latest) | | **JetBrains** | Marketplace | [Plugin ID 31362](https://plugins.jetbrains.com/plugin/31362-grasp--code-architecture-visualizer) | | **Raycast** | Store (PR per release) | [raycast.com/ashfordeOU/grasp](https://www.raycast.com/ashfordeOU/grasp) | | **Zed** | Extension (PR per release) | [zed.dev/extensions](https://zed.dev/extensions?query=grasp) | | **Chrome** | Web Store | [CWS listing](https://chromewebstore.google.com/detail/grasp-%E2%80%94-code-architecture/pipmlammandfhfbodllcjolgeolkhapj) | | **Firefox** | AMO (listed) | [addons.mozilla.org](https://addons.mozilla.org/firefox/addon/grasp-code-architecture) | | **Safari** | Sideload (macOS 13+) | [GitHub Releases](https://github.com/ashfordeOU/grasp/releases) | | **GitLab bot image** | `ghcr.io/ashfordeou/grasp-gitlab-bot` | Auto-pushed per release | | **GitLab tunnel agent** | Binary on Releases | [GitHub Releases](https://github.com/ashfordeOU/grasp/releases) | | **GitHub Release** | Signed + checksums | [Releases page](https://github.com/ashfordeOU/grasp/releases) | ### AI-tool integrations *(Grasp called by your assistant via MCP or extension)* | AI tool | How to install | Notes | |---------|----------------|-------| | **Claude Code** | `claude mcp add grasp -- npx -y grasp-mcp-server` | Native MCP — all 150 tools + 8 Resources + 2 Prompts | | **Cursor** | Add `grasp-mcp-server` to `~/.cursor/mcp.json` | Native MCP | | **Cline / Roo Code / Kilo Code** | MCP config in VS Code settings | Native MCP | | **Windsurf** | MCP config | Native MCP | | **Codex / OpenCode / Trae / Droid** | MCP config | Native MCP — `grasp setup` auto-configures all of them | | **Gemini CLI / Grok CLI** | MCP config | Native MCP | | **GitHub Copilot Chat** | Install `grasp-copilot-extension` | Copilot calls Grasp via the Copilot Extension API — `@grasp` mention in chat | | **Continue** | `continue-provider` package | Grasp as a Continue context provider | | **Amazon Q Developer** | `amazon-q-plugin` | Grasp surfaces in Q's chat | | **GPT Actions / Custom GPTs** | `gpt-actions` package | Grasp exposed as REST for OpenAI Actions schema | | **Aider / Sweep / any tool** | Use the `grasp-mcp-server` npm package | Tool-agnostic stdio JSON-RPC |
🧭 Safari Sideload Instructions ```bash curl -sL https://github.com/ashfordeOU/grasp/releases/latest/download/grasp-safari-extension.zip \ -o /tmp/grasp-safari.zip \ && unzip -q /tmp/grasp-safari.zip -d /tmp/grasp-safari \ && mv /tmp/grasp-safari/Grasp.app /Applications/ \ && open /Applications/Grasp.app ``` Then in Safari: **Settings → Extensions → enable Grasp**. If it doesn't appear, enable **Safari → Develop → Allow Unsigned Extensions** first.
--- ## How It Works ``` ┌──────────────────────────────────────────────────────────────────┐ │ Input │ │ github.com/owner/repo · gitlab.com/ns/proj · ./local/path │ └────────────────────────────────┬─────────────────────────────────┘ ▼ ┌──────────────────────────────────────────────────────────────────┐ │ Analysis Pipeline (mcp/src/) │ │ │ │ 1. scan file enumeration + gitignore │ │ 2. parse tree-sitter AST · 35 languages · 19 native │ │ 3. resolvers tsconfig path-alias · Jedi-style Python imports │ │ 4. routes HTTP route detection (Express/FastAPI/Gin) │ │ 5. tools MCP/gRPC tool definition detection │ │ 6. orm ORM query tracking (Prisma/TypeORM/Sequelize/SA) │ │ 7. scope 3-tier call resolver (0.95 → 0.90 → 0.50) │ │ 8. types cross-file type propagation (Kahn topo-sort) │ │ 9. coverage test-file detection → TESTS/COVERS edges (v3) │ │ 10. communities Louvain community detection on import graph │ │ 11. processes BFS execution-flow tracing from entry points │ │ 12. analytics degree centrality · Brandes betweenness · │ │ surprising-edge rarity · knowledge-gap detection │ │ 13. vulns OSV.dev SCA scan (npm/PyPI/Go/Cargo/Maven) │ └───────────┬──────────────────────────┬────────────────────────────┘ │ │ ┌───────▼─────────┐ ┌───────────▼─────────────────┐ │ Browser App │ │ MCP Server (CLI) │ │ index.html │ │ grasp-mcp-server │ │ │ │ │ │ 10 graph views │ │ 150 tools · 8 Resources │ │ 16 color modes │ │ 2 guided Prompts │ │ AI Chat (11p) │ │ Brain + Kuzu Schema v3 │ │ Ask Grasp │ │ Hybrid search (BM25+vector) │ │ Coverage overlay│ │ Graph analytics (5 tools) │ │ VULN tab │ │ LLM-context (4 tools) │ │ Try-it chips │ │ Graph exports (GraphML / │ │ Token indicator │ │ Cypher / Obsidian) │ │ Snapshot URLs │ │ Slash commands (3 in │ │ Compare modal │ │ .claude/commands/) │ │ Mid-fetch retry │ │ grasp setup (5 editors) │ │ Mobile touch │ │ grasp vulns / drift / org │ └─────────────────┘ └──────────────────────────────┘ ``` **Analysis flow (v3.18.0):** the pipeline is additive — phase 12 (graph analytics) runs after the dependency graph is built and produces the data backing `grasp_hub_nodes`, `grasp_bridge_nodes`, `grasp_surprising_connections`, `grasp_knowledge_gaps`, and `grasp_suggested_questions`. Phase 13 only runs when a manifest (`package.json`, `requirements.txt`, `go.mod`, `Cargo.toml`, `pom.xml`) is present. Both browser and MCP server share the exact same pipeline output via the `~/.grasp/brain.db` + `~/.grasp/graph/` pair so a CLI `grasp index` and a browser analyze of the same repo are interchangeable. --- ## Visualizations ### Graph Types | View | Description | |------|-------------| | 🕸️ **Graph** | Force-directed dependency graph — drag, zoom, multi-select | | 🔮 **3D Graph** | Three-dimensional force graph — rotate, pan, zoom | | 🏛️ **Arch** | Layer-by-layer architecture diagram | | 📦 **Treemap** | Files sized by line count, grouped by folder | | 📊 **Matrix** | Adjacency matrix showing all dependencies | | 🌳 **Tree** | Hierarchical cluster dendrogram | | 🌊 **Flow** | Folder-level Sankey dependency flow | | 🎯 **Bundle** | Circular layout with arc-based connections | | 🔮 **Cluster** | Separated force graphs per folder | ### Color Modes | Mode | What it shows | |------|---------------| | 📁 **Folder** | Directory structure | | 🏗️ **Layer** | Architectural layer (UI, Services, Utils, etc.) | | 🔥 **Churn** | Commit frequency — red = most-changed hot spots | | ⚡ **Complexity** | Cyclomatic complexity (green → yellow → red) | | 💥 **Blast** | Blast radius impact for a selected file | | 🌊 **Depth** | Max brace-nesting depth | | 🔎 **Dup** | Duplicate code density — red = many clones | | 👤 **Owner** | Top contributor — spot bus-factor risks | | 🐛 **Issues** | Linked GitHub Issues per file | | 🧪 **Coverage** | Test coverage — highlight untested files | | 📦 **Bundle** | Bundle size contribution | | 🌐 **API Surface** | Public-facing file exposure | | ⚡ **Runtime** | Actual call frequency from a live trace | | 🔒 **Safety** | Safety gate coverage (green = gated, red = ungated) | | 🧪 **Boundary** | Research/production boundary drift | | 🧪 **Eval Coverage** | Coverage from eval/test scripts | --- ## Code Intelligence ### 📊 Health Score Instant **A–F grade** based on dead code, circular dependencies, coupling metrics, and security issues. Displayed as a score (0–100) with a visual bar. ### 🔐 Security Scanner Automatic detection of hardcoded secrets & API keys, SQL injection risks, dangerous `eval()` usage, and debug statements left in production. ### 🛡️ Dependency & Container Security Scanner *(v3.17.0, expanded v3.20.0)* Five-layer security scan via `grasp_vulnerabilities`: - **Dependency CVEs** — declared deps (npm/PyPI/Go/Cargo/Maven) vs [OSV.dev](https://osv.dev) public CVE database. Resolves pinned versions from lockfiles. Severity-classified with CVSS scores and fix-version suggestions. Health score deducts –5 per critical and –3 per high. - **Container/Runtime CVEs** — parses `Dockerfile` (`FROM image:tag`), `docker-compose*.yml`, and CI workflow YAML for pinned image versions, then queries [NIST NVD](https://nvd.nist.gov). Set `GRASP_NVD_API_KEY` for higher rate limits. - **Supply-chain integrity** — local checks (no network): npm lockfile sha512 `integrity` field coverage, `go.sum` alongside `go.mod`, `Cargo.lock` alongside `Cargo.toml`, `--hash=` pinning in `requirements.txt`. - **Behavioral analysis** — [Socket.dev](https://socket.dev) free API scans npm packages for malware, supply-chain risk, and install-script signals (up to 50 packages per scan). - **Scheduled monitoring** — `grasp_vuln_watch` MCP tool: `start`/`stop`/`status`/`history` actions; periodic re-scans via `setInterval`; persists scan history + CVE diffs in `brain.db`. New `grasp vulns ` CLI exits 1 on critical/high findings (CI-friendly). **100% client-side** — all API requests go directly from your machine to the respective services, never through a Grasp server. ### 🧩 Pattern Detection Identifies Singleton, Factory, Observer/Event patterns, React hooks, and anti-patterns (God Objects, high coupling) — automatically. ### 💥 Blast Radius Analysis *"If I change this file, what breaks?"* — select any file and see every downstream file that would be affected, highlighted on the graph. ### 🔥 Activity Heatmap Colors files by commit frequency. Works for GitHub repos (via API) and **local repos** (via `git log` — no internet required). ### 🔎 Duplicate & Similarity Detection The **Dup** color mode highlights files with exact or near-duplicate code. The `grasp_similarity` MCP tool returns ranked duplicate clusters for targeted refactoring. ### 🧠 Multimodal Knowledge Graph *(MCP server)* Build a queryable knowledge graph from your codebase **and** external documents, then ask natural-language questions with cited answers. Runs entirely inside the Node MCP server — **not** the browser app. `grasp_ingest` parses PDF, DOCX, XLSX, HTML, images (OCR), audio/video (local Whisper via `@xenova/transformers` + ffmpeg), YouTube, and URLs; heavy parsers are optional, lazy-loaded dependencies. Entities and relations are tagged **EXTRACTED** vs **INFERRED** with source locators and persisted to SQLite `kg.db`; retrieval is hybrid BM25 + vector. A **local-first** multi-LLM layer auto-detects Ollama before any cloud key and falls back to a deterministic engine that needs zero credentials (Anthropic / OpenAI / Gemini / DeepSeek / Kimi / Azure / Bedrock / Ollama). The whole server can optionally be shared across a team over HTTP (`GRASP_HTTP_MCP=1`, optional `GRASP_HTTP_API_KEY`, port `7333`, `/health`). | MCP Tool | Description | |----------|-------------| | `grasp_ingest` | Ingest a file, URL, or media source (PDF/DOCX/XLSX/HTML/image OCR/audio/video/YouTube) into the knowledge graph | | `grasp_kg_ask` | Natural-language Q&A over the graph with inline source citations (hybrid BM25 + vector) | | `grasp_kg_trace` | BFS path-tracing between two entities | | `grasp_kg_explain` | Explain an entity, its relations, and whether each fact was EXTRACTED or INFERRED | | `grasp_kg_stats` | Graph statistics — entity/relation counts, hubs, and god-nodes | | `grasp_kg_export` | Export the graph as Cypher, GraphML, JSON, or Mermaid | | `grasp_llm_status` | Report the active LLM provider and any detected local models (Ollama), including deterministic-fallback state | ### 👥 Code Ownership Top contributors per file from git history, with line-percentage breakdowns. One-click jump to GitHub Blame. ### 📋 PR Impact Analysis Paste a PR URL to see which files it touches and calculate the blast radius of proposed changes before merging. ### 💰 Technical Debt Quantification Converts every architectural issue into developer-hours using configurable estimates — circular dep = 4h, god file = 16h, critical security = 8h — with a coupling multiplier. Shown in the health panel and Team Dashboard. ### 🔗 Shareable Embeds Click `⋯ → 🔗 Embed` for a ready-to-paste `