project-context-map-mcp
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., "@project-context-map-mcpRead the project context and find files related to user registration"
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.
Project Context Map MCP
Give your coding agent a map before it starts wandering
Turn a repository into structured project memory for MCP clients like Claude Code, so they can query context, inspect only relevant files, and understand topology before touching code.
Why This Exists
AI coding tools often begin the same way in a medium or large repo:
they read too many files
they spend tokens on unrelated areas
they rebuild context from scratch every time
they miss the real dependency chain behind a feature or bug
project-context-map-mcp fixes that by generating a lightweight project memory and exposing it through MCP tools.
Instead of:
scan everything -> guess -> open random files
you get:
index first -> query topology -> read sparse files -> edit with context
Related MCP server: RepoMap
What This Project Does
This package gives you:
an MCP server for project-aware queries
a CLI to generate and refresh repository memory
a readable
.project.mdwith topology highlights and change loga machine-readable
.project-map.jsona human-readable
.project-map.mdimport/dependency relationships between files
sparse file access limited to indexed paths
MCP-assisted writes with automatic logging
Claude Code setup helpers and skill generation
At A Glance
Part | Purpose |
| Main readable project memory for humans and agents |
| Structured index used by tools |
| Lightweight markdown summary |
| Returns |
| Finds relevant files from natural-language queries |
| Reads only indexed files |
| Writes changes and appends to |
Installation
Option 1: Global install
Best if you want to use it across many repositories.
npm install -g project-context-map-mcpOption 2: Local install
Best if you want it only inside one project.
npm install project-context-map-mcpRequirements
Node.js
20or neweran MCP-compatible client such as Claude Code
Quick Start
1. Generate the project memory
Run this from the root of the repo you want to index:
project-context-map-mcp refresh --project-root .This creates:
.project.md.project-map.json.project-map.md
2. Configure Claude Code for that repo
project-context-map-mcp configure-claude --project-root .This creates or updates:
.mcp.json.claude/skills/project-context-map/SKILL.md
3. Start the MCP server
If your client starts the server from .mcp.json, you usually do not need to run it manually.
If you want to run it yourself:
project-context-map-mcp serve --project-root .4. Use it from your MCP client
Typical flow:
read the project context
query topology with a natural-language task
read only the matched files
make changes
refresh the map
Prompt examples:
See PROMPTS.md for tested starter prompts for Claude Code, Cursor, and VS Code Copilot Chat.
For best results, use prompts that name the feature area, module, or source files you want the agent to inspect.
MCP Config
If you want to wire the server manually, add this to your MCP config:
{
"mcpServers": {
"project-context-map": {
"command": "project-context-map-mcp",
"args": ["serve", "--project-root", "."],
"env": {}
}
}
}Generate it automatically
project-context-map-mcp print-mcp-config --project-root .Write it into the repo
project-context-map-mcp configure-claude --project-root .CLI Commands
project-context-map-mcp serve --project-root .
project-context-map-mcp refresh --project-root .
project-context-map-mcp install-hooks --project-root .
project-context-map-mcp configure-claude --project-root .
project-context-map-mcp print-mcp-config --project-root .
project-context-map-mcp helpCommand | What it does |
| Starts the MCP server over stdio |
| Regenerates |
| Installs git hooks to keep the map refreshed |
| Creates repo-local Claude Code skill and |
| Prints the MCP config JSON without writing files |
| Shows command help |
MCP Tools
These are the main tools exposed by the server.
Core workflow tools
Tool | Purpose |
| Returns |
| Takes a natural-language query and returns matched file paths from the query index |
| Reads file content only for indexed paths |
| Writes file changes and appends an entry to |
Additional tools
Tool | Purpose |
| Returns summary, stack, modules, hotspots |
| Regenerates the project memory artifacts |
| Returns a focused view of one module |
| Legacy ranking-oriented file query |
| Summarizes recent git activity |
| Explains a file’s role and recent changes |
read_project_context
Returns:
.project.mdpathfull markdown content
query_topology
Returns:
matched file paths
confidence score
match reasons
per-file dependencies
per-file
usedByrelationships
read_files_sparse
Returns:
file content for indexed files
safe errors for files outside the repo or outside the known topology
write_and_log
Returns:
path written
bytes written
appended change log entry
Recommended Workflow
flowchart LR
A[Refresh project map] --> B[Read .project.md]
B --> C[Query topology]
C --> D[Read sparse files]
D --> E[Implement change]
E --> F[Write and log]
F --> G[Refresh project map]Example task flow
User asks:
Fix the login bug where session expires after refreshRecommended agent behavior:
call
read_project_contextcall
query_topologywith the taskcall
read_files_sparsewith the matched file pathsinspect only those files first
edit code
call
write_and_logif using MCP-managed writescall
refresh_project_map
Topology & Visual Graph
The project map is not only a file list. It also extracts internal relationships such as:
JavaScript and TypeScript imports
CommonJS
require(...)usagebasic Python import detection
reverse usage information with
used_by
That data is written into:
.project-map.json.project.md
.project.md includes a Mermaid graph so markdown viewers that support Mermaid can render a visual dependency map.
What It Generates
.project.md
The main working document. It includes:
project summary
key modules
query index preview
topology highlights
Mermaid dependency graph
running change log
.project-map.json
The structured source of truth. It includes fields such as:
project_summarytech_stackmodulesfilestopologyentrypointsdependenciesrecent_changeshotspots
.project-map.md
A shorter human-readable summary.
Claude Code Setup
After running:
project-context-map-mcp configure-claude --project-root .your repo will contain:
.mcp.json
.claude/skills/project-context-map/SKILL.mdThe generated skill tells Claude Code to:
consult project memory first
avoid broad repo scans
query relevant files before opening source
refresh the project map after edits
Git Hooks
If you want the map to stay fresh automatically:
project-context-map-mcp install-hooks --project-root .This installs:
post-commitpost-mergepost-push
Each hook refreshes the project memory after repository activity.
Interactive Setup Guide
Go to your repo root.
Run
project-context-map-mcp refresh --project-root .Run
project-context-map-mcp configure-claude --project-root .Open the repo in Claude Code.
Approve the MCP server from
.mcp.json.Ask the agent to use
read_project_contextandquery_topologyfirst.
Use:
project-context-map-mcp print-mcp-config --project-root .Then copy the JSON into your own MCP config file and adjust:
server name
command path
working project root
Install locally:
npm install project-context-map-mcpThen run through npx:
npx project-context-map-mcp refresh --project-root .
npx project-context-map-mcp configure-claude --project-root .You should see:
.project.md.project-map.json.project-map.md.mcp.jsonafter Claude setup
You can also run:
project-context-map-mcp help
project-context-map-mcp refresh --project-root .Example Prompts For Your MCP Client
Tested prompt templates now live in PROMPTS.md.
Quick examples:
Use the project context map first, then find the files involved in session refresh logic.Use query_topology to locate the files related to npm publishing, package configuration, and release safety checks.Use get_module_context for src and explain how the CLI and MCP server fit together.Find the files that control authentication and prefer source files over docs.
Best Fit Repositories
Node.js applications
React apps
Next.js projects
mixed frontend/backend repos
Python services
large internal tools where AI agents are used often
Local Development
npm install
npm run check
node src/cli.js refresh --project-root .
node src/cli.js serve --project-root .Current Limitations
topology detection is strongest for JS, TS, and simple Python import patterns
visual graph output is Mermaid markdown, not a full interactive web app
natural-language ranking quality depends on file names, summaries, tags, and recent changes
License
MIT
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/tamojit-123/project-context-map-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server