Arc Memory MCP Server

Official
by Arc-Computer

Integrations

  • Provides access to Git repositories by extracting commit history, file relationships, and code modifications into a temporal knowledge graph to enable AI-assisted development with historical context.

  • Extracts data from GitHub including PRs, commits, and issues to build a comprehensive knowledge graph that enriches AI understanding of project evolution and decisions.

Arc 内存 MCP 服务器

Arc 帮助工程团队了解其代码背后的上下文和历史。这款 MCP 服务器允许 AI 助手使用自然语言查询代码库的历史记录和关系。

“为什么我们选择 MongoDB 而不是 PostgreSQL?”“身份验证系统是如何随着时间推移而演变的?”“微服务架构背后的原理是什么?”

快速启动工作流程

  1. 安装依赖项
    pip install mcp arc-memory
  2. 使用 GitHub 进行身份验证
    arc auth gh
    这将引导您完成 GitHub 身份验证。完成后,您将看到一条成功消息。
  3. 使用线性身份验证(可选)
    arc auth linear
    这将引导您使用 OAuth 2.0 向 Linear 进行身份验证。系统将打开一个浏览器窗口,供您授权 Arc Memory 访问您的 Linear 数据。此步骤是可选的,但如果您想将 Linear 问题纳入知识图谱,建议您执行此步骤。
  4. 构建你的知识图谱
    arc build
    这将分析您的存储库并构建本地知识图谱。完成后,您将看到进度指示器和已提取实体的摘要。要将线性问题纳入知识图谱:
    arc build --linear
    这需要线性认证(步骤 3)。
  5. 在 Claude Desktop、VS Code Agent 模式或 Cursor 中配置有关详细说明,请参阅下面的“集成”部分。

Arc 的工作原理

Arc 构建代码库历史记录图,连接来自不同来源的结构化数据。Arc 不像典型的 RAG 系统那样使用向量相似性,而是专注于提交、PR、问题和架构决策之间的实际关系

arc_search_story工具将自然语言问题转换为可以遵循多个连接的图形查询,帮助 AI 助手根据项目的实际历史提供答案。

知识图谱结构

Arc 通过以下方式构建丰富的知识图谱:

  • 实体:PR、提交、问题(GitHub 和 Linear)、ADR、文件等
  • 关系:修改、提及、合并、决定、实施
  • 时间背景:变化发生的时间和顺序
  • 出处:为何做出改变以及改变者
  • 跨系统连接:GitHub PR 和线性问题之间的链接

这种相互连接的结构使得我们能够追踪任何一行代码背后的完整故事——从最初的问题,到架构决策,再到实施 PR 和提交。

例如,典型的路径可能如下所示:

Linear Issue ABC-123 (Feature Request) ↓ DECIDES Architecture Decision Record (ADR-42) ↓ IMPLEMENTS GitHub Pull Request #456 ↓ CONTAINS Commit abc123 ↓ MODIFIES File: src/auth/middleware.js

当您问“为什么以这种方式实现身份验证中间件?”时,Arc 可以向后遍历此路径以提供完整的上下文。

连接不同的系统

分别使用 GitHub 和 Linear MCP 可以完成基本查询,但 Arc 将它们连接在一起:

  1. 连接数据:将 GitHub、Linear、Git 和 ADR 的信息链接到一个图表中
  2. 跨系统连接:显示线性问题和 GitHub PR 之间的关系
  3. 多步骤路径:遵循单独的 API 调用可能错过的连接链
  4. 基于时间的上下文:维护不同系统间事件发生的时间
  5. 结构化结果:返回 AI 助手可以用来解释关系的路径

示例问题

建筑推理与决策考古学

"What were the security considerations that led to our current authentication architecture?" "Why did we migrate from monolith to microservices in Q3 2022, and what were the tradeoffs?" "What performance issues drove the switch from Redis to our custom caching solution?" "How did our API design evolve after the major outage last year?"

