Skip to main content
Glama

mcp-project-memory

A Model Context Protocol (MCP) server that gives Claude a persistent memory of your project structure — so it stops re-scanning your entire codebase at the start of every session.

Why

On large projects, Claude typically spends 8,000–15,000 tokens per session just rediscovering the file structure, routes, and entry points. This server indexes your project once into a local .claude/project_map.json file, then answers structural questions instantly from that index.

Related MCP server: xtage

Tools

Tool

What it does

index_project

Scans the project once → saves .claude/project_map.json

search_context

Find files by keyword or tag without globbing

get_project_map

Quick summary: routes, stats, framework, dependencies

add_decision

Record an architectural decision for future sessions

get_decisions

Read back the decision journal

Supported frameworks

Auto-detects Next.js (App Router), Nuxt, SvelteKit, Remix, React, Vue.

Classifies files as: page, layout, route-api, action, component, type, constant, lib, migration, config.


Installation

1. Clone and build

git clone https://github.com/YOUR_USERNAME/mcp-project-memory.git
cd mcp-project-memory
npm install
npm run build

2. Register the server

Claude Code (CLI):

claude mcp add project-memory node /absolute/path/to/mcp-project-memory/dist/index.js

Claude Desktop — edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "project-memory": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-project-memory/dist/index.js"]
    }
  }
}

Restart Claude Desktop after editing.


Usage

Index your project (once per session or after major refactors)

index_project { "projectPath": "/path/to/your/project" }

Output:

✅ my-app indexed (Next.js 14.x)
📁 191 files | 🗺 45 routes | ⚡ 13 server actions

Pages (36):
  /dashboard     app/(dashboard)/page.tsx
  /settings      app/(dashboard)/settings/page.tsx
  ...

API Routes (6):
  [GET]     /api/users       app/api/users/route.ts
  [POST]    /api/auth/login  app/api/auth/login/route.ts

Find files without scanning

search_context {
  "projectPath": "/path/to/project",
  "query": "signArret",
  "tag": "action"
}

Get a session overview

get_project_map {
  "projectPath": "/path/to/project",
  "section": "routes"   // "summary" | "routes" | "dependencies" | "actions"
}

Record an architectural decision

add_decision {
  "projectPath": "/path/to/project",
  "topic": "PDF generation library",
  "decision": "Use @react-pdf/renderer instead of Puppeteer",
  "rationale": "Puppeteer exceeds Vercel's 50MB function limit. react-pdf renders natively server-side with no headless browser needed.",
  "files": ["lib/pdf/arret.tsx", "app/api/arret/[id]/pdf/route.tsx"],
  "tags": ["pdf", "performance", "vercel"]
}

What gets indexed

  • All .ts, .tsx, .js, .jsx, .sql files under 100KB

  • Skips: node_modules, .git, .next, dist, build, .vercel, coverage

  • Extracts exported function/component names from TypeScript files

  • Maps Next.js App Router file paths to URL routes (strips route groups)

  • Detects HTTP methods from API route files

Stored files

your-project/
└── .claude/
    ├── project_map.json   ← file index + route map
    └── decisions.json     ← architectural decision log

These files are local to each project. Add .claude/ to your .gitignore if you don't want to commit them (or commit decisions.json to share architectural context with your team).


Update after changes

cd mcp-project-memory
npm run rebuild

Then re-run index_project in your Claude session.

License

MIT

Available Tools

5 tools
add_decisionB

Enregistre une décision architecturale dans .claude/decisions.json pour mémoire future.

Inputs: topic (required), decision (required), rationale (required), projectPath (required), +2 more.

get_decisionsC

Récupère le journal des décisions architecturales, avec filtres optionnels.

Inputs: projectPath (required), tag, topic.

get_project_mapC

Retourne le résumé de l'index : routes, stats, framework. Utile au démarrage d'une session.

Inputs: projectPath (required), section.

index_projectA

Scanne un projet et indexe sa structure dans .claude/project_map.json. À lancer une fois en début de session ou après des refactors importants.

Inputs: projectPath (required).

search_contextB

Recherche dans l'index du projet pour trouver des fichiers pertinents par mot-clé ou tag, sans scanner tout le répertoire.

Inputs: query (required), projectPath (required), tag.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation4/5

    The decision tools (get_decisions vs add_decision) are clearly distinct read/write pairs, and index_project is clearly a write/scan operation. The two read tools over the index (get_project_map for a summary, search_context for keyword/tag lookup) are close in purpose and could occasionally be confused at session start, though the descriptions differentiate them adequately.

    Naming Consistency5/5

    All five tools follow a consistent verb_noun snake_case pattern (get_decisions, add_decision, index_project, get_project_map, search_context). The convention is predictable and readable throughout.

    Tool Count5/5

    Five tools is well-scoped for a project-memory/indexing server: two for the decision journal, three for indexing and querying the project map. Each tool earns its place with no filler.

    Completeness4/5

    The decision journal supports append and read, which fits an append-only architectural log, but there is no update/delete or invalidation path for superseded decisions. The index side covers scan, summary, and search well; only a targeted re-index or stale-entry cleanup is missing, which agents can work around by re-running index_project.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides semantic code intelligence to help users search, navigate, and analyze entire codebases using plain English. It enables Claude to perform architectural overviews, bug detection, and refactor suggestions through local semantic search and keyword indexing.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides Claude with persistent, semantic knowledge of a codebase across sessions by maintaining a local knowledge base of structural maps, compressed file summaries, and insights.
      7 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides persistent codebase memory for Claude Code, enabling semantic understanding of the project structure and action history across sessions to reduce redundant file reads.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude Code to query a local, import-aware graph of a repository, so questions like who calls a function, what breaks if it changes, and what imports a file are answered in one lookup instead of a search-and-read loop. It also persists durable session notes and offers full-text search over past session transcripts, all through MCP tools.
      MIT