Hindsight MCP

平台与服务

by rbfinch

MCP server for AI-assisted coding with development history: git, tests, Copilot.

什么是 Hindsight MCP

MCP server for AI-assisted coding with development history: git, tests, Copilot.

README

<img src="https://raw.githubusercontent.com/Rbfinch/hindsight-mcp/main/assets/hindsight-logo.png" alt="Hindsight Logo" width="120"> <!-- mcp-name: io.github.Rbfinch/hindsight-mcp -->

hindsight-mcp

An MCP server for AI-assisted coding that leverages development history.

Overview

hindsight-mcp consolidates development data (git logs, test results, and GitHub Copilot sessions) into a searchable SQLite database, making it accessible to AI assistants through MCP tool calls in VS Code.

Key Features:

  • Full-text search across commits and Copilot conversations
  • Track test results linked to specific commits
  • Activity summaries and timeline views
  • Automatic git and Copilot session ingestion

Quick Start

Prerequisites

  • VS Code v1.99+ with GitHub Copilot
  • cargo-nextest (for test ingestion): cargo install cargo-nextest

Installation

bash
cargo install hindsight-mcp

Configure VS Code

Create .vscode/mcp.json in your project:

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

Verify Setup

  1. Open VS Code Command Palette (Cmd+Shift+P)
  2. Run "MCP: List Servers"
  3. Confirm hindsight is listed
  4. In Copilot Chat, switch to Agent mode
  5. Ask: "What have I been working on recently?"

That's it! Copilot will use hindsight tools to answer questions about your development history.

MCP Tools

ToolPurposeExample Prompt
hindsight_timelineChronological activity view"Show recent commits and test runs"
hindsight_searchFull-text search"Find commits about authentication"
hindsight_failing_testsQuery test failures"What tests are failing?"
hindsight_activity_summaryAggregate stats"Summarise my week"
hindsight_commit_detailsCommit info with tests"Details for commit abc123"
hindsight_ingestTrigger data refresh"Refresh development history"
<details> <summary><strong>Tool Arguments Reference</strong></summary>

hindsight_timeline

  • limit (int): Max events, default 50
  • workspace (string): Filter by path

hindsight_search

  • query (string): Search query (required)
  • source (string): "all", "commits", or "messages"
  • limit (int): Max results, default 20

hindsight_failing_tests

  • limit (int): Max tests, default 50
  • workspace (string): Filter by path
  • commit (string): Filter by SHA

hindsight_activity_summary

  • days (int): Days to summarise, default 7

hindsight_commit_details

  • sha (string): Commit SHA (required)

hindsight_ingest

  • workspace (string): Path to ingest (required)
  • source (string): "git", "copilot", or "all"
  • incremental (bool): Only new data, default true
  • limit (int): Max items
</details>

Test Ingestion

Run tests and automatically ingest results:

bash
# 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

The test command automatically:

  • Spawns cargo nextest with correct flags
  • Auto-detects the current git commit
  • Ingests results to the database
<details> <summary><strong>CI / Advanced Usage</strong></summary>

For CI pipelines or custom nextest invocations:

bash
# 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)
</details>

Data Sources

SourceData Collected
GitCommits (SHA, author, message, timestamp, parents)
TestsRun metadata, outcomes, durations, failure output
CopilotChat sessions, prompts, responses, attached files

Git and Copilot data are ingested automatically. Test results require running hindsight-mcp test.

CLI Reference

code
hindsight-mcp [OPTIONS] [COMMAND]

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

Options:
  -d, --database <PATH>   Database path [default: ~/.hindsight/hindsight.db]
  -w, --workspace <PATH>  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
<details> <summary><strong>Test Subcommand Options</strong></summary>
code
hindsight-mcp test [OPTIONS] [-- <NEXTEST_ARGS>...]

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

Environment Variables

VariableDescription
HINDSIGHT_DATABASEDatabase path
HINDSIGHT_WORKSPACEDefault workspace

Database Location

PlatformDefault Path
macOS~/Library/Application Support/hindsight/hindsight.db
Linux~/.local/share/hindsight/hindsight.db
Windows%LOCALAPPDATA%\hindsight\hindsight.db

Troubleshooting

ProblemSolution
Server does not startCheck binary path; run with --verbose
No data showingRun hindsight_ingest tool via Copilot
Log interferenceUse --quiet in production

Development

<details> <summary><strong>Building from Source</strong></summary>
bash
git clone https://github.com/Rbfinch/hindsight-mcp.git
cd hindsight-mcp
cargo build --release
</details> <details> <summary><strong>Running Tests</strong></summary>
bash
cargo install cargo-nextest
cargo nextest run --workspace
</details> <details> <summary><strong>Workspace Structure</strong></summary>
code
hindsight/
├── crates/
│   ├── hindsight-mcp/      # MCP server binary
│   ├── hindsight-git/      # Git log processing
│   ├── hindsight-tests/    # Test result processing
│   └── hindsight-copilot/  # Copilot session parsing
</details> <details> <summary><strong>Fuzzing</strong></summary>
bash
cd crates/hindsight-tests
cargo +nightly fuzz run fuzz_nextest_run

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

License

MIT

常见问题

Hindsight MCP 是什么?

MCP server for AI-assisted coding with development history: git, tests, Copilot.

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论