ProjectMind MCP
Provides tools to ingest and analyze git history, summarize recent changes, and automatically update project memory from commits.
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., "@ProjectMind MCPsearch for authentication middleware in the codebase"
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.
ProjectMind MCP
Give your AI coding assistant a brain. Persistent memory, semantic code search, a symbol-level call graph, and project intelligence โ all running locally with no API keys required.
ProjectMind is an open-source MCP (Model Context Protocol) server that supercharges AI assistants like Claude, Zencoder, and Cursor with long-term project memory and intelligent codebase search.
๐ค This project was built with AI โ designed, coded, debugged, and documented using AI-assisted development from day one.
Why ProjectMind?
Every time you start a new AI session, your assistant forgets everything about your project. ProjectMind solves this:
No more re-explaining your architecture every session โ memory persists in
.ai/memory.mdSemantic code search that understands what code does, not just what it's named
Symbol graph โ ask "who calls this function?" and get exact file:line answers
Dependency graph analysis to understand how modules connect
Works 100% locally โ your code never leaves your machine
New in v0.9.0: โ๏ธ AI-authored annotations (semantic search without embeddings), ๐ฆ lightweight core with the vector stack as an optional [vector] extra, ๐ one-line install from PyPI.
๐ See CHANGELOG.md for the full release history.
Related MCP server: nodespace-mcp
Features
๐ง Persistent Project Memory
Save architectural decisions, tech stack notes, and context that survives across sessions. The AI reads this at the start of every conversation.
Hierarchical memory access avoids dumping everything at once:
read_memory_index()โ section headings only (cheap)read_memory_section(name)โ expand only the section you needsearch_memory(query)โ relevance-ranked retrieval of the memory blocks most relevant to a task (keyword-scored), not just the head of the file
All memory I/O is UTF-8 โ notes in any language survive round-trips on any OS.
๐ช Tiered Hierarchical Search
Queries escalate through tiers only when the previous one is insufficient โ large repositories never trigger a cold load just to answer a path lookup.
Tier | Engine | When used | Typical latency |
L0 Manifest |
| always | < 50 ms |
L0 Annotations |
| always | < 5 ms |
L1 Symbol |
| when a prebuilt graph exists | < 10 ms |
L1 BM25 |
| when L0 is weak | ~ 100 ms |
L2 Vector | ChromaDB + sentence-transformers (optional | only on | first call ~ 30 s, then cached |
Use the unified query(text, intent, n_results) tool with one of:
overviewโ L0 only (paths + top-level symbols)lookupโ L0 + symbols + BM25 (keyword/lexical)semanticโ escalates to embeddings if the lexical signal is weakdeepโ all tiers with relaxed thresholds
Hits from every tier are fused with scale-invariant Reciprocal Rank Fusion (normalized to 0..1), so no single tier can dominate the ranking by raw score magnitude โ results corroborated across tiers float to the top.
โ๏ธ AI-Authored Annotations โ semantic search without embeddings
The killer pattern: your AI assistant already understands your code โ so let it write the search index. As the assistant works on files, it saves 1-2 sentence summaries + keywords via save_annotation(). Annotations are indexed into BM25 and a dedicated query tier, so natural-language queries land on the right files with plain keyword search:
save_annotation("src/auth/session.py",
"Session lifecycle: creates, refreshes and revokes OAuth sessions",
keywords="login, oauth, token refresh")
query("where are sessions revoked?") โ src/auth/session.py (L0_annot tier)list_unannotated_files()โ coverage report: files missing or with stale annotations (file changed since)get_annotations(path)โ review what the index "knows" about a fileStored in human-readable
.ai/annotations.json, UTF-8, atomic writesThis is why the vector stack is now optional: a smart model + cheap precise tools beats a small embedding model guessing
๐งฌ Symbol Graph (AST-level call/inherit/implement graph)
tree-sitter parses every source file into a graph of symbols, not files. Symbols are keyed by qualified id (path::Class.method), so same-named symbols across files stay distinct.
find_symbol("UserService")โ where is it defined? (no embedding model needed, answers in milliseconds)get_symbol_relations("save", relation="callers")โ who calls it, with file:lineRelations:
callers,callees,implementors,subclasses,bases,usages,infoInheritance extraction works across Python, JS, TS, Java, Ruby; builtin-call noise (
print,len,pushโฆ) is filtered outThe graph is rebuilt automatically by the background indexer and persisted to
.ai/symbol_graph.json
๐ Semantic Code Search
Search your codebase by meaning, not just text. Powered by a local sentence-transformers model โ no OpenAI key needed.
"find authentication middleware" โ finds auth code even if it's named differently๐ณ AST-Aware Chunking
Unlike naive text splitters that cut code in the middle of a function, ProjectMind uses tree-sitter to parse source files into exact syntax units:
Functions and methods are indexed as individual, self-contained chunks
Class methods get a
# Class: ClassNamecontext prefix for better search relevanceRich metadata per chunk:
symbol_type,symbol_name,class_name,line_start,line_endSupports: Python, JavaScript, TypeScript, TSX, Java, Go, Rust, Ruby
Graceful fallback to text splitting for unsupported file types
๐ธ Dependency Graph Intelligence
Traverse import relationships up to 5 levels deep
Find related files via shared dependency clustering
Discover the shortest path between any two modules
Identify entry points and orphaned modules
Monorepo-aware JS/TS resolution โ follows
tsconfig/jsconfigpath aliases (@/...) and workspace/package imports; multi-line, dynamicimport()and side-effect imports are all detectedPython
src/-layout & relative-import resolution โ absolute imports resolve throughsrc//lib/roots, dotted (utils.helpers) and relative (./..) imports resolve to the right filesCached import graph (120 s TTL) with a precomputed reverse graph โ impact/cluster analysis is O(E), not O(NยฒยทE)
โก Instant Project Exploration (no indexing needed)
get_project_overview()โ manifest-first; tech stack, git info, file stats in < 1 secondexplore_directory(path)โ browse project tree level by levelget_file_summary(path)โ imports, classes, functions, git history
โก Hybrid Search (BM25 + Vector)
Two search engines combined via Reciprocal Rank Fusion (RRF):
BM25 catches exact keyword matches โ finds
getUserByIdwhen you type exactly thatVector search catches semantic matches โ finds auth code even if named differently
RRF merges both ranked lists for best-of-both-worlds results
Automatic fallback to pure vector search when the BM25 index is not ready
The BM25 index is persisted as JSON (
.ai/bm25_index.json) โ never pickle, so indexing a third-party repo can't execute untrusted input
๐ True Incremental Indexing
index_changed_files re-indexes only what changed โ and cleans up after itself:
A changed file's old chunks are deleted before the new ones land (renamed/removed symbols don't haunt search results)
Chunks of deleted files are removed from ChromaDB, BM25 and the metadata
BM25 is patched in memory per file and rebuilt once โ no full-database fetch per small change
Failed writes are never silent: metadata isn't saved, so affected files retry on the next run
๐ Background Indexing
index_codebase() returns instantly and indexes in a daemon thread; session_init auto-starts it when the index is missing. Poll get_index_progress() for a live progress bar with ETA. Switching projects mid-run cancels the old job safely โ no cross-project contamination.
๐ฉบ Self-Healing Maintenance Daemon
A background thread keeps the index lean without user intervention. State persists in .ai/maintenance_state.json.
Task | Trigger | Action |
| every 5 min | rebuild L0 manifest if files changed |
| hourly | delete embeddings for files removed from disk |
| daily |
|
| every 6 h | truncate |
| every 5 min | release |
| every minute | drop file/query caches when RSS > 500 MB |
Inspect with maintenance_status(); force a sync run with maintenance_run(); aggressively clean the index with prune_index(force=True).
๐ Code Quality Metrics
Cyclomatic complexity, pylint scores, test coverage tracking โ all queryable via MCP tools.
Both analyze_code_complexity and analyze_code_quality accept mode='quick' (default, fast) or mode='deep' (wider scan). pylint runs in a subprocess with a wall-clock budget, so these tools return partial results instead of timing out.
โก Lazy session_init (no 30 s timeouts)
session_init never loads the embedding model; it returns the project root + manifest + memory index in well under a second even on multi-GB repositories. The vector store is loaded only when an intent='semantic' or 'deep' query actually needs it.
Quick Start
One-liner (recommended)
# Claude Code
claude mcp add --scope user Memory -- uvx projectmind-mcpThe default install is lightweight (a few MB โ BM25 keyword search, AI annotations, symbol graph, memory). To add the optional embedding/vector tier (~500 MB, fully local):
claude mcp add --scope user Memory -- uvx --from "projectmind-mcp[vector]" projectmind-mcpOther MCP clients (Claude Desktop / Zencoder / Cursor) โ mcp.json:
{
"mcpServers": {
"Memory": {
"command": "uvx",
"args": ["projectmind-mcp"]
}
}
}From source (development)
git clone https://github.com/Nik0lay1/project-mind-mcp.git
cd project-mind-mcp
python -m venv .venv
# Windows # macOS/Linux
.venv\Scripts\pip install -e ".[vector,dev]" # .venv/bin/pip install -e ".[vector,dev]"Then point your MCP client at .venv/Scripts/python.exe mcp_server.py (or use the projectmind-mcp console script from the venv).
3. Bootstrap a session
Ask the AI (once per session):
Memory__session_init(project_path="<absolute path to your project>")If the index doesn't exist yet, background indexing starts automatically โ check Memory__get_index_progress(). For manual full re-indexing of large projects:
# Windows
.venv\Scripts\python.exe run_index.py
# macOS/Linux
.venv/bin/python run_index.pyAvailable Tools (45+)
Category | Tools |
Session |
|
Memory |
|
Search |
|
Context brief |
|
Annotations |
|
Symbols |
|
Exploration |
|
Dependencies |
|
Indexing |
|
Git |
|
Quality |
|
Maintenance |
|
Project |
|
Full reference: docs/api/tools-reference.md
How It Works
Your Project
โ
โผ
ProjectMind MCP Server
โ
โโโ .ai/memory.md โ persistent notes & decisions (UTF-8)
โโโ .ai/annotations.json โ AI-written file summaries (search tier)
โโโ .ai/manifest.json โ L0: paths, symbols, modules (โค200 KB)
โโโ .ai/symbol_graph.json โ L1: AST call/inherit/implement graph
โโโ .ai/bm25_index.json โ L1: lexical index (JSON, not pickle)
โโโ .ai/vector_store/ โ L2: ChromaDB embeddings (local)
โโโ .ai/index_metadata.json โ tracks changed files (mtime)
โโโ .ai/index_progress.json โ live background-indexing progress
โโโ .ai/maintenance_state.json โ self-healing daemon schedule
โโโ .ai/.indexignore โ per-project ignore patterns
โ
โผ
AI Assistant (Claude / Zencoder / Cursor)Embedding model: flax-sentence-embeddings/st-codesearch-distilroberta-base
Trained specifically on code (CodeSearchNet dataset)
~130 MB, runs fully locally on CPU
No API keys, no data sent anywhere
Search pipeline: manifest + symbol graph + BM25 (keyword) + ChromaDB (semantic) โ Reciprocal Rank Fusion โ top-N results
Requirements
Python 3.10 โ 3.12
~500 MB disk (model + dependencies)
Works on Windows, macOS, Linux
Configuration
All settings in config.py:
Setting | Default | Description |
|
| Embedding model |
|
| Characters per chunk |
|
| Skip files larger than this |
|
| Memory limit for indexing batch |
|
| Max files scanned when building the import graph |
|
| Wall-clock budget for analysis tools โ they return partial results instead of timing out |
Override via environment variables:
PROJECTMIND_MAX_FILE_SIZE_MB=5
PROJECTMIND_MAX_MEMORY_MB=200
PROJECTMIND_IMPORT_GRAPH_MAX_FILES=20000
PROJECTMIND_SYMBOL_GRAPH_MAX_FILES=8000
PROJECTMIND_TOOL_BUDGET_SECONDS=45
PROJECTMIND_MODEL_IDLE_UNLOAD_SECONDS=3600Custom ignore patterns: create .indexignore in the project root (fallback: .ai/.indexignore), same substring syntax as shown in the generated default.
Project Structure
mcp_server.py โ all MCP tool definitions
config.py โ configuration + path validation
manifest.py โ L0 lightweight project manifest
symbol_graph.py โ AST symbol graph (call/inherit/implement), format v3
query_router.py โ tier-aware query() router (L0 โ L1_symbol โ L1 โ L2)
maintenance.py โ self-healing background daemon
background_indexer.py โ non-blocking indexing with live progress
vector_store_manager.py โ ChromaDB wrapper + hybrid search (L2)
bm25_index.py โ BM25 keyword index + RRF fusion (L1, JSON persistence)
codebase_indexer.py โ file scanning & AST-aware chunking
ast_splitter.py โ tree-sitter parser (9 languages, thread-safe)
code_intelligence.py โ import graph, complexity analysis, cached graphs
memory_manager.py โ persistent memory read/write (UTF-8, atomic)
incremental_indexing.py โ change tracking (mtime) + atomic writes
context.py โ dependency injection (thread-safe lazy init)
run_index.py โ helper script for manual re-indexingContributing
Issues and PRs are welcome. This is an open project โ built in the open, improved in the open.
pip install -e ".[dev]"
pytest tests/
ruff check .CI runs ruff, black, mypy and the unit suite on Python 3.10โ3.12 (see .github/workflows/ci.yml).
License
MIT
Built with AI assistance โ used throughout development for coding, debugging, refactoring, and documentation.
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.
Latest Blog Posts
- 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/Nik0lay1/project-mind-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server