Grasp — Claude Code MCP server for code architecture analysis
Gives your coding agent a dependency graph, architecture layers, vulnerability findings and a refactor plan for a GitHub repo or a local folder.
claude mcp add grasp -- npx -y grasp-mcp-serverWhat Grasp — Code Architecture & Dependency Analysis does
Grasp runs as an MCP server and wires its analysis engine into the agent. It reads GitHub repositories and local directories, then reports what hangs off what: dependency graphs, circular imports, architecture layers, dead code, metrics, git history, duplicates, monorepo workspaces and API surface maps.
A security suite checks dependencies against OSV.dev, looks for container and runtime CVEs via NIST NVD, runs local supply-chain integrity checks and Socket.dev behavioural analysis. For a quick pass there are skip_container, skip_socket and skip_integrity flags.
Later releases added a multimodal knowledge graph. You feed it code, Markdown, PDFs, spreadsheets, images through OCR or video with transcription by local Whisper, then ask questions in plain language. Parsing stays deterministic on tree-sitter. Entity and relationship extraction go through an LLM: the server picks up a local Ollama at localhost:11434 first, and cloud keys are opt-in. With no LLM at all a bundled local extractor still works. Shared team access over HTTP is switched on with GRASP_HTTP_MCP=1.
What it helps with
- see what breaks elsewhere before you refactor a module
- track down circular imports and dead code in a large repo
- scan project dependencies for known CVEs
- draft a migration plan and list the affected API surface
- split a monorepo into workspaces and layers
Example prompts for the agent
- Analyze the
ashfordeOU/grasprepo and draw the dependency graph with any cycles - Run
grasp_vulnerabilitieson this project, skip the container and Socket checks - Ingest the
./docsfolder and tell me how the auth flow works
How to install Grasp — Code Architecture & Dependency Analysis
Platform CLI
claude mcp add grasp -- npx -y grasp-mcp-serverPlatform CLI
codex mcp add mcp -- npx -y grasp-mcp-serverConfig file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"grasp-mcp-server"
]
}
}
}Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"grasp-mcp-server"
]
}
}
}Platform CLI
gemini mcp add mcp npx -y grasp-mcp-serverStep 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 Grasp — Code Architecture & Dependency Analysis
How do I install Grasp in Claude Code?
Run claude mcp add grasp -- npx -y grasp-mcp-server. The server starts through npx and shows up in the agent.
What does Grasp do?
It builds dependency and architecture-layer graphs, finds cycles, dead code and duplicates, and scans dependencies and containers for vulnerabilities. It also ingests code and documents into a knowledge graph you can query.
Do I need an API key to run it?
Entity extraction looks for a local Ollama at localhost:11434 first. A cloud provider is opt-in with a key such as ANTHROPIC_API_KEY or OPENAI_API_KEY. Without any LLM a deterministic extractor takes over.