Grapuco Documentation
Everything you need to set up, index, and query your codebase.
Getting Started
1. Get your API Key
Sign up and create a new project API Key to authenticate your CLI or MCP tool.
2. Install the CLI
Grapuco CLI is the engine that parses your AST locally. Run the following command securely on your machine:
npm install -g @bitsness/grapuco-cli3. Ingest Data
At the root of your project database, run the ingest command below. The engine will scan logic networks and map them onto the Cloud securely in a few seconds.
grapuco ingestArchitecture Graph
The moment ingestion completes, your codebase is transformed into a visual Knowledge Graph. Here's how to read it:
Filters
Tailor the graph to your exact needs. Toggle visibility by node types (API Endpoints, DB Models, Functions) or filter out noisy utility directories dynamically.
Explorer
Navigate through your entire codebase organically. Select any node to expand its surrounding ecosystem, inspecting properties, outgoing calls, and dependencies locally.
Flows
Discover auto-detected execution lifecycles. Click any HTTP Endpoint flow to trigger a luminous trace that highlights the exact path from Router to Database.
3. MCP Server Integration
MCP (Model Context Protocol) is an open standard that allows AI coding assistants like Claude, Cursor, and Windsurf to connect directly to external tools and data sources. When you connect Grapuco as an MCP server, your AI assistant gains full access to your codebase's architecture graph - enabling it to understand call chains, trace data flows, and analyze impact before writing a single line of code.
Connect Your AI Agent
One command to configure MCP for all AI coding agents on your machine:
grapuco setupThe CLI will ask for your API key, auto-detect installed AI tools (Claude Code, Cursor, Windsurf, Antigravity, etc.), and write the correct MCP config for each one.
Available MCP Tools
Once connected, your AI assistant can call these tools automatically. You don't need to invoke them manually - just ask your AI a question about your codebase and it will pick the right tool.
list_repositories
Lists all repositories you've indexed on Grapuco. This is the starting point - your AI will call this first to find the correct Repository ID before running any other tool.
search_code
Finds functions, classes, or methods by their exact name in the code graph. Think of it like a smart IDE search, but across your entire architecture map - not just text files.
semantic_search
Search your codebase using plain English instead of exact keywords. For example, ask "where do we validate JWT tokens?" and Grapuco will find the most relevant symbols using vector similarity (cosine distance).
get_dependencies
Given a specific function or class, this tool returns its full dependency tree: what it CALLS, what it IMPORTS, and what it EXTENDS. Perfect for understanding how deeply connected a piece of code is.
get_architecture
Returns the complete architecture map of a repository - every node (function, class, endpoint) and every edge (call, import, extend). Your AI uses this to understand the big picture before making changes.
get_context
AI-powered contextual retrieval. Give it a feature name like "user authentication flow" and it returns related symbols, call chains, and documentation. Costs 5 AI credits per query. Best for onboarding to unfamiliar codebases.
get_data_flows
Traces end-to-end execution paths: from HTTP API endpoints through services down to database operations. Shows exactly how a request travels through your system - ideal for debugging and understanding business logic.
get_impact_analysis
The "Blast Radius" detector. Point it at any file and it reveals every API endpoint, database operation, and workflow that would be affected if that file changes. Essential before refactoring or deploying risky changes.
get_symbol_context
360° view of any symbol: callers, callees, processes, heritage, DB access, routes, and overrides. Your go-to tool for understanding how a function fits into the bigger picture.
blast_radius
Compute the upstream and downstream impact of changing a symbol. Returns risk level (LOW to CRITICAL), affected routes, and impacted business processes.
detect_changes
Feed it a git diff and get back: which symbols changed, what's impacted downstream, affected routes, and overall risk level. Perfect for pre-commit safety checks.
rename_symbol
Safe multi-file rename. Preview all edits (declaration, call sites, imports, exports), detect naming conflicts, and optionally apply.
check_staleness
Check if your code graph is up-to-date with the latest commit. Returns recommendation: none, incremental, or full reindex needed.
detect_tools
Scan the codebase for MCP tools, gRPC services, and JSON-RPC methods. Useful for discovering API surface area.
grapuco_help
Get guidance on which tool to use. Returns the full skill and tool catalog, with optional topic filtering.
bootstrap
One-shot onboarding: returns repos, tool catalog, skill manifest, and recommended first moves. Call once at session start. Pass workspaceId to auto-resolve linked repos and spec projects.
Grapuco ships with built-in Skill Packs — step-by-step playbooks that teach your AI agent how to use Grapuco tools effectively. Each skill describes when to use it, what inputs are needed, and how to interpret the output.
explore
Onboard a new/unfamiliar codebase — discover structure, entry points, and key flows in minutes.
safe-edit
Check impact before editing code — get context, blast radius, and suggest tests to validate changes.
pre-commit
Run impact analysis on your git diff before committing — catch risky changes early.
rename
Safely rename a symbol across multiple files — preview all edits and conflicts before applying.
trace
Trace a request from API route through service layer to database — understand the full data flow.
bug
Investigate a bug using stack trace — trace each frame, find upstream causes, and scope the fix.
refactor
Plan a refactor by mapping blast radius, grouping by module, and scoping safe incremental steps.
spec-coding
Implement a feature using Spec Agent business specifications — requirements, acceptance criteria, and domain rules.
review-uc
Review a Use Case's full scope — requirements, steps, rules, actors, and dependencies — before writing code.
validate-rules
Search and validate business rules, constraints, and schemas relevant to your current implementation.
4. CLI Deep Dive
The Grapuco CLI runs entirely on your local machine. It parses your codebase's AST (Abstract Syntax Tree) and extracts only structural metadata - function names, call relationships, import maps. Zero source code ever leaves your machine.
grapuco login
Authenticate your CLI with the Grapuco cloud. You can pass your API key directly via flag, or run the command without flags for an interactive prompt. Credentials are stored securely at ~/.grapuco/credentials.json.
grapuco login --api-key YOUR_API_KEYgrapuco init
Initialize a new Grapuco project in the current directory. The CLI auto-detects your programming language and framework (NestJS, Next.js, Django, Spring Boot, etc.), creates a .grapuco/config.json file, and registers a new repository on the server.
grapuco initgrapuco ingest
The core command. Scans every file in your project, builds a full AST parse locally, then uploads only the metadata (nodes + edges) to the Grapuco cloud. This is a full re-sync - use it for the first run or when you want a complete refresh.
grapuco ingestgrapuco push
Smart incremental sync. Compares file hashes against the last push and only re-parses files that have changed (added, modified, or deleted). Dramatically faster than a full ingest - ideal for daily development workflows.
grapuco pushgrapuco watch
Real-time file watcher. Monitors your project directory using chokidar and automatically triggers a delta push whenever you save a file. Configure the debounce interval to control how frequently syncs happen. Press Ctrl+C to stop.
grapuco watchgrapuco inspect
Transparency tool. Parses your project locally and shows exactly what data would be sent to the server - without actually sending it. Perfect for security audits or verifying that no source code is included in the payload.
grapuco inspect --jsongrapuco status
Dashboard in your terminal. Shows your project config, detected language/framework, feature flags (embeddings, data flows), last push timestamp, cached file count, and remote repository status (node/edge counts).
grapuco statusgrapuco setup
Auto-configure MCP for your AI editor. Detects installed editors (Claude Code, Cursor, Windsurf, Codex, Antigravity), writes the MCP config, and verifies the connection.
grapuco setup