跨系统影响分析

"Which backend services were affected by the payment processing refactoring?" "What downstream components depend on the authentication middleware we're planning to change?" "How many different teams' code would be impacted if we deprecate the legacy API?" "What parts of our infrastructure were modified to address the rate limiting issues?"

技术债务与回归预防

"What previous attempts have we made to fix the intermittent test failures in the CI pipeline?" "Which PRs have touched this fragile payment processing code in the last 6 months?" "What was the root cause analysis of our last three production incidents?" "Which architectural decisions have we revisited multiple times, suggesting design instability?"

知识转移与入职培训

"What's the complete history of our authentication system from initial design to current implementation?" "Who are the domain experts for each component of our data processing pipeline?" "What were the key design decisions made before I joined the team that explain our current architecture?" "What's the context behind this complex caching logic that no one seems to understand anymore?"

可用工具

  • arc_search_story :针对多跳问题的自然语言图形查询
  • arc_trace_history :跟踪文件中特定行的决策历史
  • arc_get_entity_details :检索有关特定实体的详细信息
  • arc_find_related_entities :查找与给定实体直接连接的实体
  • arc_blame_line :获取某一行的特定提交 SHA、作者和日期

安装

# Install dependencies pip install mcp arc-memory # Clone the repository git clone https://github.com/Arc-Computer/arc-mcp-server.git cd arc-mcp-server # Install the server pip install -e .

设置

  1. 使用 GitHub 进行身份验证(如果您有 GitHub OAuth 凭据)
    arc auth gh
  2. 构建你的知识图谱
    arc build
    这将从您的本地 Git 存储库构建一个图表,包括提交、文件、PR、问题及其关系。数据库存储在~/.arc/graph.db中。

一体化

克劳德桌面

  1. 打开您的配置文件:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 添加服务器配置:
    { "mcpServers": { "arc-memory": { "command": "python", "args": ["/absolute/path/to/src/arc_mcp_server.py"] } } }
  3. 重启Claude桌面

VS Code 代理模式

  1. 安装VS Code 代理模式扩展
  2. 在 VS Code 设置中配置 MCP 服务器:
    "anthropic.agent-mode.mcp.servers": { "arc-memory": { "command": "python", "args": ["/absolute/path/to/src/arc_mcp_server.py"] } }

光标

  1. 打开光标设置并导航至 AI 设置
  2. 配置 MCP 服务器(类似 VS Code 配置)
  3. 重启光标

工具文档

arc_search_story

针对多跳问题的自然语言图形查询。

参数:

  • question :要问的自然语言问题
  • max_depth (可选):图遍历的最大深度(默认值:3)
  • max_results (可选):返回的最大结果数(默认值:100)

返回:

{ "path": [ {"id": "pr:42", "type": "pr", "title": "Add new feature", "depth": 0}, {"id": "adr:123", "type": "adr", "title": "Architecture decision", "depth": 1}, {"id": "issue:456", "type": "issue", "title": "Feature request", "depth": 2} ], "meta": { "query_depth": 3, "sql": "/* The SQL query used for debugging */" } }

AI助手如何使用这些数据

当开发人员询问“为什么我们从 Redis 迁移到我们的自定义缓存解决方案?”时,AI 助手可以使用结构化路径数据来创建如下响应:

“2023 年 7 月从 Redis 迁移到我们的自定义缓存解决方案是由三个关键因素驱动的:

  1. 性能瓶颈:线性问题 PERF-387 记录了峰值流量期间的 Redis 连接池问题,导致 2023 年第二季度观察到的 30% 的延迟峰值。在 6 月份中断后,平台团队将此问题优先级定为 P0。
  2. 架构限制:ADR-29(由 Sarah Chen 撰写)详细说明了 Redis 的单线程模型如何无法有效处理我们日益增长的并发写入模式,尤其是在产品目录服务方面。此 ADR 引用了最初提出担忧的 Linear 问题 ARCH-42。
  1. 成本考量:GitHub PR #1204 包含基准测试结果,显示定制解决方案将基础设施成本降低了 42%,同时将 p99 延迟降低了 150 毫秒。此 PR 链接到第三季度成本优化计划中的 Linear 问题 COST-56。

