Skip to main content
Glama

记忆库 MCP

Memory Bank 是一个 MCP 服务器,可帮助团队创建、管理和访问结构化的项目文档。它生成并维护一组相互关联的 Markdown 文档,这些文档涵盖项目知识的各个方面,从总体目标到技术细节,再到日常进度。

特征

  • AI 生成的文档:利用 Gemini API 自动生成全面的项目文档

  • 结构化知识系统:以分层结构维护六种核心文档类型

  • MCP 集成:实现模型上下文协议,实现与 AI 助手的无缝集成

  • 可定制的位置:指定您想要创建记忆库目录的位置

  • 文档模板:项目简介、产品背景、系统模式等的预定义模板。

  • 人工智能辅助更新:手动更新文档或在人工智能的帮助下重新生成文档

  • 高级查询:使用上下文感知相关性排名搜索所有文档

Related MCP server: Gigaspec

安装

# Clone the repository
git clone https://github.com/tuncer-byte/memory-bank-mcp.git
cd memory-bank-mcp

# Install dependencies
npm install

# Create .env file with your Gemini API key (optional)
echo "GEMINI_API_KEY=your_api_key_here" > .env

用法

开发模式

# Start in development mode
npm run dev

生产模式

# Build the project
npm run build

# Start in production mode
npm run start

MCP 配置

要将 Memory Bank 与模型上下文协议 (MCP) 集成,请将以下配置添加到mcp.json文件:

{
  "memoryBank": {
    "command": "node",
    "args": ["/path/to/memory-bank-mcp/dist/index.js"],
    "env": {
      "GEMINI_API_KEY": "your_gemini_api_key_here"
    }
  }
}

将/path/to/memory-bank-mcp/dist/index.js替换为您构建的 index.js 文件的绝对路径,并添加您的 Gemini API 密钥(如果适用)。

例子:

{
  "memoryBank": {
    "command": "node",
    "args": ["/Users/username/memory-bank-mcp/dist/index.js"],
    "env": {
      "GEMINI_API_KEY": "AIzaSyXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  }
}

MCP 工具

记忆库 MCP 通过模型上下文协议提供以下工具:

initialize_memory_bank

创建包含所有文档模板的新存储库结构。

参数:

  • goal (字符串):项目目标描述(至少 10 个字符)

  • geminiApiKey (字符串,可选):用于文档生成的 Gemini API 密钥

  • location (字符串,可选):将创建存储库文件夹的绝对路径

例子:

await callTool({
  name: "initialize_memory_bank",
  arguments: {
    goal: "Building a self-documenting AI-powered software development assistant",
    location: "/Users/username/Documents/projects/ai-assistant"
  }
});

update_document

更新存储库中的特定文档。

参数:

  • documentType (枚举):以下之一: projectbrief 、 productContext 、 systemPatterns 、 techContext 、 activeContext 、 progress

  • content (字符串,可选):文档的新内容

  • regenerate (布尔值,默认值:false):是否使用 AI 重新生成文档

例子:

await callTool({
  name: "update_document",
  arguments: {
    documentType: "projectbrief",
    content: "# Project Brief\n\n## Purpose\nTo develop an advanced and user-friendly AI..."
  }
});

query_memory_bank

使用上下文感知相关性排名搜索所有文档。

参数:

  • query (字符串):搜索查询(至少 5 个字符)

例子:

await callTool({
  name: "query_memory_bank",
  arguments: {
    query: "system architecture components"
  }
});

export_memory_bank

导出所有存储库文档。

参数:

  • format (枚举,默认值:“folder”):导出格式,可以是“json”或“folder”

  • outputPath (字符串,可选):导出的自定义输出路径

例子:

await callTool({
  name: "export_memory_bank",
  arguments: {
    format: "json",
    outputPath: "/Users/username/Documents/exports"
  }
});

文档类型

记忆库将项目知识组织成六种核心文档类型:

  1. 项目简介( projectbrief.md ):定义项目目标、范围和愿景的核心文件

  2. 产品上下文( productContext.md ):从用户角度记录产品功能

  3. 系统模式( systemPatterns.md ):建立系统架构和组件关系

  4. 技术背景( techContext.md ):指定技术堆栈和实现细节

  5. 活动上下文( activeContext.md ):跟踪当前任务、未解决的问题和开发重点

  6. 进度( progress.md ):记录已完成的工作、里程碑和项目历史

执照

麻省理工学院

Available Tools

5 tools
create_cursor_rulesD
ParametersJSON Schema
NameRequiredDescriptionDefault
locationYesAbsolute path where cursor-rules will be created
projectPurposeYesProje amacını detaylı bir şekilde açıklayan bir metin giriniz. Bu metin projenin temel hedeflerini ve kapsamını belirleyecektir.

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

export_memory_bankD
ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoExport formatfolder
outputPathNo

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

initialize_memory_bankD
ParametersJSON Schema
NameRequiredDescriptionDefault
geminiApiKeyNoGemini API key (optional)
goalYes
locationYesAbsolute path where memory-bank folder will be created

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_memory_bankD
ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_documentD
ParametersJSON Schema
NameRequiredDescriptionDefault
contentNo
documentTypeYes
regenerateNo

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv1.0.0
    • First observedcreate_cursor_rules
    • First observedexport_memory_bank
    • First observedinitialize_memory_bank
    • First observedquery_memory_bank
    • First observedupdate_document

TDQS

C2/5.0

Scored across 5 tools

Disambiguation4/5

The tools have distinct purposes based on their names: creating rules, exporting, initializing, querying, and updating documents. However, without descriptions, there is some ambiguity about the exact boundaries between 'create_cursor_rules' and 'update_document', or whether 'initialize_memory_bank' overlaps with other setup tasks. Overall, they appear mostly distinct but could benefit from clearer differentiation.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case, such as 'create_cursor_rules', 'export_memory_bank', and 'query_memory_bank'. There are no deviations in naming style or convention, making the set predictable and easy to parse for an agent.

Tool Count5/5

With 5 tools, the count is well-scoped for a memory bank server, covering core operations like initialization, querying, updating, exporting, and rule creation. Each tool seems to earn its place without being overly sparse or bloated, fitting typical expectations for such a domain.

Completeness3/5

The tools cover key aspects like initialization, querying, updating, and exporting, but there are notable gaps. For example, there is no tool for deleting documents or rules, and operations like listing or searching memory contents are missing. This could lead to agent workarounds or failures in full lifecycle management.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers