Enforces repo-specific context policies and prevents AI coding agents from repeating documented team mistakes through deterministic gates.
Also known as Doucs91/hivelore, @hivelore/mcp
- Stars
- 5
- Tools
- 16
- Downloads, 30 days
- 1,836
- Latest version
- 0.53.1
- Last commit
- Nov 13, 2026
- License
- Apache-2.0
What is Hivelore MCP?
Hivelore enforces repo-specific context policies and prevents AI coding agents from repeating documented team mistakes through deterministic gates. It exposes 16 tools, such as get_briefing, mem_get, mem_save.
Summary generated from the project's README
About Hivelore MCP server
Hivelore serves as an enforcement layer for AI coding agents, ensuring they adhere to repository-specific policies and team knowledge. It functions by providing agents with a briefing of non-obvious context, such as specific naming conventions or architectural decisions, before they begin coding. This prevents agents from making plausible but incorrect changes that violate established team patterns.
Developers use this tool to turn hard-won lessons into deterministic gates within MCP, Git hooks, or CI environments. By running commands like hivelore init, a .ai/ context policy layer is created. The system uses Markdown files to anchor decisions and gotchas to specific code paths, automatically detecting when these anchors become stale. It is designed to complement existing testing and linting suites by capturing the unguessable intent that standard tools cannot infer.
What you can do with it
- 1Brief agents with team knowledgeAn AI agent can call the get_briefing tool to receive relevant context and breadcrumbs before starting a task.
- 2Block repetitive coding mistakesThe system can refuse a commit if it attempts to reintroduce a documented error that the team has already resolved.
- 3Enforce custom validation commandsYou can route existing test suites to act as a gate that blocks unsafe code changes during the commit process.
Written from the project's README. Every use case is checked against a quote from it.
How to install Hivelore MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Hivelore MCP in Claude Code
$ claude mcp add hivelore -- npx -y @hivelore/mcpInstall Hivelore MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"hivelore": {
"command": "npx",
"args": [
"-y",
"@hivelore/mcp"
]
}
}
}Install Hivelore MCP in VS Code
.vscode/mcp.json
{
"servers": {
"hivelore": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@hivelore/mcp"
]
}
}
}Install Hivelore MCP in VS Code CLI
$ code --add-mcp '{"name":"hivelore","type":"stdio","command":"npx","args":["-y","@hivelore/mcp"]}'Install Hivelore MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"hivelore": {
"command": "npx",
"args": [
"-y",
"@hivelore/mcp"
]
}
}
}Install Hivelore MCP in Codex
$ codex mcp add hivelore -- npx -y @hivelore/mcpInstall Hivelore MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.hivelore] command = "npx" args = ["-y", "@hivelore/mcp"]
Install Hivelore MCP in Gemini CLI
$ gemini mcp add -s user hivelore npx -- -y @hivelore/mcpInstall Hivelore MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"hivelore": {
"command": "npx",
"args": [
"-y",
"@hivelore/mcp"
]
}
}
}Hivelore MCP tools 16
Detected from the READMEget_briefingmem_getmem_savemem_updatemem_triedpropose_sensorpre_commit_checkreport_frictionmem_searchmem_relevant_tomem_feedbackmem_verify
| get_briefing | — | |
| mem_get | — | |
| mem_save | — | |
| mem_update | — | |
| mem_tried | — | |
| propose_sensor | — | |
| pre_commit_check | — | |
| report_friction | — | |
| mem_search | — | |
| mem_relevant_to | — | |
| mem_feedback | — | |
| mem_verify | — |
Show all 16 toolsShow fewer tools
code_mapcode_searchscaffold_testmem_session_end
| code_map | — | |
| code_search | — | |
| scaffold_test | — | |
| mem_session_end | — |
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledPass
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubHivelore is the enforcement layer inside an AI coding-agent harness. It briefs agents with the team's non-obvious knowledge before they act, then turns each hard-won lesson into a deterministic gate — in MCP, Git hooks, and CI — that blocks the change about to repeat it. Same diff, same verdict, on every machine. Memory is the substrate; the gate is the product.
A capable model already knows generic best practice. What it cannot guess is your team's arbitrary, repo-specific knowledge: that public ids are id + 100000 prefixed AC-, that the status field must be "OK"/"KO", that you never edit an applied migration. Left to itself, a confident agent invents a plausible answer - clean, tested, green, and wrong by policy. Hivelore carries that unguessable knowledge into the task and blocks the change that's about to violate it.
Hivelore's job is not to replace tests, linters, or observability. It makes the repo-specific knowledge those tools cannot infer available, auditable, and enforceable.
The problem
AI coding agents are powerful, but they often act with incomplete repo context. Compaction, parallel sessions, agent switches, and stale advisory docs all create the same failure mode: the agent changes code without carrying the team's current decisions into the work.
Most teams work around this with instructions and hope:
- "Please read our architecture decisions first."
- "Don't repeat the migration mistake from last sprint."
- "Remember to capture what you learned."
- "Don't merge code that invalidates a team decision."
Those rules are easy to skip. Hivelore turns them into repo-native context policy.
How it works
AI agent ──▶ Hivelore briefing ──▶ code change ──▶ Hivelore policy gate ──▶ merge
▲ │
└── context breadcrumbs · decisions · gotchas · anchors
hivelore initcreates a.ai/context policy layer in your repo.- Agents start every session with
get_briefing— one MCP call that returns small default context plus deeper breadcrumbs ranked by task relevance. - Decisions, gotchas, failed attempts, and session recaps live as Markdown files anchored to the code paths they describe. When code moves, Hivelore detects stale anchors.
hivelore enforce checkand CI enforcement block unsafe states: missing briefing, stale critical decisions, an anchored anti-pattern your diff is about to repeat, or uncaptured session knowledge.
Memory is the substrate. Context enforcement is the product promise. AI changes should not enter the codebase without consulting the team's current knowledge.
For the changes prompted by the September 18 client reports, including evidence checks, quieter briefings and completion scoped to a task, see the implementation notes.
Where Hivelore fits in the harness
Harness engineering is about the environment around the model: feedforward guidance before it acts, feedback sensors after it acts, and workflow gates that keep bad states from landing. Hivelore owns the repo-specific context policy part of that harness.
| Harness concern | Hivelore role |
|---|---|
| Feedforward guidance | get_briefing, module context, skills, decisions, gotchas, failed attempts |
| Feedback and gates | MCP ordering policy, pre_commit_check, Git hooks, CI enforcement, stale-anchor detection |
| Knowledge lifecycle | Git-native Markdown records, path/symbol anchors, confidence, retirement, linting |
| Boundaries | Hivelore complements unit/e2e tests, type checks, runtime traces, security scanners, and LLM evals; it does not try to replace them |
The narrow positioning is intentional: Hivelore is not a general memory database or an agent dashboard. It is the control layer that helps coding agents act with the validated, non-obvious knowledge of the team.
Scope & boundaries — the three harnesses
Harness engineering regulates three different things about agent-written code. Hivelore deliberately covers two of them and treats the third as out of scope, for now.
| Harness dimension | Question it answers | Hivelore today |
|---|---|---|
| Maintainability | Is the code clean? (patterns, footguns, conventions) | ✅ Covered — executable sensors + anti-pattern gate |
| Architecture fitness | Does it respect the team's structural decisions? | 🟡 Partly — anchored decision/architecture memories + decision-coverage gate |
| Behaviour | Does the code do the functionally correct thing? | 🟡 Bridged — command sensors route your own tests to lessons (see below) |
Why no behaviour harness yet. Verifying functional correctness needs an oracle — an independent
source of truth for what the code should do — and that oracle problem (plus the trap of an agent
grading its own work) is the least-mature part of the field. That territory belongs to your tests,
property-based checks, and LLM-evals; Hivelore does not try to replace them. What Hivelore does do is carry
the unguessable intent a behaviour test would otherwise have to encode (status must be OK/KO,
public ids = id + 100000) as feedforward context and deterministic sensors — a partial, static slice
of behaviour control, not a runtime functional oracle.
The bridge exists (v0.33.0): command sensors. A lesson can carry a command instead of a regex — your own test or invariant script. When a diff touches the sensor's paths, the gate executes it and a non-zero exit refuses the commit with the lesson as the message. Hivelore does not invent the oracle (the unsolved problem); it routes the oracle your team already owns to the lesson it protects:
hivelore memory tried \
--what "refund exceeded the captured amount" \
--why-failed "prod incident #442 — refunds must clamp to capture" \
--paths src/payments/ \
--sensor-command "npx vitest run tests/payments/refund-invariants.spec.ts"
# → validated (the oracle must PASS on the current tree), then enforced at commit + CI
# Saved team-scoped by default: an enforced lesson must travel to every machine and CI.
Rules that keep it honest: opt-in per repo (enforcement.runCommandSensors: true — it executes
repo-authored commands), a proposal whose oracle fails on the presumed-correct tree is rejected,
an oracle that is still a pending stub cannot arm a block sensor, and an unrunnable command
(not found, timeout) warns but never blocks — a broken harness must not masquerade as a failing test.
Commands run with a scrubbed environment (test-runner basics only — no cloud credentials or
tokens). And you can make the guarantee demonstrable: --red-ref <pre-fix-commit> replays the
incident in a scratch worktree and requires the oracle to FAIL there — the sensor then records
red_proven: true, shown in the prevention receipt. A crash is not a RED: if the oracle errors
before reaching its assertion on the incident state (the guarded code doesn't exist yet, an import
or syntax error, "no tests found"), the replay reports red-unrunnable and refuses to claim proof.
Full behaviour verification (test generation, LLM evals) remains your test suite's job.
Since v0.43.0, prove-RED is mandatory for a blocking shell/test sensor: an oracle without a
reproducible incident state remains warn. CI can also set commandSensorUnrunnable: "block" so a
missing required oracle fails as a broken harness, and sensorWeakeningGate: "block" so protection
cannot be silently demoted or removed.
The on-ramp (v0.36.0): scaffold the test from the incident. A command sensor needs a test to
route — so Hivelore generates the skeleton from the lesson. hivelore sensors scaffold <memory-id>
(or the scaffold_test MCP tool, so agents do it in-session) detects your test framework
(vitest / jest / pytest / go), writes a pending test carrying the incident's provenance in its
header, and prints the exact sensors propose --kind test line to arm it. It never arms a sensor
itself (propose_sensor stays the sole validated writer); the stub stays pending so the suite is
green until you write the assertion. In a monorepo, the framework and location come from the
package that owns the lesson's anchor paths (a lesson under packages/api/ scaffolds into
packages/api/tests/…), not the repo root — and a lesson that spans several packages scaffolds
one pending test per owning package, all armed by a single sensor whose oracle chains their run
commands. A scaffold left pending or never armed is an open loop: doctor and enforce finish
nudge it (post-incident-test-unarmed) until the oracle is routed.
Pass the incident and the stub writes itself around the fix (v0.46.0). Add --red-ref <pre-fix-commit>
and the scaffold names the symbols the fix (red_ref..HEAD) actually touched and pre-fills the example
around them — import { refund } …, expect(refund(/* incident input */)).toBe(/* post-fix expected */)
instead of a blank subjectUnderTest(). It stays a pending, commented stub (no live import, suite
stays green) — a deterministic head-start, never an LLM guessing your assertion.
hivelore sensors scaffold 2026-07-03-attempt-refund-exceeds-capture --red-ref <pre-fix-commit>
# → tests/incidents/refund-exceeds-capture.test.ts (pending; names the touched symbols from the fix)
# then: fill the assertion → run it → arm it with the printed propose command.
Lower the cost of expressing the invariant (v0.48.0): --style. The behaviour harness leaves the
oracle to you — so the scaffold offers the two deterministic ways to make that cheaper (no LLM
guessing your assertion):
--style property— a fast-check / Hypothesis skeleton: state the invariant once (refund(a, b) ≤ b) and it is checked over many generated inputs.--style differential --reference <impl>— state no invariant at all: assert the subject agrees with a reference implementation (a legacy version, a second impl) for all generated inputs.
hivelore sensors scaffold <lesson> --red-ref <pre-fix-commit> --style property
hivelore sensors scaffold <lesson> --style differential --reference ../legacy/refund
Both stay pending, commented stubs (the suite stays green) and arm through the same validated prove-RED path once you fill them in.
Measure the behaviour harness (v0.45.0). hivelore doctor reports, per main code area, how much of
the behaviour surface is guarded: Behaviour harness: X/N area(s) guarded by a behavioural oracle (K armed, P red-proven) — so the branch's progress is visible, not guesswork. The human stats receipt
prints the same line as a footer. Since v0.47.0 the finding closes the loop to action: for each
uncovered area it prints the exact hivelore sensors scaffold <lesson> --red-ref <pre-fix-commit>
command in its Suggested commands (or a memory tried … then scaffold line when no lesson exists yet).
See
STABILITY.mdfor the frozen 1.0 surface andCONTRIBUTING.mdto extend Hivelore.
Executable memory sensors
Some gotcha and attempt memories can now carry a sensor block: a deterministic guardrail that
scans the diff. Three shapes, one validation doctrine (silent on correct code, fires on the mistake):
- regex — matched on added lines; the simple, dependency-free default.
- ast — an ast-grep structural pattern
(
stripe.paymentIntents.create($$$)withabsent: idempotencyKey): comments and string literals can never false-positive, and "X without Y" is expressed on the call itself. Needs the optional@ast-grep/napiengine — without it the sensor is unrunnable (warn, never block). - shell/test — a command routing your own test as the oracle (the behaviour bridge, below).
- checklist — a required verification, not a pattern: when a change touches the scoped paths,
the gate prints the step to perform ("run the GPU browser check of the PDF viewer — headless CI
cannot see this failure"). At
blockseverity the commit message must carryHivelore-Checked: <memory-id>— the author's explicit statement that it was done. This is the guard for knowledge no code pattern can express: a caveat that only shows up on a device, a rollout step, a manual migration check.
Sensors turn a documented lesson into a repeatable feedback signal, independent of embeddings or
model judgment. Autogenerated sensors start as warn; humans promote vetted ones to block. The
doctrine is also enforced against inversion: a block pattern that matches the lesson's own
recommended fix (its Instead, use: snippet) is refused (fires-on-correct) — it would block the
correct code and never the mistake.
hivelore sensors list
hivelore sensors check # scans git diff --cached
hivelore sensors propose <lesson> --kind checklist --paths 'config/security/**' \
--message 'Run the GPU browser check of the PDF viewer' # a required verification
hivelore sensors propose <lesson> --from-fix <pre-fix-ref> # MINE the pattern from the fix diff
hivelore sensors promote <id> --yes # promote a vetted sensor to block
hivelore sensors export --format grep
Cheaper arming (--from-fix). Authoring a discriminating regex is the main cost between a
documented lesson and an enforced one — so let the fix write it. sensors propose --from-fix <pre-fix-ref> mines the pattern from the fix diff: the line the fix removed is the mistake
(pattern), the line it added is the correct marker (absent). You confirm a candidate instead of
authoring a regex — and it still passes the full validation (silent-on-current, fires-on-bad,
not-inverted) before it can block.
Install
npm install -g @hivelore/cli
# Optional: local semantic search (downloads ~110MB model once)
npm install -g @hivelore/embeddings
Verify the complete integration
Run hivelore agent check --exercise --json to exercise MCP briefing, targeted hook context,
and a validated sensor against good and bad code in an isolated temporary repository. It also
reports first-edit latency and ten-sample median/p95 timings for reads, repeated edits and shell calls. This is a synthetic installation proof, not a productivity benchmark.
New projects default to local task completion and draft capture; existing policies remain intact.
See the audit fixes and upgrade guide.
After upgrading, run hivelore agent setup --no-global to repair managed legacy Git hooks,
then restart your AI client. A successful fresh handshake does not upgrade a running conversation.
hivelore agent check --json lists known live MCP versions and remaining migration work.
Legacy CI workflows receive a .candidate replacement for review; custom hook commands are preserved.
Complete policies and traceable outcomes
Short applicable policies are injected before edits. When a policy cannot fit, the hook emits
an explicit instruction not delivered pointer instead of silently dropping its exceptions.
Partial briefings do not count as complete consultation. Use mem_get with the hook’s
session_id, or hivelore memory get <id> --session-id <session>, to read and credit the whole policy.
mem_feedback is available in the default MCP profile. Report applied/rejected, or
corrected/verified with a commit, test-report or incident reference. An optional catch_id
links feedback to an interception listed by hivelore stats outcomes. Linked verification
requires a preceding correction. Reports distinguish declared outcomes from a subsequent
observed silent sensor check; they do not authenticate references or infer bugs avoided/time saved.
Benchmark reports require at least 10 distinct tasks × 3 repetitions, comparable model,
checkout, budget and prompt metadata, independent evaluation attestations, and matching
protocol.json/run.json manifests to qualify as decision-ready. Repeating one task or
removing an arm cannot satisfy a prepared protocol. This grade describes evidence completeness,
not proven superiority or authenticated execution.
The 60-second proof — watch a lesson stop a commit
This is the exact flow shown in the demo above.
Memory tools remember; Hivelore's difference is that a remembered lesson can refuse the commit that repeats it. Try it on any git repo:
hivelore init -y # .ai/ layer + git hooks + bridges for the agents you actually use (detected)
# 1. Capture a failed approach (agents do this via the mem_tried MCP tool)
hivelore memory tried \
--what "importing moment.js" \
--why-failed "bundle bloat — team standard is date-fns" \
--instead "date-fns" --paths src/
# → prints the new memory id, e.g. 2026-07-02-attempt-importing-momentjs
# 2. Give the lesson teeth: a validated, deterministic guardrail
hivelore sensors propose 2026-07-02-attempt-importing-momentjs \
--pattern "from ['\"]moment['\"]" --severity block
# Hivelore validates it first: silent on your current code, fires on the mistake.
# 3. Reintroduce the mistake — the commit is refused
echo "import moment from 'moment';" >> src/dates.ts
git add . && git commit -m "add date helper"
# 🛡️ A documented lesson refused this commit — about the change you just made:
# • 2026-07-02-attempt-importing-momentjs (src/dates.ts) use date-fns
# import moment from 'moment';
Same diff, same answer, on every machine and in CI — the gate is deterministic by design.
Everything lives as reviewable Markdown in .ai/, versioned with your code. rm -rf .ai undoes it all.
Quick start
1. Initialize your project
cd my-project
hivelore init # Creates .ai/, bridge files, MCP config, hooks, CI template
hivelore init now also runs agent setup. It writes project-level MCP configs, records the best available mode, and asks before changing user-level client configs. In non-interactive shells it skips global config and tells you how to finish setup.
2. Connect your AI client
Claude Code (~/.claude.json):
{
"mcpServers": {
"hivelore": {
"command": "hivelore",
"args": ["mcp", "--stdio", "--root", "/absolute/path/to/my-project"]
}
}
}
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"hivelore": {
"command": "hivelore",
"args": ["mcp", "--stdio", "--root", "/absolute/path/to/my-project"]
}
}
}
VS Code:
code --add-mcp '{"name":"hivelore","command":"hivelore","args":["mcp","--stdio","--root","/path/to/project"]}'
3. Bootstrap your project context
In your AI client, invoke the bootstrap_project MCP prompt. The agent analyzes your codebase and writes .ai/project-context.md automatically.
4. Start work through Hivelore
Every session starts with one call:
get_briefing(task: "add a Stripe payment integration", files: ["src/payments/PaymentService.ts"])
The agent gets project context + relevant module contexts + ranked context breadcrumbs in one shot — no more grepping to rediscover what the team already knows.
For CLI agents without native MCP, wrap them:
hivelore run -- claude --dangerously-skip-permissions -p "$(cat task.md)"
Check the selected mode any time:
hivelore agent status
hivelore agent check # initialize the server and discover its tools
hivelore agent setup # re-run setup later
hivelore agent setup --yes # approve user-level MCP config without prompting
Setup migrates obsolete haive MCP commands, including Codex user configuration, and preserves
other servers and JSONC comments. It supports Claude Code, Cursor, VS Code, Windsurf, Codex,
and detected Gemini CLI/Roo Code configurations. Restart the client after setup, then call
get_briefing in a new session: a successful server check does not prove that an existing
session has access. See MCP connection troubleshooting.
5. Gate commits and pull requests
hivelore enforce install # Installs Git hooks + CI enforcement template
hivelore enforce status # Current enforcement posture
hivelore enforce check --stage pre-commit # Scan the staged change
hivelore enforce ci # CI entrypoint (exits 1 on violations)
One knob decides what refuses: enforcement.posture.
| posture | what refuses |
|---|---|
advisory |
nothing — everything is reported. For adopting Hivelore on a repo mid-flight |
balanced (default) |
deterministic, code-bound findings only: block sensors, anchored anti-patterns, stale anchors on files you touched, artifact hygiene |
strict |
the above, plus the process gates (briefing, recap, decision coverage, bootstrap) at the sharing points — pre-push and CI |
mode, processGate and humanCommits are the individual switches a posture sets; pin one
explicitly to override the posture for that switch alone. hivelore doctor always prints the
effective posture and any overrides, so what the gate will do is never a guess.
One rule is not a posture knob and is not negotiable: process gates never refuse a local commit,
at any posture. Blocking them on every pre-commit is what trains the --no-verify reflex on cold
repos. A passing commit-time gate prints one line; --verbose shows every check. If a git hook was
left broken by an old install, hivelore doctor --fix regenerates it.
When something does refuse, it names the line.
🛡️ A documented lesson refused this commit — about the change you just made:
• 2026-07-02-attempt-importing-momentjs (src/dates.ts) use date-fns, not moment
import moment from 'moment';
One lesson, one line, with the file and the offending source. No composite score of any kind: the gate reports what refused the change and what to do about it, and stays silent otherwise.
Hivelore MCP questions
How do I add Hivelore MCP to Claude Code?
Run claude mcp add hivelore -- npx -y @hivelore/mcp in your terminal. Add --scope user to make it available in every project.
How do I add Hivelore MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does Hivelore MCP provide?
It exposes 16 tools, including get_briefing, mem_get, mem_save, mem_update, mem_tried.
What is Hivelore's primary function?
It acts as an enforcement layer for AI coding agents, providing them with team-specific knowledge and blocking commits that reintroduce previously documented mistakes.
How does Hivelore provide context to AI agents?
Agents can use the get_briefing MCP call to receive small default context along with deeper breadcrumbs ranked by task relevance.
Does Hivelore replace existing testing tools like unit tests or linters?
No, it is designed to complement them by making repo-specific knowledge available and enforceable that those tools cannot infer.
Can Hivelore run custom test commands to validate changes?
Yes, through command sensors, Hivelore can execute your existing test or invariant scripts when a diff touches specific paths.