Connect your agent (MCP)

ProofGit exposes two read-only MCP (Model Context Protocol) servers, so an AI agent can query your repositories directly and get back the same trust and freshness signals a human sees in the web UI.

The two servers

ScopeEndpointTools
Single repositoryPOST /api/v1/repos/{owner}/{repo}/bnlgit/mcpfetch_bnlgit_overview, search_bnlgit_documentation, search_bnlgit_code, search_bnlgit_hybrid, map_bnlgit_topology, list_bnlgit_cleanup_plans, get_bnlgit_cleanup_plan
FleetPOST /api/v1/bnlgit/mcplist_bnlgit_repos, search_bnlgit_hybrid, search_bnlgit_code, list_bnlgit_cleanup_plans, get_bnlgit_cleanup_plan

Seven repo-scoped tools, five fleet-scoped. The fleet server searches across every BNLRepo the caller can see in one query, or an explicit list of repositories you pass in.

Every tool tells your agent that it only reads: each one carries the MCP annotations readOnlyHint: true and openWorldHint: false. Clients use them to decide whether to ask you before a call; GitHub Copilot, for one, asks before each call to a tool that does not say it only reads.

What a tool call returns

This is the part that matters more than the tool list.

A search hit is an evidence bundle, not a snippet. It carries the matched .llm excerpt and the exact backing source lines read from the recorded commit, plus the freshness state, the model and provenance of the summary, and a jump-back URL into the web UI so a human can check the agent's work in one click.

Line spans are re-validated against the pinned blob before they are returned. A summary that points at line 240 of a file that is now 180 lines long does not quietly return the wrong lines — the mismatch is caught.

search_bnlgit_hybrid packs its results to a token budget, and a response never exceeds it: tokens_used is always at most token_budget. Default limit is 8 results with a 6000-token budget; you can raise those to 25 and 32000 respectively. There is a summary_only mode if you want the excerpts without the backing source.

  • A hit that does not fit is left out and packing carries on with the next one, so one large file cannot end the answer early.
  • When the top-ranked hit alone is larger than the budget, its source lines are clipped to the first lines that fit, at most 200: the hit is marked source_lines_truncated, and source_lines_omitted says how many lines of its span were left out. If not even one line fits, the hit is left out and a note in notes tells the agent to raise token_budget.
  • omitted_count is the sum of three counts: omitted_by_budget (did not fit), omitted_by_limit (past the result limit; an upper bound, because it includes the extra candidates fetched for reranking) and omitted_by_file_cap (see Reading a search response).

Authentication

There are two ways in, and both reach exactly what you can already read.

Sign in from the agent. Claude Code, Codex and GitHub Copilot sign in to ProofGit themselves, in your browser, so there is no token to create or paste; so do Claude on claude.ai and ChatGPT, added as a connector (Set up your agent has the steps). A call without a token gets 401 with a WWW-Authenticate header naming where the sign-in details are, so the agent starts sign-in by itself. Whatever scope an agent asks for, the forge grants read:repository and nothing more. All the agents and apps you sign in share one authorization, ProofGit MCP: revoke it under Settings → Applications, in Authorized OAuth2 Applications, and every one of them has to sign in again.

  • The sign-in details are at /.well-known/oauth-authorization-server and, per server, /.well-known/oauth-protected-resource/<endpoint path>.
  • Agents register at POST /login/oauth/register and all get the same built-in client. Only redirects back to the agent's own machine, and the fixed callbacks of VS Code, Google Antigravity, Claude (https://claude.ai/api/mcp/auth_callback and its claude.com form) and ChatGPT (https://chatgpt.com/connector/oauth/{id} and https://chatgpt.com/connector_platform_oauth_redirect), are accepted.
  • PKCE with S256 is required.
  • For a sign-in, /login/oauth/userinfo answers with who you are (sub, name, preferred_username, email, picture) and no groups; ChatGPT asks for it right after signing in. When a sign-in has expired or been revoked, a refresh is refused with invalid_grant; on that answer, Claude and ChatGPT ask you to reconnect.

An access token, for Cursor, scripts and CI. A normal Gitea personal access token. Nothing bespoke.

Authorization: token <your-token>

Authorization: Bearer <your-token> is accepted too, which is what most MCP clients send by default.

  • Repo-scoped needs code-read access to that repository.
  • Fleet-scoped needs the repository token scope, and is limited to whatever its owner can already see.

Every tool only reads, so give the token read:repository scope and no write access. Mint one at Settings → Applications. A token without the read scope gets 403 with error="insufficient_scope".

Access is enforced per request, on every read. The MCP servers do not widen what a sign-in or a token can reach; they are a different way to ask the same permission system the same question.

Wire protocol

Plain JSON-RPC 2.0 over HTTP POST. MCP protocol version 2025-06-18. Methods: initialize, ping, tools/list, tools/call; notifications are acknowledged. There is no SSE or streaming transport — a POST returns a response.

Request bodies are capped at 2 MiB.

Connecting your agent

One command sets up Claude Code, Codex and GitHub Copilot with the fleet server and no token, and the agents then sign in on first use:

