Token导航 LogoToken导航TokenDH.com
Hindsight MCP logo
开发工具stdio官方级别未说明来源级核验

Hindsight MCP

MCP Server

hindsight-mcp是一款AI辅助编程服务,通过整合开发历史数据(git日志、测试结果和GitHub Copilot会话)到可搜索的SQLite数据库,使AI助手能够在VS Code中通过MCP工具调用访问这些数据。

工具数

6

提示词数

0

GitHub Stars

2

资源数

0
RustVS Code开发工具VS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Rbfinch

提供方

Rbfinch

最后核验

2026/5/17 20:45

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

事后诸葛亮

利用开发历史进行人工智能辅助编码的MCP服务器。

概述

事后诸葛亮 将开发数据(git日志、测试结果和GitHub Copilot会话)整合到一个可搜索的SQLite数据库中,使AI助手可以通过VS Code中的MCP工具调用访问它。

主要特点:

  • 跨提交和复制对话的全文搜索
  • 跟踪与特定提交相关的测试结果
  • 活动摘要和时间线视图
  • 自动接收git和Copilot会话

快速开始

先决条件

  • VS代码v1.99+ 使用GitHub Copilot
  • 下一个货物 (用于测试摄入): cargo install cargo-nextest

安装

cargo install hindsight-mcp

配置VS代码

创建 .vscode/mcp.json 在您的项目中:

{
  "servers": {
    "hindsight": {
      "type": "stdio",
      "command": "hindsight-mcp",
      "args": ["--workspace", "${workspaceFolder}"]
    }
  }
}

验证设置

  1. 打开VS代码命令面板(Cmd+Shift+P)
  2. “MCP:列出服务器”
  3. 确认 hindsight 已列出
  4. 在Copilot聊天中,切换到 代理 模式
  5. 问: *“我最近在做什么?”*

就是这样!Copilot将使用后见之明工具来回答有关您的发展历史的问题。

MCP工具

工具目的示例提示
hindsight_timeline按时间顺序排列的活动视图“显示最近的提交和测试运行”
hindsight_search全文搜索“查找关于身份验证的提交”
hindsight_failing_tests查询测试失败“哪些测试失败?”
hindsight_activity_summary汇总统计数据“总结我的一周”
hindsight_commit_details通过测试提交信息“提交abc123的详细信息”
hindsight_ingest触发数据刷新“刷新开发历史”

Tool Arguments Reference

后视时间线

  • limit (int):最大事件数,默认值50
  • workspace (string):按路径筛选

后视搜索

  • query (string):搜索查询(必填)
  • source (string):“全部”、“提交”或“消息”
  • limit (int):最大结果,默认值为20

后视失败测试

  • limit (int):最大测试数,默认值50
  • workspace (string):按路径筛选
  • commit (string):按SHA筛选

后视_活动_总结

  • days (int):总结天数,默认为7天

后视_承诺_细节

  • sha (string):提交SHA(必填)

妊娠期后视镜

  • workspace (string):摄取路径(必填)
  • source (string):“git”、“副驾驶”或“all”
  • incremental (bool):只有新数据,默认为true
  • limit (int):最大项目数

试验摄入

运行测试并自动摄取结果:

# Run all tests and ingest
hindsight-mcp test

# Test specific package
hindsight-mcp test -p my-crate

# Preview without writing to database
hindsight-mcp test --dry-run

test 命令自动执行:

  • 生成物 cargo nextest 带有正确的标志
  • 自动检测当前git提交
  • 将结果输入数据库

CI / Advanced Usage

对于CI管道或自定义next est调用:

# Using stdin mode
NEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 cargo nextest run \
  --message-format libtest-json 2>/dev/null | \
  hindsight-mcp test --stdin

# Using ingest command with explicit commit
NEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 cargo nextest run \
  --message-format libtest-json 2>/dev/null | \
  hindsight-mcp ingest --tests --commit $(git rev-parse HEAD)

数据源

来源收集的数据
Git提交(SHA、作者、消息、时间戳、家长)
测试运行元数据、结果、持续时间、故障输出
副驾驶聊天会话、提示、回复、附件

Git和Copilot数据是自动摄取的。测试结果需要运行 hindsight-mcp test.

CLI 参考

hindsight-mcp [OPTIONS] [COMMAND]

Commands:
  ingest    Ingest data from various sources
  test      Run tests and ingest results

Options:
  -d, --database 
   Database path [default: ~/.hindsight/hindsight.db]
  -w, --workspace 
  Workspace path [default: current directory]
  -v, --verbose           Debug logging
  -q, --quiet             Errors only
      --skip-init         Skip database init
  -h, --help              Print help
  -V, --version           Print version

Test Subcommand Options

hindsight-mcp test [OPTIONS] [-- ...]

Options:
  -p, --package 
     Package(s) to test
      --bin          Binary(ies) to run
  -E, --filter      Filter expression
      --stdin             Read from stdin
      --dry-run           Preview only
      --no-commit         Do not link to commit
      --commit       Explicit commit SHA
      --show-output       Show test output

环境变量

变量描述
HINDSIGHT_DATABASE数据库路径
HINDSIGHT_WORKSPACE默认工作区

数据库位置

平台默认路径
macOS~/Library/Application Support/hindsight/hindsight.db
Linux~/.local/share/hindsight/hindsight.db
窗户%LOCALAPPDATA%\hindsight\hindsight.db

故障排除

问题解决方案
服务器未启动检查二进制路径;与...一起跑 --verbose
没有数据显示运行 hindsight_ingest 通过Copilot工具
日志干扰使用 --quiet 生产中

发展

Building from Source

git clone https://github.com/Rbfinch/hindsight-mcp.git
cd hindsight-mcp
cargo build --release

Running Tests

cargo install cargo-nextest
cargo nextest run --workspace

Workspace Structure

hindsight/
├── crates/
│   ├── hindsight-mcp/      # MCP server binary
│   ├── hindsight-git/      # Git log processing
│   ├── hindsight-tests/    # Test result processing
│   └── hindsight-copilot/  # Copilot session parsing

Fuzzing

cd crates/hindsight-tests
cargo +nightly fuzz run fuzz_nextest_run

cd crates/hindsight-copilot
cargo +nightly fuzz run fuzz_session_json

许可证

麻省理工学院

目录标签

目录标签

RustVS Code开发工具AI辅助编程本地部署开发历史代码搜索测试结果跟踪GitHubCopilot集成

支持客户端

VS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP