{
  "markdown": "<img src=\"https://raw.githubusercontent.com/Rbfinch/hindsight-mcp/main/assets/hindsight-logo.png\" alt=\"Hindsight Logo\" width=\"120\">\n\n<!-- mcp-name: io.github.Rbfinch/hindsight-mcp -->\n\n# hindsight-mcp\n\nAn MCP server for AI-assisted coding that leverages development history.\n\n## Overview\n\n**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.\n\n**Key Features:**\n- Full-text search across commits and Copilot conversations\n- Track test results linked to specific commits\n- Activity summaries and timeline views\n- Automatic git and Copilot session ingestion\n\n## Quick Start\n\n### Prerequisites\n\n- **VS Code v1.99+** with GitHub Copilot\n- **cargo-nextest** (for test ingestion): `cargo install cargo-nextest`\n\n### Installation\n\n```bash\ncargo install hindsight-mcp\n```\n\n### Configure VS Code\n\nCreate `.vscode/mcp.json` in your project:\n\n```json\n{\n  \"servers\": {\n    \"hindsight\": {\n      \"type\": \"stdio\",\n      \"command\": \"hindsight-mcp\",\n      \"args\": [\"--workspace\", \"${workspaceFolder}\"]\n    }\n  }\n}\n```\n\n### Verify Setup\n\n1. Open VS Code Command Palette (`Cmd+Shift+P`)\n2. Run **\"MCP: List Servers\"**\n3. Confirm `hindsight` is listed\n4. In Copilot Chat, switch to **Agent** mode\n5. Ask: *\"What have I been working on recently?\"*\n\nThat's it! Copilot will use hindsight tools to answer questions about your development history.\n\n## MCP Tools\n\n| Tool | Purpose | Example Prompt |\n|------|---------|----------------|\n| `hindsight_timeline` | Chronological activity view | \"Show recent commits and test runs\" |\n| `hindsight_search` | Full-text search | \"Find commits about authentication\" |\n| `hindsight_failing_tests` | Query test failures | \"What tests are failing?\" |\n| `hindsight_activity_summary` | Aggregate stats | \"Summarise my week\" |\n| `hindsight_commit_details` | Commit info with tests | \"Details for commit abc123\" |\n| `hindsight_ingest` | Trigger data refresh | \"Refresh development history\" |\n\n<details>\n<summary><strong>Tool Arguments Reference</strong></summary>\n\n### hindsight_timeline\n- `limit` (int): Max events, default 50\n- `workspace` (string): Filter by path\n\n### hindsight_search\n- `query` (string): Search query (required)\n- `source` (string): \"all\", \"commits\", or \"messages\"\n- `limit` (int): Max results, default 20\n\n### hindsight_failing_tests\n- `limit` (int): Max tests, default 50\n- `workspace` (string): Filter by path\n- `commit` (string): Filter by SHA\n\n### hindsight_activity_summary\n- `days` (int): Days to summarise, default 7\n\n### hindsight_commit_details\n- `sha` (string): Commit SHA (required)\n\n### hindsight_ingest\n- `workspace` (string): Path to ingest (required)\n- `source` (string): \"git\", \"copilot\", or \"all\"\n- `incremental` (bool): Only new data, default true\n- `limit` (int): Max items\n\n</details>\n\n## Test Ingestion\n\nRun tests and automatically ingest results:\n\n```bash\n# Run all tests and ingest\nhindsight-mcp test\n\n# Test specific package\nhindsight-mcp test -p my-crate\n\n# Preview without writing to database\nhindsight-mcp test --dry-run\n```\n\nThe `test` command automatically:\n- Spawns `cargo nextest` with correct flags\n- Auto-detects the current git commit\n- Ingests results to the database\n\n<details>\n<summary><strong>CI / Advanced Usage</strong></summary>\n\nFor CI pipelines or custom nextest invocations:\n\n```bash\n# Using stdin mode\nNEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 cargo nextest run \\\n  --message-format libtest-json 2>/dev/null | \\\n  hindsight-mcp test --stdin\n\n# Using ingest command with explicit commit\nNEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 cargo nextest run \\\n  --message-format libtest-json 2>/dev/null | \\\n  hindsight-mcp ingest --tests --commit $(git rev-parse HEAD)\n```\n\n</details>\n\n## Data Sources\n\n| Source | Data Collected |\n|--------|----------------|\n| **Git** | Commits (SHA, author, message, timestamp, parents) |\n| **Tests** | Run metadata, outcomes, durations, failure output |\n| **Copilot** | Chat sessions, prompts, responses, attached files |\n\nGit and Copilot data are ingested automatically. Test results require running `hindsight-mcp test`.\n\n## CLI Reference\n\n```\nhindsight-mcp [OPTIONS] [COMMAND]\n\nCommands:\n  ingest    Ingest data from various sources\n  test      Run tests and ingest results\n\nOptions:\n  -d, --database <PATH>   Database path [default: ~/.hindsight/hindsight.db]\n  -w, --workspace <PATH>  Workspace path [default: current directory]\n  -v, --verbose           Debug logging\n  -q, --quiet             Errors only\n      --skip-init         Skip database init\n  -h, --help              Print help\n  -V, --version           Print version\n```\n\n<details>\n<summary><strong>Test Subcommand Options</strong></summary>\n\n```\nhindsight-mcp test [OPTIONS] [-- <NEXTEST_ARGS>...]\n\nOptions:\n  -p, --package <PKG>     Package(s) to test\n      --bin <BIN>         Binary(ies) to run\n  -E, --filter <EXPR>     Filter expression\n      --stdin             Read from stdin\n      --dry-run           Preview only\n      --no-commit         Do not link to commit\n      --commit <SHA>      Explicit commit SHA\n      --show-output       Show test output\n```\n\n</details>\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `HINDSIGHT_DATABASE` | Database path |\n| `HINDSIGHT_WORKSPACE` | Default workspace |\n\n### Database Location\n\n| Platform | Default Path |\n|----------|--------------|\n| macOS | `~/Library/Application Support/hindsight/hindsight.db` |\n| Linux | `~/.local/share/hindsight/hindsight.db` |\n| Windows | `%LOCALAPPDATA%\\hindsight\\hindsight.db` |\n\n## Troubleshooting\n\n| Problem | Solution |\n|---------|----------|\n| Server does not start | Check binary path; run with `--verbose` |\n| No data showing | Run `hindsight_ingest` tool via Copilot |\n| Log interference | Use `--quiet` in production |\n\n## Development\n\n<details>\n<summary><strong>Building from Source</strong></summary>\n\n```bash\ngit clone https://github.com/Rbfinch/hindsight-mcp.git\ncd hindsight-mcp\ncargo build --release\n```\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\n```bash\ncargo install cargo-nextest\ncargo nextest run --workspace\n```\n\n</details>\n\n<details>\n<summary><strong>Workspace Structure</strong></summary>\n\n```\nhindsight/\n├── crates/\n│   ├── hindsight-mcp/      # MCP server binary\n│   ├── hindsight-git/      # Git log processing\n│   ├── hindsight-tests/    # Test result processing\n│   └── hindsight-copilot/  # Copilot session parsing\n```\n\n</details>\n\n<details>\n<summary><strong>Fuzzing</strong></summary>\n\n```bash\ncd crates/hindsight-tests\ncargo +nightly fuzz run fuzz_nextest_run\n\ncd crates/hindsight-copilot\ncargo +nightly fuzz run fuzz_session_json\n```\n\n</details>\n\n## License\n\nMIT\n",
  "bytes": 6756,
  "sha": "b8a90678eb8b1fc4769b0a353a62c57e3559edb1ce6b81eeefed9cacda3567ff",
  "repo_slug": "rbfinch/hindsight-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_rbfinch_hindsight_mcp_389197e0/readme"
}