agent-project-intelligence
Click on "Install 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-project-intelligenceList the direct callers of the authenticate function"
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.
π― What Problem Does This Solve? Why Agent Project Intelligence?
Large Language Models (LLMs) write impressive code, but during long-term engineering iterations and real-world codebase development, both human developers and AI assistants confront four costly dilemmas:
1. Blind Grep & Token Drain in Every New Session
When assigned a new task, traditional agents (like Claude Code, Codex, Antigravity, and Cursor) mechanically repeat: ls β grep β read full file β find symbol β find callers β guess dependencies. Ingesting dozens of full files burns tens of thousands of tokens per turn and frequently leads to hallucinations, missing deep call paths, or overlooking cross-module side effects.
Solution: Agent Project Intelligence parses your codebase using native Tree-sitter ASTs stored in SQLite WAL. The AI accesses exact symbols, signatures, callers/callees, and dependencies in sub-5msβzero LLM inference overhead, providing an instant ~500-token Bounded Context Pack.
2. The "Design Document Graveyard" & Cognitive Drift (For Humans & AI Alike)
Real-world engineering involves not only code, but also evolving Markdown specifications and architectural blueprints. Developers frequently brainstorm features with AI (e.g. ChatGPT / Claude), generating a flurry of files: proposal_v1.md, new_design.md, and refactor_final_v2.md. This triggers a dangerous double cognitive failure:
Developer Cognitive Overload & Amnesia: As Markdown files pile up, developers themselves lose track of which document represents the currently active source of truth. Particularly when branching off to implement a new feature or refactor, it is easy to forget or stray from the original core boundaries and constraints defined in early specs, only discovering irreconcilable architectural conflicts after the branch is finished;
AI Lacks Timeline Awareness & Overwrites Production: LLMs have no intrinsic sense of chronological order across files. An AI agent will easily confuse historical drafts with current requirements, and might treat an unverified brainstorming proposal as absolute fact, generating destructive code that overturns stable production systems.
Solution: A structured Knowledge Lifecycle Graph and Truth Gate.
Stable Digital Identity (Stable Node ID): Uses immutable identifiers (
D-037Design,P-052Proposal,ADR-014Decision). Iterations update the same file (version history is tracked by Git), eliminatingv1/v2/v3graveyard sprawl at the root;Strict Lifecycle State Machine: Clearly demarcates
DRAFTβREVIEWβACTIVE(current production truth) βSUPERSEDEDβARCHIVED;
ingest_documentTruth Gate: Newly ingested external documents default to non-truth! The engine compares them against active designs, immediately flagging conflicts and downgrading them into Proposals, ensuring only human-reviewed specifications enter the active truth layer.
3. Session Amnesia, Disconnected Specs & The Zero-Loss Handoff Protocol
Complex engineering features often span days, requiring dozens or hundreds of conversational turns. However, context windows are finite and expensive, and as turns accumulate, model attention drifts or prompts crash and restart, creating two critical hurdles:
Session Reset Amnesia: Whenever a new session starts or an IDE restarts, the agent is wiped clean. Discovered root causes, hard-fought gotchas, test evidence chains, and verified hypotheses vanish, forcing developers to waste time repetitively re-explaining the entire project background;
Specs and Code Are Siloed: Specifications live in Markdown; code lives in source files. Changing a requirement cannot deterministically reveal affected functions, and modifying a low-level method cannot trace back to the impacted business logic.
Solution: A Cross Graph (Doc β Symbol hard linkage), a Current State Engine, and an Automated Handoff Protocol (
/handoff):
Bi-directional Navigation: Frontmatter establishes verified links between documents and AST symbols (
D-037 IMPLEMENTED_BY CardPackService). Changing a design reveals affected code immediately; modifying code triggers instant business impact analysis (impact);Zero-Loss Handoff Protocol (
/handoff): When a session reaches its token budget, achieves a milestone, or switches windows, triggering/handoffserializes task objectives, landed code modifications, verification evidence (test/build outputs), architectural gotchas, and concrete Next Steps intotemp/HANDOFF.md. A new agent aligns with this file first, restoring 100% of the previous cognitive depth in 0 seconds with zero wasted tokens!
4. Quantified ROI: ~85%+ Token Savings & 3xβ5x Acceleration in Coding Velocity
In real-world mid-to-large codebases (10,000 to 100,000+ lines of code), deploying Project Intelligence delivers quantifiable gains in token economics and development throughput:
Token Consumption Slashed by ~80%β90%:
Traditional Mode: Agents run
find+ blindgrepand open 5 to 15 entire source files (500 to 2,000 lines each), burning 20,000 to 50,000+ tokens just to comprehend the entry point.Project Intelligence: Local Tree-sitter AST precomputations provide a compact ~500-token Bounded Context Pack containing active state, related designs, and symbol signatures, followed by surgical line-span reads (
source("file.ts:10-40")). Token consumption during project exploration is reduced by 80% to 90%, slashing API bills and preventing context exhaustion.
3xβ5x Acceleration in End-to-End Velocity:
Sub-5ms Deterministic Lookups: Replaces slow, multi-turn LLM reasoning with instant SQLite index queries for callers, dependencies, and blast radius.
Zero Cognitive Cold-Start Overhead: Paired with the automated
/handoffprotocol, developers eliminate the 10-to-20-minute cognitive friction of re-explaining context whenever a session restarts or an IDE reboots, driving a 3x to 5x boost in practical implementation speed.
Related MCP server: droste-memory
ποΈ Tri-Pillar Architecture
AI AGENTS
(Codex / Antigravity / Claude Code / Cursor / DeepSeek)
β
βΌ
ββββββββββββββββββββββββββ
β Context Router (MCP) β
ββββββββββββββ¬ββββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Knowledge Graph β β Code Graph β β Current State β
β β β β β & Handoff Log β
β Design (ACTIVE) β β AST Symbols β β Current Focus β
β Proposal/Draft β β Caller / Callee β β Stage & Blockersβ
β ADR Decisions β β Imports/Exports β β temp/HANDOFF.md β
β Truth Gate β β Git Dirty Trace β β Next Steps β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ βββββββββββββββββββ
β β
βββββββββββββ¬βββββββββββββ
βΌ
βββββββββββββββββββ
β Cross Graph β
β (Doc β Symbol) β
ββββββββββ¬βββββββββ
βΌ
.project-intelligence/intelligence.db (SQLite)π² Deterministic Code Graph:
Native multi-language Tree-sitter parsing (TypeScript, JavaScript, Python, Rust);
Extracts classes, interfaces, functions, methods, import edges (
IMPORTS), call graphs (CALLS), and inheritance;Blazing-fast SQLite WAL + FTS5 full-text search with PageRank symbol importance ranking;
Live filesystem watcher with incremental updates, Git dirty fingerprinting (no false-positive staleness), and diff deletion-matching.
π Knowledge Lifecycle Graph & Truth Gate:
Stable identification (
D-001Design,P-052Proposal,ADR-014Architectural Decision Record);Strict lifecycle state transitions:
DRAFTβREVIEWβACTIVEβSUPERSEDEDβARCHIVED;Smart Ingestion Engine: detects overlap and conflicts with active truth, routing new proposals into review automatically.
π§ Current State, Cross Graph & Handoff Engine:
Bi-directional navigation: traverse from high-level requirements directly to AST symbols (
D-037 IMPLEMENTED_BY CardPackService);Lightweight live state tracking: records current focus, active stage, blockers, and next steps;
Handoff Protocol: Serializes evidence and pending actions to
temp/HANDOFF.mdfor seamless cross-session continuity.
β‘ Progressive Context Disclosure
The foundational philosophy: never read a full file when a targeted slice is sufficient.
LEVEL 0: project_map() ββ> Inspect lightweight global module and design map
LEVEL 1: project_context(query) ββ> Fetch ~500-token Bounded Context Pack (State + Active Designs + Signatures)
LEVEL 2: symbol() / graph() ββ> Inspect exact symbol signatures, callers, callees, and dependencies
LEVEL 3: source("file.ts:10-40") ββ> Read the precise lines of implementation
LEVEL 4: read_file (fallback) ββ> Fallback to full file reading only when strictly necessaryπ οΈ MCP Tool Matrix (11 Tools)
Project Intelligence runs as a standard Stdio MCP server exposing 11 high-level tools:
Tool Name | Type | Description |
| π Read-only | Primary Entry Point. Returns compact ~500-token Bounded Context Pack for any task query |
| π Read-only | Generates a project-wide map of modules, active designs, and status |
| π Read-only | Looks up exact signature, line span, PageRank score, and related documentation |
| π Read-only | Traverses call graphs, dependency trees, and cross-graph linkages with depth control |
| π Read-only | Evaluates blast radius by symbol, file, or unified git diff hunks |
| π Read-only | Extracts exact code lines without reading full files (e.g. |
| π Read-only | Queries specific design documents, ADRs, and their formal relationships |
| βοΈ Mutation | Truth Gate. Ingests external Markdown with automatic collision detection |
| βοΈ Mutation | Records architectural decisions, automatically creating standard |
| βοΈ Mutation | Updates live project focus, stage, blockers, and next steps |
| βοΈ Mutation | Transitions design documents through lifecycle stages (e.g. promoting Proposal to ACTIVE) |
π Repository Directory Structure
agent-project-intelligence/
βββ dist/ # Compiled production binaries (CLI & Stdio MCP Server)
β βββ cli/index.js # CLI executable entry point (`pi` command)
β βββ mcp/server.js # Stdio MCP Server implementation
βββ src/ # TypeScript source code
β βββ code/ # Deterministic Code Graph Engine
β β βββ ast/ # Multi-language Tree-sitter AST visitors (TS/JS/Py/Rust)
β β βββ indexer.ts # Code graph indexer (symbols, calls, imports)
β β βββ watcher.ts # Chokidar live file watcher with dirty fingerprinting
β βββ knowledge/ # Document Lifecycle & Knowledge Graph Engine
β β βββ parser.ts # YAML Frontmatter & markdown section parser
β β βββ indexer.ts # Document indexer with parse-error process isolation
β β βββ ingest.ts # Ingest conflict detection & proposal router
β β βββ map.ts # Lightweight project map generator
β βββ cross/ # Knowledge β Code Cross-Graph Linker
β β βββ linker.ts # Bi-directional relations (IMPLEMENTS, AFFECTS, stale link purge)
β βββ state/ # Runtime State Engine
β β βββ manager.ts # Live focus, stage, blockers, and ADR automation
β βββ mcp/ # Model Context Protocol (MCP) Service Layer
β β βββ router.ts # Bounded Context Pack router (~500 Token Context Pack)
β β βββ server.ts # 11 MCP tool registrations & permission annotation guards
β βββ db/ # SQLite Storage & Search Substrate
β β βββ database.ts # SQLite WAL connection management & pragma optimization
β β βββ queries.ts # Prepared statement cache & high-performance graph queries
β β βββ schema.sql # Unified relational schema, FTS5 tables, and sync triggers
β βββ config.ts # Single-project sandboxing & path security verification
βββ templates/
β βββ AGENTS.md # Universal Agent behavior & context policy template
βββ tests/ # Comprehensive Vitest test suite (48/48 tests passing)
βββ mcp-config-example.json # Example configurations for Codex, Antigravity, Cursor, Claude
βββ agent-project-intelligence.png # Project architecture banner image
βββ README.md # English official documentation
βββ README_zh.md # Chinese official documentation
βββ LICENSE # MIT Open-Source License
βββ package.json # Package configuration and executable mappingsπ Quick Setup Across AI Agents
1. Google Antigravity (Project-Isolated Plugin)
In your target repository, create .agents/plugins/project-intelligence/:
plugin.json:{"name": "project-intelligence"}mcp_config.json:{ "mcpServers": { "project-intelligence": { "command": "node", "args": ["/path/to/agent-project-intelligence/dist/cli/index.js", "serve", "."] } } }Copy
templates/AGENTS.mdto your target project's root directory.
2. OpenAI Codex
In your target repository, create .codex/config.toml:
[mcp_servers.project-intelligence]
command = "node"
args = ["/path/to/agent-project-intelligence/dist/cli/index.js", "serve", "."]3. Claude Code
Run in your terminal:
claude mcp add project-intelligence -- node /path/to/agent-project-intelligence/dist/cli/index.js serve .Copy templates/AGENTS.md to your target repository as CLAUDE.md.
4. Cursor / Windsurf / VSCode (Cline / Roo Code)
Add to your IDE's MCP configuration:
{
"mcpServers": {
"project-intelligence": {
"command": "node",
"args": ["/path/to/agent-project-intelligence/dist/cli/index.js", "serve", "/absolute/path/to/target-project"]
}
}
}5. DeepSeek Harness / CLI Pipelines (Non-MCP Environments)
Use the built-in CLI to inject structured context directly into prompt loops:
# Get targeted context for an implementation task
pi context "Implement user authentication token refresh"
# Inspect overall project map and blockers
pi map
pi stateπ» CLI Usage (pi)
In addition to serving as an MCP backend, agent-project-intelligence comes with a standalone CLI:
npm install -g agent-project-intelligence # or build locally via `pnpm build`
pi init [dir] # Initialize .project-intelligence database in target project
pi index [dir] # Parse code and documentation into the database
pi serve [dir] # Start Stdio MCP Server
pi watch [dir] # Start live background file watcher
pi map [dir] # Pretty-print module hierarchy and active designs
pi state [dir] # View current development stage, focus, and blockers
pi ingest <file> # Ingest external Markdown with conflict detectionπ‘ Prior Art & Acknowledgements
Agent Project Intelligence was engineered from the ground up as a comprehensive cognitive infrastructure for AI coding agents. We acknowledge the pioneering ideas from the open-source community that inspired our inception:
claude-ex: Inspired the approach of deterministic Tree-sitter AST symbol indexing, caller/callee graphs, and local SQLite caching.
open-codebase-index: Inspired the bounded-context retrieval philosophy, branch-awareness, and low-token context packing.
Unlike pure code-indexing tools, Agent Project Intelligence integrates these concepts into an original Tri-Pillar Architecture: Knowledge Lifecycle Graph + Deterministic Code Graph + Current State Engine + Cross-Session Handoff Protocol.
π License
This project is licensed under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
11Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
1
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides persistent codebase memory and semantic context for AI agents via AST-aware chunking and symbol graph indexing.1-
- AlicenseNot gradedqualityBmaintenanceProvides AI agents with causal code memory by indexing repositories into a graph of symbols and edges, enabling context-aware retrieval of relevant code slices.3MIT
- FlicenseNot gradedqualityBmaintenanceProvides efficient code navigation and graph-based analysis for AI agents, enabling symbol resolution, callers, implementations, and type schemas with minimal token usage.-
- FlicenseNot gradedqualityBmaintenanceProvides long-term memory and codebase AST intelligence for AI coding agents, enabling persistent context handoff and high-efficiency symbol queries.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jokerjames/agent-project-intelligence'
If you have feedback or need assistance with the MCP directory API, please join our Discord server