npx @bluenotelogic/harness proofgit --codex --copilot

Set up your agent explains what it writes, and has the commands for each agent if you would rather add the server yourself.

The Connect your agent over MCP card on a repository's Sync Cockpit (/{owner}/{repo}/bnlgit) shows the snippets with your real endpoint already filled in. For a repository your-org/your-repo, Claude Code's reads:

claude mcp add --transport http proofgit-your-repo https://app.proofgit.com/api/v1/repos/your-org/your-repo/bnlgit/mcp
claude mcp login proofgit-your-repo

Or, in a project's .mcp.json, with no token in it:

{
  "mcpServers": {
    "proofgit-your-repo": {
      "type": "http",
      "url": "https://app.proofgit.com/api/v1/repos/your-org/your-repo/bnlgit/mcp"
    }
  }
}

The card also has the access-token versions, for Cursor, scripts and CI. With a token, Claude Code's reads:

claude mcp add --transport http proofgit-your-repo https://app.proofgit.com/api/v1/repos/your-org/your-repo/bnlgit/mcp --header "Authorization: Bearer YOUR_PROOFGIT_TOKEN"

Or, in a project's .mcp.json:

{
  "mcpServers": {
    "proofgit-your-repo": {
      "type": "http",
      "url": "https://app.proofgit.com/api/v1/repos/your-org/your-repo/bnlgit/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_PROOFGIT_TOKEN"
      }
    }
  }
}

The server name is proofgit- followed by the repository name, lower-cased, with every character other than a-z, 0-9, - and _ turned into - (and any leading or trailing - dropped), so My.Repo becomes proofgit-my-repo. Replace YOUR_PROOFGIT_TOKEN with your token. The same card has snippets for Codex, GitHub Copilot and Cursor; they are also on Set up your agent.

For the fleet server, use https://app.proofgit.com/api/v1/bnlgit/mcp and the name proofgit-fleet instead; the fleet dashboard at /-/bnlgit shows the same card for it.

Checking it works without an agent

Every MCP server answers tools/list to an ordinary curl, which is the quickest way to confirm your token and URL before you go debugging your client's config:

curl -s https://app.proofgit.com/api/v1/repos/your-org/your-repo/bnlgit/mcp \
  -H "Authorization: token YOUR_PROOFGIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Choosing the right tool

  • fetch_bnlgit_overview — the repository-level _OVERVIEW.llm. Cheap orientation; start an agent here rather than letting it list files.
  • search_bnlgit_documentation — lexical search over the .llm summaries. Always available.
  • search_bnlgit_code — exact search over your actual source, backed by git grep. Use it when you know the symbol or string. On the fleet server it searches every repository you can read, or the repos you name.
  • search_bnlgit_hybrid — a plain question, ranked by meaning and by the words of your summaries and their typed facts, with any names it mentions looked up in the source, returned with backing source and packed to your token budget. Read Search before relying on this — the meaning and word ranking need the repository to be configured for vector retrieval; without it the search degrades to lexical results, and it tells you when it has done so.
  • list_bnlgit_cleanup_plans and get_bnlgit_cleanup_plan — the repository cleaner's plans: the list, newest first, then one plan with its items (category, risk, reason, evidence, affected files and rollback steps), by its id. On the fleet server both take repository as owner/name. They only read: accepting or dismissing an item stays in the web cleaner.
  • map_bnlgit_topology — the file-relationship graph built from every summary's structured related_files facts: which files a file references, which files reference it, and the repository's most-referenced files. Each edge carries the exact source spans in the declaring file plus a line-anchored link. Omit path to get only the most-referenced list; pass one to get that file's edges too. Files excluded by the repository's scope never appear in the map. By default a file's edges are only the relationships declared by a summary that is verified_current and naming a file that has a summary at that ref: pass include_stale for relationships declared by stale summaries, and include_unverified for those declared by legacy or provenance-unknown summaries or naming a file with no summary. Every edge carries declarer_trust_tier, and excluded_untrusted_declarer and excluded_unresolved count the edges withheld.

Reading a search response

Every search response names the behaviours that call applied in features, a sorted list; the four ranking entries at the end of the table say that a setting is on, not that this call used it. Read it rather than assuming what a server does: a response without features comes from a server older than release 0.2.0. Topology, overview and repository-listing responses carry no features.

Name in featuresToolsWhat it tells the agent
read_time_skip_policyall three searchesFiles the repository's scope excludes were withheld when this call read them.
statement_collapsehybrid, documentationEach summary statement is returned once, however many places in the file it cites.
serve_during_refreshall three searchesA summary being regenerated for the same source still counts as current.
secret_redactionall three searchesRecognised secrets read [redacted].
hybrid_fact_annotationhybridHits carry their typed facts.
relevance_scorehybridHits the reranker scored carry their relevance.
min_relevancehybridThe request may set a relevance floor.
budget_stricthybridtokens_used never exceeds token_budget.
budget_full_estimatehybridEach hit is measured as its whole JSON object, not only its text.
name_lanehybridThe name lookup is on: names a question mentions are also looked up in the source (a question with none runs no lookup).
keyword_lanehybridThe keyword lane is on: on a vector-ready repository, files are also ranked by the words of their summaries and the two rankings fused.
fact_chunkshybridFact chunks are on: on a vector-ready repository, indexed typed facts are searched as items of their own.
fused_rankinghybridThe fused ranking setting is on. It reorders hits only when rerank_applied is true.

