hindsight-mcp

hindsight-mcp

Consolidates git history, test results, and Copilot sessions into a searchable SQLite database for AI assistants to answer questions about development activity.

Category
访问服务器

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

cargo install hindsight-mcp

Configure VS Code

Create .vscode/mcp.json in your project:

{
  "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

Tool Purpose Example Prompt
hindsight_timeline Chronological activity view "Show recent commits and test runs"
hindsight_search Full-text search "Find commits about authentication"
hindsight_failing_tests Query test failures "What tests are failing?"
hindsight_activity_summary Aggregate stats "Summarise my week"
hindsight_commit_details Commit info with tests "Details for commit abc123"
hindsight_ingest Trigger 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:

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

# 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

Source Data Collected
Git Commits (SHA, author, message, timestamp, parents)
Tests Run metadata, outcomes, durations, failure output
Copilot Chat sessions, prompts, responses, attached files

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

CLI Reference

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>

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

Variable Description
HINDSIGHT_DATABASE Database path
HINDSIGHT_WORKSPACE Default workspace

Database Location

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

Troubleshooting

Problem Solution
Server does not start Check binary path; run with --verbose
No data showing Run hindsight_ingest tool via Copilot
Log interference Use --quiet in production

Development

<details> <summary><strong>Building from Source</strong></summary>

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

</details>

<details> <summary><strong>Running Tests</strong></summary>

cargo install cargo-nextest
cargo nextest run --workspace

</details>

<details> <summary><strong>Workspace Structure</strong></summary>

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>

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选