agent-context-graph
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., "@agent-context-graphShow blast radius for the User model"
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.
agent-context-graph
agent-context-graph is a local MCP server for AI coding agents. It helps tools such as Antigravity, Codex, Claude Code, and Cursor understand a project before editing it.
It provides:
a local code knowledge graph
scope checks before file edits
append-only reasoning logs
local best-practice notes for testing, security, APIs, auth, and architecture
Everything runs on your machine. There is no SaaS backend, telemetry, analytics, GitHub API call, or runtime network call.
flowchart LR
App["Your project"] --> MCP["agent-context-graph MCP server"]
Antigravity["Antigravity"] --> MCP
Codex["Codex"] --> MCP
Claude["Claude Code"] --> MCP
Cursor["Cursor"] --> MCP
MCP --> Graph["Graph JSONL"]
MCP --> Logs["Reasoning logs"]
MCP --> Scope["Scope lock"]Requirements
Node.js 20 or newer
npm
Git
Windows, macOS, or Linux
Related MCP server: projscan
Install Once
Clone this tool anywhere convenient, not inside every app project but in user-profile for global access
git clone https://github.com/Raviraj2024/Agent-Context-Graph.git
cd Agent-Context-Graph
npm install
npm run build
npm test
npm linkAfter npm link, this command should work from any folder:
agent-context-graph statusRecommended folder layout:
Projects/
Agent-Context-Graph/ # this tool
my-app/ # your real projectUse In A Project
Go to the project you want an AI tool to work on:
cd /path/to/my-app
agent-context-graph init
agent-context-graph statusThis creates:
my-app/
.agent-context-graph/
config.json
graph/
logs/Run agent-context-graph init once per project.
Antigravity Setup
Use Antigravity's MCP config format:
{
"mcpServers": {
"agent-context-graph": {
"command": "agent-context-graph",
"args": ["serve"],
"env": {
"AGENT_CONTEXT_GRAPH_ROOT": "/absolute/path/to/my-app"
}
}
}
}Windows example[RECOMMENDED]:
{
"mcpServers": {
"agent-context-graph": {
"command": "agent-context-graph",
"args": ["serve"],
"env": {
"AGENT_CONTEXT_GRAPH_ROOT": "C:/Users/<USER-PROFILE>/.../my-app"
}
}
}
}If you do not use npm link, use Node directly:
{
"mcpServers": {
"agent-context-graph": {
"command": "node",
"args": [
"C:/Users/<USER_PROFILE>/agent-context-graph/dist/bin/agent-context-graph.js",
"serve"
],
"env": {
"AGENT_CONTEXT_GRAPH_ROOT": "C:/Users/<USER-PROFILE>/.../my-app"
}
}
}
}Restart Antigravity after saving the MCP config.
Codex, Claude Code, Cursor
Inside your target project, run only the command for the platform you use:
agent-context-graph connect codex
agent-context-graph connect claude-code
agent-context-graph connect cursorThese commands write project-local MCP config files:
Codex:
.codex/config.tomlClaude Code:
.claude/mcp.jsonCursor:
.cursor/mcp.json
Prompt To Use
Use this kind of prompt in Antigravity or any other coding agent:
Use the agent-context-graph MCP server before editing.
First inspect the project graph, refresh it, query relevant best practices,
declare the task scope, check scope before edits, and record every change.
Before your final answer, run the actual app/test command yourself.
If the command fails because a dependency is missing, fix it if safely in scope
or report the exact blocker. Do not give me an untested run command.
Now implement: <your task>How The Agent Should Work
The MCP server tells the agent to:
inspect the project graph
refresh stale graph data
read relevant best-practice notes
declare what files or nodes it plans to change
check scope before every write
ask the user before sensitive or out-of-scope edits
record each change with reasoning
run the real app/test command before final response
The server cannot force every AI platform to obey, but these instructions are exposed through MCP so the agent can follow them automatically.
Useful Commands
agent-context-graph init
agent-context-graph status
agent-context-graph serve
agent-context-graph reset
agent-context-graph connect codex
agent-context-graph connect claude-code
agent-context-graph connect cursorinit: build the graph for the current projectstatus: show graph/cache statusserve: start the MCP serverreset: rebuild the local SQLite cacheconnect: add MCP config for a supported client
MCP Tools
The server exposes these tools:
get_project_overviewinit_or_refresh_graphget_node_contextget_blast_radiusget_definitive_pathquery_best_practicesdeclare_task_scopecheck_scoperecord_changeget_node_history
What To Commit
Commit these files from your target project:
.agent-context-graph/config.json
.agent-context-graph/graph/nodes.jsonl
.agent-context-graph/graph/edges.jsonl
.agent-context-graph/logs/*.jsonl
.agent-context-graph/change-index.jsonIgnore these files:
.agent-context-graph/cache.sqlite
.agent-context-graph/cache.sqlite-*
.agent-context-graph/.lockSupported Code
Current indexing support:
TypeScript and TSX
JavaScript and JSX
Python
The graph stores signatures, docstrings, line numbers, tags, and hashes. It does not store full source code bodies.
Troubleshooting
agent-context-graph command not found
Run this from the cloned tool repo:
npm linkOr use the direct Node command shown in the Antigravity setup.
Antigravity connects but sees the wrong project
Check this value:
"AGENT_CONTEXT_GRAPH_ROOT": "/absolute/path/to/my-app"It must point to the project you want Antigravity to edit.
Graph is empty
Run this inside your target project:
agent-context-graph initCache looks broken
Run:
agent-context-graph resetThis only removes the rebuildable SQLite cache. It does not delete graph snapshots or logs.
npm install fails on better-sqlite3
Use Node.js 20 or newer. If npm tries to compile better-sqlite3, install your platform's normal C/C++ build tools and rerun:
npm installDevelopment
npm install
npm run build
npm testLicense
MIT
Available Tools
10 toolscheck_scopeC
Classify proposed changes against a declared scope.
| Name | Required | Description | Default |
|---|---|---|---|
| scopeId | Yes | ||
| proposedChanges | Yes |
declare_task_scopeC
Declare task scope before edits.
| Name | Required | Description | Default |
|---|---|---|---|
| taskDescription | Yes | ||
| targetIdentifiers | Yes |
get_blast_radiusB
Return reachable nodes through calls/imports/inherits up to maxDepth.
| Name | Required | Description | Default |
|---|---|---|---|
| maxDepth | Yes | ||
| identifier | Yes |
get_definitive_pathC
Return minimal ordered files/nodes for an intended change.
| Name | Required | Description | Default |
|---|---|---|---|
| changeType | Yes | ||
| identifier | Yes |
get_node_contextB
Return a node and its immediate one-hop edges.
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes |
get_node_historyC
Return compacted change history for a node or path.
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes |
get_project_overviewB
Return root node, detected tech stack, entry points, and graph counts.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
init_or_refresh_graphC
Build or refresh the project graph.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
query_best_practicesC
Return bundled best-practice nodes for a domain.
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
record_changeC
Record an actual file mutation immediately after it happens.
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| scopeId | Yes | ||
| summary | Yes | ||
| filePath | Yes | ||
| reasoning | Yes |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
10 tool updates
v0.1.0- First observed
check_scope - First observed
declare_task_scope - First observed
get_blast_radius - First observed
get_definitive_path - First observed
get_node_context - First observed
get_node_history - First observed
get_project_overview - First observed
init_or_refresh_graph - First observed
query_best_practices - First observed
record_change
TDQS
Scored across 10 tools
Each tool targets a distinct operation: scope management, graph queries, best practices, and change recording. No overlapping purposes.
All tool names follow a consistent verb_noun pattern with underscores, using clear verbs like check, declare, get, init, query, record.
10 tools is appropriate for a graph context server, covering initialization, exploration, scope, and recording without being excessive.
The set covers key operations for graph management and change analysis, though missing a direct tool for deleting or updating nodes (but not essential for the stated purpose).
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
An MCP server that gives your AI access to the source code and docs of all public github repos
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents structured code understanding and precise code intelligence via local indexing of AST, call graphs, and semantic search.129 npm4Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides AI coding agents with AST-accurate, context-budget-aware codebase querying, safety gates, and team policy integration via structured tools and a local plugin layer.112 npm4MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that indexes codebases into a local graph and provides on-demand context retrieval for AI coding agents, reducing token usage by tracking session history and delivering only relevant code subgraphs.4 npmMIT
- FlicenseNot gradedqualityBmaintenanceA local-first MCP server that gives AI coding agents durable project memory, dependency graphs, and impact analysis to answer team knowledge and cross-file change questions before editing.31 npm1-