Skip to main content
Glama

🧠 CodeMemory

面向代码库的持久智能层
本地优先、注重隐私的 CLI 工具和面向 AI 代理的 Model Context Protocol (MCP) 服务器。

🌐 官方网站与文档https://codemem.vercel.app/


⚡ 核心亮点

  • 🔒 100% 本地与私密:零遥测、零外部网络调用。所有智能数据均以 SQLite WAL 模式存储在本地。

  • 🌐 交互式 Web 架构浏览器:本地可视化流程图与内存仪表板,支持时间轴拖动和实时动态更新。

  • Token 效率:通过提供精准的上下文切片和调用者图谱而非原始文件转储,最大限度减少 AI 提示词 token 消耗。

  • 🔍 多语言 AST 分析:跨 TypeScript/JavaScript、Python、Rust、Go、SQL 等语言提取函数、类、接口、结构体和导入。

  • 👀 实时监听器:以 100ms 防抖和 .gitignore 集成即时检测代码变更。

  • 🤖 原生 MCP 服务器:可随时连接 Antigravity、Claude Desktop、Cursor、Copilot 及自定义 AI 代理。

  • 📊 架构可视化器:生成实时 Mermaid 图表、Markdown 文档和 JSON 映射。


Related MCP server: Graft

🚀 快速开始

1. 安装

# Clone the repository
git clone https://github.com/EldrexDelosReyesBula/CodeMemory.git
cd CodeMemory

# Install dependencies
npm install

# Build TypeScript
npm run build

2. 基本命令

# Initialize CodeMemory in your repository
npm run dev -- init

# Scan the current codebase and index all symbols
npm run dev -- scan

# Search for any function, class, or symbol
npm run dev -- query authenticateUser

# Extract token-budgeted AI context
npm run dev -- context AuthService --budget 2000

# Start the live background file watcher
npm run dev -- watch

# Export Mermaid architecture diagram
npm run dev -- export --format mermaid

# Check repository health and statistics
npm run dev -- status

🤖 通过 MCP 连接 AI 代理

CodeMemory 提供完整的 Model Context Protocol (MCP) stdio 服务器。

可用的 MCP 工具

工具

描述

codememory_search

搜索代码符号、签名和函数

codememory_get_context

带 token 预算的上下文,包含依赖和调用者

codememory_get_dependencies

上游导入和下游依赖

codememory_get_history

最近的文件修改和 Git 提交日志

codememory_get_architecture

生成实时 Mermaid 架构图表

codememory_get_metrics

整体代码库统计和语言分布

Antigravity 与 Claude Desktop 配置

将以下内容添加到您的 MCP 配置(mcp_config.jsonclaude_desktop_config.json)中:

{
  "mcpServers": {
    "codememory": {
      "command": "node",
      "args": ["c:/Users/Eldrex/Downloads/classhost/Needs/CodeMemory/dist/cli.js", "mcp"],
      "env": {}
    }
  }
}

🏗️ 架构

CodeMemory/
├── src/
│   ├── types/          # Domain data types & contracts
│   ├── db/             # SQLite engine with WAL mode & indexes
│   ├── parser/         # Multi-language AST symbol & dependency extractor
│   ├── watcher/        # Real-time debounced file watcher with .gitignore
│   ├── git/            # Git commit and diff history monitor
│   ├── generator/      # Mermaid diagram & Markdown/JSON exporters
│   ├── context/        # Token-budgeted context assembly & symbol ranker
│   ├── mcp/            # Model Context Protocol stdio server
│   └── cli.ts          # CLI commands router
└── tests/              # Complete Vitest test suite

📜 许可证

MIT License - 版权所有 (c) 2026 Eldrex Delos Reyes Bula.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Persistent codebase knowledge layer for AI agents. Pre-digests codebases into structured knowledge (symbols, dependency graphs, co-change patterns, architectural decisions) and serves via MCP. 28 languages, 14 tools, ~85% token reduction.
    53
    7
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Local-first codebase context engine that parses code into a ranked dependency graph and serves it to AI tools via MCP for deep structural understanding.
    5
    8
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.
    29
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Serves structured code context via MCP, enabling AI agents to understand codebases with dependency graphs and significantly reduce token usage.
    39
    MIT

View all related MCP servers

Related MCP Connectors

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

  • Give your AI agent a persistent map of your project's structure, dependencies, and bugs.

  • Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.

View all MCP Connectors

Latest Blog Posts

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/EldrexDelosReyesBula/CodeMemory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server