此次迁移由 7 个 GitHub PR 共同实施,主要由基础设施团队负责,其中库存和结账服务的变更最为显著。最初存在数据一致性方面的担忧(由 Alex Kim 在 PR #1209 中提出),但最终通过添加 ADR-31 中记录的两阶段提交协议得到了解决。

自定义解决方案自部署以来一直很稳定,只有两起与缓存失效边缘情况相关的小事件(在 Linear 中跟踪为 INC-45 和 INC-52),均在后续 GitHub PR #1567 中得到解决。”

响应内容包括:

  • 来自不同来源的信息(线性问题、GitHub PR、ADR、事件)
  • 具体指标和测量方法
  • 涉及人员的姓名及其职责
  • 事件顺序和技术细节
  • 出现的问题及其解决方案
  • 之后发生了什么

这是因为 Arc 可以连接不同系统之间的信息,而这些系统通常是独立的。

常见用例

1. 新团队成员入职

当新开发人员加入团队时,他们可以询问有关不熟悉的代码和系统的问题,以了解实现背后的背景和原因。

2. 防止回归

在对复杂或关键系统进行更改之前,开发人员可以探索以前的问题的历史、不起作用的方法以及当前实施背后的原因。

3. 制定架构决策

在考虑改变架构时,团队可以查看相关决策的历史记录,了解之前尝试过的方法以及选择某些方法的原因。

4.重构遗留代码

当使用缺少文档的旧代码时,开发人员可以在进行更改之前追踪其来源、了解其目的并识别其依赖关系。

未来发展

Arc 的未来计划包括:

  • 在 PR 上运行轻量级模拟以识别潜在问题
  • 检测安全漏洞和技术债务风险
  • 构建系统行为随时间变化的因果模型
  • 将模拟结果添加回知识图谱

执照

MIT 许可证

需要幫忙?

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

一种桥梁,将本地时间知识图的结构化、可验证的上下文和查询功能暴露给与 MCP 兼容的 AI 代理,使它们能够访问明确的项目历史和关系,而不仅仅是语义内容。

  1. 快速启动工作流程
    1. Arc 的工作原理
      1. 知识图谱结构
      2. 连接不同的系统
    2. 示例问题
      1. 建筑推理与决策考古学
      2. 跨系统影响分析
      3. 技术债务与回归预防
      4. 知识转移与入职培训
    3. 可用工具
      1. 安装
        1. 设置
          1. 一体化
            1. 克劳德桌面
            2. VS Code 代理模式
            3. 光标
          2. 工具文档
            1. arc_search_story
            2. AI助手如何使用这些数据
          3. 常见用例
            1. 1. 新团队成员入职
            2. 2. 防止回归
            3. 3. 制定架构决策
            4. 4.重构遗留代码
          4. 未来发展
            1. 执照
              1. 需要幫忙?

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  Allows Claude or other MCP-compatible AI assistants to search the web and get up-to-date information using the Perplexity API, with features for filtering results by time period.
                  Last updated -
                  8
                  Python
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server that enables AI models to retrieve information from Ragie's knowledge base through a simple 'retrieve' tool.
                  Last updated -
                  1
                  50
                  4
                  JavaScript
                  MIT License
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables AI assistants to interact with Linear project management systems, allowing users to retrieve, create, and update issues, projects, and teams through natural language.
                  Last updated -
                  32
                  80
                  5
                  TypeScript
                  MIT License
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  An MCP server that enables AI assistants to interact with the Plane project management platform, allowing them to manage workspaces, projects, issues, and comments through a structured API.
                  Last updated -
                  JavaScript

                View all related MCP servers

                ID: 8nuwfkmoxy