The fields behind them:

  • How a hit was found. match_source is name_lane for an exact code hit on a name the question mentions (with name_lane_definition: true where that hit is the definition), keyword for a file the word ranking added, fact for a typed fact, and absent for a summary statement found by meaning. See Search.
  • One hit per statement. A statement that cites several spans of a file is returned once, with the lines of its first span; its other spans are listed in other_spans (their lines are not included) and collapsed_spans counts them. Hybrid search also caps the hits from any one file (one on the hosted service); omitted_by_file_cap counts the rest.
  • Typed facts. Hybrid hits carry structured_fact_ids and structured_fact_categories, as documentation hits do: the facts in the summary (symbols, endpoints, side effects and the like) whose lines overlap the hit.
  • Reranking. Every hybrid response says what the reranker did in rerank_status (applied, disabled, skipped or failed) and rerank_applied. A hit it scored carries relevance_score, its raw relevance from 0 to 1. Pass min_relevance (0 to 1) to drop hits below that relevance, and hits the reranker did not score; excluded_low_relevance counts what it dropped. The floor applies only when reranking ran: otherwise nothing is dropped and a note says why. See Search.
  • Freshness while a summary is regenerated. trust_reasons includes refresh_pending, or refresh_failed_previous_summary_served after a failed attempt, when a hit's summary is being regenerated for the same source.
  • Redactions. A hit lists what secret redaction replaced in redactions, by place and kind (L12:stripe_secret, summary:openai_key), never the value. No line is added or removed, so line numbers and spans still match the file. See Search.
  • fetch_handle is an opaque coordinate reserved for a future tool. No tool accepts it today, so do not build on redeeming it: to see a hit that was left out, narrow the query or raise token_budget.
  • Readiness. On the fleet server, every entry of list_bnlgit_repos carries vector_ready and vector_status (ready, no_model, model_not_served or no_chunks), so an agent can tell which repositories hybrid search can vector-rank before it asks. The older vector_enabled now means the same as vector_ready.

initialize reports the server's release in serverInfo.version (for example 0.7.5); before 0.2.0 it was always v1. What each release changed is in the release notes.

Server settings

The service's operator can switch each of these behaviours per instance. The Hosted column is what the hosted service runs:

SettingDefaultHostedWhat it does
bnlgit.retrieval.strict_budgetononNever exceeds the token budget (budget_strict).
bnlgit.retrieval.top_hit_max_lines200200The most lines an oversize top hit is clipped to.
bnlgit.retrieval.full_bundle_estimateoffoffMeasures each hit as its whole JSON object (budget_full_estimate).
bnlgit.retrieval.collapse_statementsononOne hit per summary statement (statement_collapse).
bnlgit.retrieval.max_hits_per_file21The most hybrid hits from one file; 0 means no cap.
bnlgit.retrieval.name_laneononLooks up names the question mentions in the source (name_lane).
bnlgit.retrieval.keyword_laneoffonFuses a word ranking of the summaries with the vector ranking (keyword_lane).
bnlgit.retrieval.fact_chunksoffonSearches typed facts as items of their own (fact_chunks).
bnlgit.retrieval.fused_rankingoffonBlends the reranker's score with vector similarity after a rerank (fused_ranking).
bnlgit.rerank.enabledoffoffThe cross-encoder reranking pass.
bnlgit.embedding.managed.enabledoffonOffers the managed embedding option for vector search (managed_embeddings in capabilities).
bnlgit.embedding.managed.default_for_new_pairsoffoffGives a new pair the managed option when its creator made no embedding choice.
bnlgit.retrieval.fair_rerank_windowononShares the reranker's window fairly between repositories.
bnlgit.retrieval.fleet_fair_mergeononLets repositories take turns in a fleet search that was not reranked.
bnlgit.retrieval.min_relevance_default00The relevance floor used when a request sets none; 0 means no floor.
bnlgit.retrieval.skip_unservable_indexononDoes not index summaries in an embedding model no query can use.
bnlgit.retrieval.serve_during_refreshononServes a summary while it is regenerated for the same source (serve_during_refresh).
bnlgit.retrieval.redact_secretsononRedacts recognised secrets (secret_redaction).
bnlgit.retrieval.topology_trust_filterononFilters map_bnlgit_topology by the trust of the summary that declared each relationship.
Why the citation matters

An agent that answers from a summary alone is an agent you have to trust. An agent that answers with the summary and the source lines it came from, at the commit it read them at, is an agent you can check. Every design decision in this integration follows from preferring the second thing.

Something here wrong or missing? Mail hello@proofgit.com — these pages are the single public source of truth for ProofGit and we would rather fix them than leave you guessing.