Graft
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Graft map the codebase structure"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Why Graft?
AI coding tools are only as good as the context they receive. Most tools either have no codebase understanding, or use proprietary indexing locked to a single editor.
Graft gives any MCP-compatible AI tool deep structural understanding of your codebase:
100K lines of code represented in ~2K tokens of ranked context
Dependency-aware — knows which files import what, and what depends on what
PageRank-scored — surfaces the most structurally important files first
Tool-agnostic — works with Claude, Cursor, Windsurf, Continue, or any MCP client
Local-first — no cloud, no telemetry, no code ever leaves your machine
$ npx graftmap map
src/indexer/pipeline.ts [score: 0.0842]
function buildIndex (L19)
src/graph/pagerank.ts [score: 0.0731]
function computePageRank (L52)
function buildTeleportVector (L11)
src/parser/index.ts [score: 0.0654]
function parseFiles (L28)
src/mcp/server.ts [score: 0.0612]
function createGraftServer (L238)
function startMcpServer (L327)
[~487 tokens]Related MCP server: agentmako
Quick Start
# Run instantly with npx (no install needed)
npx graftmap map
# Or install globally
npm install -g graftmap
graft mapMCP Integration
Add Graft to your AI tool's MCP configuration. Once connected, your AI assistant automatically gets ranked codebase context.
Claude Desktop / Claude Code
Add to your MCP settings:
{
"mcpServers": {
"graft": {
"command": "npx",
"args": ["-y", "graftmap"],
"cwd": "/path/to/your/project"
}
}
}Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"graft": {
"command": "npx",
"args": ["-y", "graftmap"],
"cwd": "/path/to/your/project"
}
}
}Any MCP Client
Graft speaks standard MCP over stdio. Point any MCP-compatible client at npx graftmap and it works.
MCP Tools
Once connected, your AI tool gets these capabilities:
Tool | Description |
| Ranked tree map of the codebase by structural importance |
| Dependencies and definitions for a specific file |
| Find definitions by name or kind (function, class, type, etc.) |
| Files affected by changing a given file |
| Project overview with key files and tech stack |
Plus two MCP resources: graft://map and graft://file/{path}
CLI Commands
graft map # Ranked codebase tree
graft map --focus src/api.ts # Personalized view focused on a file
graft map --budget 4096 # Custom token budget
graft stats # File count, definitions, edges, cache age
graft impact src/auth.ts # What breaks if you change this file?
graft search "handleRequest" # Find definitions by name
graft search "User" --kind class # Filter by kind
graft serve # Start MCP server (default command)How It Works
Your Codebase Graft Pipeline AI Tool
───────────── ────────────── ───────
.ts .js .py ──► tree-sitter AST
extraction
│
dependency graph ──► graft_map
construction graft_context
│ graft_search
personalized ──► graft_impact
PageRank scoring graft_summary
│
token-budgeted ──► Ranked context
rendering in ~2K tokensDiscover — finds all supported files, respects
.gitignoreParse — extracts definitions (functions, classes, types) and references using tree-sitter
Graph — builds a directed dependency graph (files as nodes, imports as edges)
Rank — runs personalized PageRank to score files by structural importance
Render — produces token-budgeted output that fits in any AI context window
Cache — stores results in
.graft/cache.jsonfor instant re-indexing
Supported Languages
Language | Definitions | References | Status |
TypeScript | Functions, classes, interfaces, types, enums, methods | Imports, usages | Stable |
JavaScript | Functions, classes, methods | Imports, usages | Stable |
TSX/JSX | Same as TS/JS | Same as TS/JS | Stable |
Python | Functions, classes, methods, decorators, dataclasses | Imports, usages | Stable |
Go | — | — | Planned |
Rust | — | — | Planned |
Performance
Graft is designed for large codebases:
Caching — parses once, re-indexes only changed files
Token-efficient — 100K LOC → ~2K tokens of meaningful context
Fast — full index of a medium codebase in under 3 seconds
Memory-efficient — in-memory graph, no external database needed
Configuration
Graft is zero-config by default. It automatically:
Discovers
.ts,.tsx,.js,.jsx, and.pyfilesRespects
.gitignorepatternsExcludes
node_modules,dist,.git, and common build directoriesUses sensible defaults for token budgets and PageRank parameters
No config files needed. Ever.
Contributing
Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines.
Especially interested in:
New language support (Go, Rust, Java, C#, Ruby)
Performance optimizations for very large monorepos
MCP tool improvements and new tool ideas
Integration guides for more AI coding tools
License
MIT — use it anywhere, for anything.
Available Tools
5 toolsgraft_contextC
Dependencies and definitions for a specific file.
Inputs: path (required).
graft_impactC
Files affected by changing a given file.
Inputs: path (required).
graft_mapC
Ranked tree map of the codebase by structural importance.
Inputs: query, budget.
graft_searchA
Find definitions by name or kind.
Inputs: query (required), kind.
graft_summaryB
Project overview with key files and tech stack.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: context for a file, impact analysis, codebase map, definition search, and project summary. No overlap or ambiguity.
All tools follow the consistent pattern 'graft_<noun>' with simple, descriptive names (context, impact, map, search, summary). Perfect consistency.
5 tools is well-scoped for a focused code analysis server. Each tool earns its place covering essential exploration tasks without unnecessary bloat.
The set covers core codebase exploration: summary, search, context, impact, and structural map. Minor gaps like diff or history exist but the surface is practical for typical use.
Maintenance
Related MCP Connectors
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Related MCP Servers
- AlicenseAqualityCmaintenanceCode graph context engine that parses codebases with tree-sitter (170+ languages), builds structural dependency graphs, and provides 24 MCP tools for code intelligence. One prepare_context call gives your AI agent the right files for any task. Includes focus, blast radius, hotspots, dead code detection, and hybrid search.241AGPL 3.0
- AlicenseCqualityCmaintenanceLocal-first codebase intelligence engine providing AI coding agents with a typed MCP toolset for understanding and navigating code repositories.10054Apache 2.0
- AlicenseNot gradedqualityCmaintenanceTurn your codebase into AI context — entirely on your machine. Single-binary MCP server with AST parsing, call graph, and local embeddings.27MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to locally search, query, and understand codebases with token-efficient context, dependency graphs, history, architecture diagrams, and metrics through MCP.15 npm3MIT