Memoria

Memoria

memoria•bybyronwade

An MCP server that uses git forensics to reveal hidden file dependencies and prevent AI-driven code breakage.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Analyzes git history to identify coupled files that change together even without direct imports.
  • •Reports a historical risk score, stale dependencies, and code diffs showing why files are related.
  • •Exposes analyze_file and ask_history tools to MCP clients.
  • •Runs entirely locally against the machine's .git folder with no cloud upload or API keys.

BEST FOR

  • •Refactoring or editing a file where hidden dependencies might cause regressions.
  • •Understanding why existing code was written before deleting or changing it.

ABOUT MEMORIA

Memoria is cataloged as an MCP server attributed to byronwade. An MCP server that uses git forensics to reveal hidden file dependencies and prevent AI-driven code breakage. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Memoria are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does Memoria send my code to the cloud?

No, it runs entirely on your machine, requires no API keys, works offline, and analyzes your local .git folder directly.

What MCP tools does Memoria provide?

It provides analyze_file and ask_history tools.

Can Memoria check before every edit automatically?

Yes, an auto-pilot mode installs rule files that instruct the AI to always call analyze_file before editing code.

上游原版 README

在 GitHub 查看同一版本原文

README.md · f6c5244abe66 · 采集于 2026-11-13 12:12:17 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Memoria Logo

Memoria

The Memory Your AI Lacks.

An MCP server that prevents your AI from breaking code by revealing hidden file dependencies through git forensics.

npm version License: MIT TypeScript MCP Twitter


⚡ Quick Install

One-Click Install (Smithery)

Smithery - Install Memoria

Click the badge above to install Memoria with one click via Smithery.

Quick Copy-Paste Config

Add this to your MCP config file (works with Claude, Cursor, Windsurf, Cline):

{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}

Terminal One-Liners

ToolCommand
Claude Codeclaude mcp add memoria -- npx -y @byronwade/memoria
Claude Desktopnpx @anthropic/claude-code mcp add memoria -- npx -y @byronwade/memoria
Cursormkdir -p .cursor && echo '{"mcpServers":{"memoria":{"command":"npx","args":["-y","@byronwade/memoria"]}}}' > .cursor/mcp.json
npm globalnpm install -g @byronwade/memoria
🪟 Windows PowerShell Install
# Claude Desktop
$config = "$env:APPDATA\Claude\claude_desktop_config.json"
$json = if(Test-Path $config){Get-Content $config | ConvertFrom-Json}else{@{}}
$json.mcpServers = @{memoria=@{command="npx";args=@("-y","@byronwade/memoria")}}
$json | ConvertTo-Json -Depth 10 | Set-Content $config
🍎 macOS Manual Install
# Claude Desktop (requires jq: brew install jq)
echo '{"mcpServers":{"memoria":{"command":"npx","args":["-y","@byronwade/memoria"]}}}' | \
  jq -s '.[0] * .[1]' ~/Library/Application\ Support/Claude/claude_desktop_config.json - > tmp.json && \
  mv tmp.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

Then restart your AI tool. That's it!


Why Memoria?

You ask your AI to refactor a file. It does a perfect job. You run your app. It crashes.

Why? Some other file depended on the old implementation - but there's no import between them, so the AI didn't know.

Memoria fixes this. It analyzes git history to find files that change together, even without direct imports.

Without Memoria:                        With Memoria:
─────────────────                       ─────────────
You: "Update route.ts"                  You: "Update route.ts"
AI: "Done!" ✅                           Memoria: "⚠️ 85% coupled with billing.tsx"
Result: 💥 CRASH                         AI: "I'll update both files"
                                        Result: ✅ Works

Private & Local

Memoria runs 100% on your machine.

  • No code is uploaded to the cloud
  • No API keys required
  • Works offline
  • Analyzes your local .git folder directly

Your code never leaves your computer.


Installation

Choose your AI tool:

ToolOne-LinerConfig File
Claudenpx @anthropic/claude-code mcp add memoria -- npx -y @byronwade/memoriaSee below
Claude Codeclaude mcp add memoria -- npx -y @byronwade/memoriaAutomatic
Cursormkdir -p .cursor && echo '{"mcpServers":{"memoria":{"command":"npx","args":["-y","@byronwade/memoria"]}}}' > .cursor/mcp.json.cursor/mcp.json
WindsurfManual config~/.codeium/windsurf/mcp_config.json
VS CodeManual config~/.continue/config.json
ClineSettings UICline MCP Settings

📦 Claude Desktop

Config location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Option 1: Claude Code CLI (Recommended)

npx @anthropic/claude-code mcp add memoria -- npx -y @byronwade/memoria

Option 2: Manual config

{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}
📦 Claude Code (CLI)
claude mcp add memoria -- npx -y @byronwade/memoria

Done! Claude Code handles everything automatically.

📦 Cursor

One-liner (project-level):

mkdir -p .cursor && echo '{"mcpServers":{"memoria":{"command":"npx","args":["-y","@byronwade/memoria"]}}}' > .cursor/mcp.json

Config locations:

  • Project: .cursor/mcp.json (in project root)
  • Global: ~/.cursor/mcp.json
{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}
📦 Windsurf

Config: ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}
📦 Continue (VS Code)

Config: ~/.continue/config.json

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@byronwade/memoria"]
        }
      }
    ]
  }
}
📦 Cline (VS Code)

Open Cline settings → MCP Servers → Add new server:

{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}
📦 Other MCP Clients

Any MCP-compatible client works. Use this universal config:

{
  "mcpServers": {
    "memoria": {
      "command": "npx",
      "args": ["-y", "@byronwade/memoria"]
    }
  }
}

⚠️ After configuring, restart your AI tool.

Verify Installation

After restarting, ask your AI:

"What MCP tools do you have available?"

You should see analyze_file and ask_history in the list.

Or test directly:

"Use the analyze_file tool on any file in this project"

Usage

Ask your AI to analyze a file before making changes:

"Analyze src/api/stripe/route.ts before I refactor it"

Memoria returns:

  • Coupled files - Files that frequently change together
  • Risk score - How bug-prone this code is historically
  • Stale dependencies - Coupled files that may need updating
  • Evidence - Actual code diffs showing why files are related

CLI Commands

Memoria includes a full CLI for manual analysis - the same capabilities your AI uses:

# Full forensic analysis (same as AI's analyze_file)
memoria analyze src/index.ts

# Quick risk assessment
memoria risk src/api/route.ts

# Show coupled files
memoria coupled src/auth.ts

# Find files that import the target
memoria importers src/types.ts

# Search git history (same as AI's ask_history)
memoria history "setTimeout" src/utils.ts
memoria history "fix" --type=message

Output Options

# JSON output for scripting/CI
memoria analyze src/index.ts --json

# Pipe to other tools
memoria risk src/api/route.ts --json | jq '.riskScore'

Example Output

$ memoria analyze src/index.ts

Forensics for `index.ts`

RISK: 45/100 (MEDIUM)
Risk factors: High volatility (38%) • Coupled (5 files) • 3 dependents

VOLATILITY
  Panic score: 38% | Commits: 24
  Top author: Dave (72%)

COUPLED FILES
  85% billing/page.tsx [schema]
      References: billing_records table. Schema changes may break queries.
  90% index.test.ts [test]
      Test file matches naming pattern. Update when changing exports.
  75% config.ts [env]
      Shares env vars: API_KEY, DATABASE_URL
  65% hooks/useData.ts [api]
      Calls endpoint: GET /api/data

STATIC DEPENDENTS
  - [ ] Check `cli.ts`
  - [ ] Check `server.ts`
  - [ ] Check `utils.ts`

Analysis completed in 142ms

Configuration (Optional)

Create a .memoria.json in your project root to customize thresholds:

{
  "thresholds": {
    "couplingPercent": 20,
    "driftDays": 14,
    "analysisWindow": 100
  },
  "ignore": [
    "**/*.lock",
    "dist/",
    "legacy/**"
  ],
  "panicKeywords": {
    "postmortem": 3,
    "incident": 3,
    "p0": 3
  },
  "riskWeights": {
    "volatility": 0.35,
    "coupling": 0.30,
    "drift": 0.20,
    "importers": 0.15
  }
}
OptionDefaultDescription
thresholds.couplingPercent15Minimum coupling % to report
thresholds.driftDays7Days before a file is "stale"
thresholds.analysisWindow50Number of commits to analyze
ignore[]Additional glob patterns to ignore
panicKeywords{}Custom keywords with severity weights
riskWeights{}Override risk calculation weights

How It Works

Volatility Engine

Scans commits for panic keywords (fix, bug, revert, urgent, hotfix) with time-decay - recent bugs matter more than old ones. Also tracks Bus Factor (who owns the code).

Entanglement Engine

Finds files that change together >15% of the time. Reveals implicit dependencies that imports can't show.

Sentinel Engine

Detects when coupled files are >7 days out of sync. Flags stale dependencies before they cause bugs.

Static Import Engine

Uses git grep to find files that import the target - even for brand new files with no git history.

History Search (The Archaeologist)

Search git history to understand why code was written. Solves the "Chesterton's Fence" problem before you delete that weird-looking code.

Documentation Coupling

Finds markdown files that reference your exported functions/types. Catches README updates needed when output format changes.

Type Coupling

Uses git pickaxe (git log -S) to find files sharing type definitions - even without direct imports.

Content Coupling

Finds files sharing string literals (error messages, constants) that should stay in sync.

Test File Coupling

Auto-discovers test files matching naming conventions (*.test.*, *.spec.*, *_test.*, etc.) and mock/fixture files - no hardcoded extensions.

Environment Variable Coupling

Finds files sharing ALL_CAPS_UNDERSCORE environment variables (API_KEY, DATABASE_URL, etc.) - works across any language.

Schema/Model Coupling

Detects database schema definitions (SQL, Prisma, TypeORM, Mongoose) and finds files that query those tables/models.

API Endpoint Coupling

Finds client code that calls API endpoints defined in route files. Catches response shape changes that break consumers.

Re-Export Chain Coupling

Detects barrel files (index.ts) that re-export your module and finds transitive importers through those barrels.


Example Output

# Forensics: `route.ts`

**RISK: 65/100** — HIGH
45% volatility · 3 coupled · 8 dependents · 1 stale

> Proceed carefully. Check all coupled files and update stale dependencies.

---

## Coupled Files

**`billing/page.tsx`** — 85% (schema)
> These files share type definitions. If you modify types in one, update the other to match.
  + interface SubscriptionUpdated
  - oldStatus: string

**`route.test.ts`** — 90% [test]
> Test file for this module. Update when changing exports.

**`services/stripe.ts`** — 75% [env]
> Shares env vars: STRIPE_KEY, STRIPE_SECRET

**`README.md`** — 70% [docs]
> Documentation references: generateReport, SubscriptionStatus

**`types/billing.ts`** — 65% [type]
> Shared types: SubscriptionUpdated, PaymentStatus

**`features/billing/index.ts`** — 60% [transitive]
> Re-exports this file. Changes propagate through this barrel.

---

## Static Dependents

These files import `route.ts`. API changes require updating them.

- [ ] `src/components/SubscriptionCard.tsx`
- [ ] `src/hooks/useSubscription.ts`

---

## Pre-flight Checklist

- [ ] Modify `route.ts`
- [ ] Update `billing/page.tsx` (schema)
- [ ] Update `tests/stripe.test.ts` — stale 12d

---

## File History

**Volatile** — 45% panic score
**Expert:** Dave (90% of commits)

Auto-Pilot Mode

