anchor_get_contextLABSCO SUMMARY
The context a maintainer would have supplied.
The premise is that most bad agent edits are not syntax problems but missing history: a constraint that a review argued about two years ago, a regression that came back twice, the one test command that actually covers this file. Anchor mines that from merged PRs and pairs it with a current code index, returning it with citations and a confidence level rather than as prose. Indexing is local and GitHub access is read-only, so the cost is disk and a first sync — and the evidence is only ever as good as the PR history in the repository you point it at.
What it is
A local-first MCP server that indexes GitHub PR history together with your current code into a SQLite file under .anchor/, then serves an agent ranked, cited context before it changes anything. One primary tool answers what should be known before touching this, and a set of secondary tools cover file explanation, diff review, architecture, tests, onboarding and cross-repo impact.
What you get
- Ranked, cited context for a task — constraints from merged PRs and review comments, relevant tests, regression memory — each with a confidence level and a freshness check against the current code —
anchor_get_context - A strict mode that returns only non-stale evidence at or above a minimum confidence, and says so plainly when nothing qualifies instead of padding the prompt —
anchor_get_context - Per-file history, a review pass over a diff, and free search across indexed history —
anchor_explain_file,anchor_review_diff,anchor_search_history - Architecture patterns for an area, a map of them, and a check of a diff against them —
anchor_get_architecture,anchor_get_architecture_map,anchor_check_architecture - The test commands that actually cover a file, ranked by how strongly —
anchor_get_test_commands - Cross-repo impact across allowlisted repositories: affected repos, API consumers, shared packages, regression memory and required tests —
anchor_check_cross_repo_impact,anchor_find_api_consumers,anchor_get_org_context,anchor_get_org_architecture - An evidence-backed plan for a task, an onboarding pack for an area, and index coverage reporting —
anchor_plan_task,anchor_onboarding_pack,anchor_get_playbook,anchor_index_status,anchor_org_index_status
Requirements
Node, from npm as @pratik7368patil/anchor — npm install -g or npx -y. GitHub access reuses local authentication that is already on the machine: GITHUB_TOKEN, GH_TOKEN or gh auth token, read-only scope, and the token is never written into MCP config, the SQLite index, logs or generated files. anchor init writes the client config for Cursor, Claude Code, Codex, VS Code, Antigravity or a generic client, adds .anchor/ to the local git exclude, and installs a daily incremental sync that --no-autosync turns off. npx @pratik7368patil/anchor demo runs the whole thing on bundled fixtures with no token and no repository index.
Setup effort
One command plus a key — npm install -g @pratik7368patil/anchor, then supply credentials
USE CASES
Making a risky change with the old arguments attached
Ask for context on the task and files before editing, and get the constraints, tests and past regressions that apply, each cited to a PR.
Finding out what breaks outside this repository
Check cross-repo impact for an API or shared-package change and read back affected repos, consumers and the tests they require.
Running the right test after an edit
Ask which commands actually cover the file you touched, ranked by strength, instead of running the whole suite.
Reviewing your own diff before opening a PR
Run the diff past the indexed history and the recorded architecture patterns to catch what a reviewer would have caught.
Getting oriented in an unfamiliar area
Pull an onboarding pack for the area — important files, risks, tests and playbooks — and read a per-file explanation from there.
17 tools
Listed in project docs. Your client may show a different list.
anchor_search_historyanchor_index_statusanchor_explain_fileanchor_review_diffanchor_get_architectureanchor_check_architectureanchor_plan_taskanchor_get_test_commandsanchor_get_architecture_mapanchor_onboarding_packanchor_get_playbookanchor_get_org_contextanchor_check_cross_repo_impactanchor_find_api_consumersanchor_get_org_architectureanchor_org_index_statusBEFORE YOU INSTALL
What to know first
Tools you get
17 tools named in the project's documentation.
Requires
- anchor on PATH
- One of GITHUB_TOKEN or GH_TOKEN in your environment, or a gh CLI login (gh auth token)
INSTALLATION
Connect your client
Server setup
npm install -g @pratik7368patil/anchorMCP Clients
Cursor
{
"mcpServers": {
"anchor": {
"command": "anchor",
"args": [
"serve"
]
}
}
}The configuration on this page does not set GITHUB_TOKEN and GH_TOKEN; the project's instructions set them with an export line. That line reaches only programs started from the same terminal, so to supply them, start your client or the server from that terminal.
Claude Code
anchor init --target claude-codeCodex
anchor init --target codexVS Code, Antigravity, Any MCP client
anchor init