How it works

Chat with your codebase

Ask your codebase a question and get a grounded, cited answer — every claim links the source it came from. The same engine powers an embeddable widget and an MCP server that lets any AI agent query your project over an open protocol.

Grounded chat with inline citations

ContextBrain chat does not answer from a model's training data. Every question is answered from a freshly assembled context pack— the real code, the real schema, your team's memory — and every answer carries inline citationsback to the chunks it drew from. If the model says “the auth flow signs the session cookie with HMAC-SHA256,” that sentence links the file and function it read.

This is the antidote to hallucination. The model is not free to invent a function, an import, or an API — because the answer is constrained to, and must cite, what the retrieval actually found. When the context does not contain an answer, the confidence and freshness scoring on the underlying pack makes that visible instead of papering over it with a confident guess. Every retrieval result also carries a cite field so the synthesizing model can quote sources verbatim.

The admin chat surface streams its responses and is memory-aware, so a conversation honors the org and project rules in your knowledge graph as it goes, with conversation history and auto-synthesized titles.

Role-aware, audience-scoped answers

The same question deserves a different answer depending on who is asking. ContextBrain is multi-tenant with role-based access — a developer, a PM, a tech lead, and a QA engineer see context scoped to their role, and cross-tenant references are blocked so a chat never reaches into another client's or another project's code. An answer is only ever grounded in context the asker is allowed to see.

The embeddable chat widget

You can drop a context-aware assistant into your own product — or a client's — with a single script tag:

<script src="https://app.contextbrain.io/embed.js" data-key="pk_live_…"></script>

The widget is built to be shipped into someone else's app safely. Each publishable key carries an origin allowlist, a JWT bridge, and an iframe sandbox; embed sessions are minted through a rate-limited, replay-protected endpoint. Keys support expiry and reissue-with-grace(1–90 days) so you can rotate a publishable key without breaking a live deployment, and each key has its own analytics roll-up. An agency can stand up a context-aware assistant inside a client's app in an afternoon.

The MCP server

The Model Context Protocol (MCP) is an open standard for feeding context and tools to AI agents — the common pipe that any compliant client can speak. ContextBrain ships an MCP server over HTTP and SSE transports using JSON-RPC 2.0, so any agent can query your project directly instead of working blind.

The server exposes a catalogue of agent-callable tools, each gated by scope, rate-limited, and audited. Among them:

  • search_codebase — hybrid search across code (and docs, when requested), the same ranking the UI uses.
  • get_context_pack — assemble a context pack synchronously and return its signed manifest.
  • get_project_memory — list or search project memory with a tier filter.
  • get_coding_guidelines — pull the project's coding rules.
  • get_impact_analysis — the call/import blast radius for a symbol before you touch it.
  • get_release_risk — the pre-merge risk surface for a change.
  • find_similar_features — prior work that resembles the current task.
  • add_to_memory / add_session_note / propose_memory — let an agent write findings back into governed memory (atomic and governance-scanned).

Writes are transactional and audited; every audit row is run through a secret scrubber so keys and tokens never land in a log.

Connecting Claude Code, Cursor, or any MCP client

Because the server speaks the open protocol, connecting an agent is configuration, not integration work. Point Claude Code, Cursor, or any MCP-compatible client at the ContextBrain MCP endpoint, and the tool catalogue above becomes available inside that agent. The agent stops guessing about your codebase because it can nowask— search code, pull a scored context pack, read your team's memory, and check a change's impact before it makes one.

MCP is the pipe; ContextBrain is the brain that decides what flows through it. The protocol is universal — the value is in the grounded, scored, governed context on the other end.

Where to go next

See how the bundles behind every answer are built in context packs, or compare this grounded, any-agent approach to point tools in alternatives.