Want your AI to check Memoria automatically before every edit? Install the rule files:

# Install globally first
npm install -g @byronwade/memoria

# Then in your project directory:
memoria init --all

This installs rule files that tell your AI to always call analyze_file before editing code.

What Gets Installed

FlagFileTool
--cursor.cursor/rules/memoria.mdcCursor
--claude.claude/CLAUDE.mdClaude Code
--windsurf.windsurfrulesWindsurf
--cline.clinerulesCline/Continue
--allAll of the aboveAll tools
--forceUpdate existing rulesOverwrites Memoria section

Smart Merge Behavior

memoria init is safe to run multiple times - it won't overwrite your existing rules:

ScenarioWhat Happens
File doesn't existCreates new file with Memoria rules
File exists, no MemoriaAppends Memoria rules (your content preserved)
File exists, has MemoriaSkips (use --force to update)
# First run - creates or appends
memoria init --cursor
#   ✓ Created .cursor/rules/memoria.mdc

# Second run - skips (already installed)
memoria init --cursor
#   ⊘ Skipped .cursor/rules/memoria.mdc (already has Memoria rules)
#   Use --force to update existing Memoria rules.

# Force update to latest version
memoria init --cursor --force
#   ✓ Updated .cursor/rules/memoria.mdc (--force)

Auto-Detection

Running memoria init without flags will auto-detect which tools you're using:

memoria init
# Detected: Cursor, Claude Code
# Installing Memoria rules...
#   ✓ Created .cursor/rules/memoria.mdc
#   ✓ Appended to .claude/CLAUDE.md (preserved existing content)
# ✓ Installed/updated 2 rule file(s)

Now Memoria acts as a mandatory safety guard for every edit.


Performance

Memoria is optimized for speed and minimal token usage:

MetricValue
Full analysis time<100ms
Tokens per analysis~600 tokens
Cache speedup2000x+ on repeat calls

Engine Breakdown

EngineTimePurpose
Coupling~45msFind files that change together
Volatility~10msCalculate bug-prone score
Drift<1msDetect stale dependencies
Importers~8msFind static dependents
History Search~7msSearch git commits

Run benchmarks yourself:

npm run build
npx tsx benchmarks/run-benchmarks.ts

Requirements

  • Node.js 18+
  • Git repository with commit history
  • MCP-compatible AI tool

Monorepo Layout (Turbo)

  • apps/mcp-server — MCP server & npm package (publishes @byronwade/memoria)
  • apps/api — API backend stub (Node HTTP placeholder)
  • apps/web — Web frontend stub
  • packages — Shared libraries (future)

Development

npm install
npm run build                     # turbo build across workspaces
npm test                          # turbo test (runs vitest in mcp-server)

# Focus on a single app/package
npx turbo run build --filter=@byronwade/memoria
npx turbo run dev --filter=@byronwade/memoria

Troubleshooting

❌ "Tool not found" or "analyze_file not available"
  1. Restart your AI tool - MCP servers only load on startup
  2. Check config syntax - JSON must be valid (no trailing commas)
  3. Verify Node.js 18+ - Run node --version to check
  4. Check file path - Config file must be in the exact location for your tool
❌ "Not a git repository"

Memoria requires a git repository with history. Make sure:

  1. You're in a git repo (git status should work)
  2. The repo has at least a few commits
  3. You're passing an absolute path to analyze_file
❌ npx is slow or times out

Install globally for faster startup:

npm install -g @byronwade/memoria

Then update your config to use memoria directly:

{
  "mcpServers": {
    "memoria": {
      "command": "memoria"
    }
  }
}
❌ Windows path issues

Use forward slashes or escaped backslashes in paths:

"args": ["-y", "@byronwade/memoria"]

If issues persist, install globally and use the command directly.

Still stuck? Open an issue with your config and error message.


License

MIT


When Memoria saves you from a regression, let us know.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Memoria from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/memoria)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools