The project’s rules, loaded before the first line of code.
For coding agents, and the people who connect them. Earnie’s MCP server puts the project’s policies in the agent’s instructions before it writes, and reviews its changes at the end of every turn.
- Claude Code

- Cursor
- Codex

- VS Code
One session, start to finish
Here is what Earnie does during a coding agent’s session, from the moment it opens to the moment someone asks for the record.
-
The session opens with the rules already loaded
Set up with the Earnie CLI, the project’s policies sit in the agent’s instructions file as plain rules, one sentence each:
CLAUDE.md,AGENTS.md,.cursor/rules/earnie.mdcor.github/copilot-instructions.md. A session-start hook refreshes them when the policies change.Without the CLI, the agent calls
earnie_policy_contextand gets the same rules.# CLAUDE.md <!-- earnie:policies:start --> Don’t add dependencies licensed under AGPL-3.0. Don’t introduce RSA keys shorter than 3072 bits. Don’t add AI models without a declared licence. <!-- earnie:policies:end -->
-
It writes to those rules
The agent knows what’s forbidden before it picks a package or a cipher, so most problems never get written in the first place.
add PDF export to the invoices page Adding pdf-forge 2.3.0 to package.json Writing src/invoices/export.ts -
The turn ends with a review
In Claude Code, Cursor and Codex, a review hook sends the changed files to Earnie at the end of each turn, without the agent having to ask. The agent gets a gate, each violation worst first with a suggested fix, and a list of the scanners that ran.
earnie_review_code 2 files gate block violation pdf-forge 2.3.0 is AGPL-3.0 fix use an MIT- or Apache-2.0-licensed alternative scanners oss, crypto
-
It fixes the code and checks again
Each review is a Self-check of only the files it was sent. It creates no findings and leaves the project’s posture alone, and its result stays linked in the web app for 30 days.
A pass means nothing sent broke a policy. The pull request check still decides what merges.
earnie_review_code 2 files gate pass scanners oss, crypto
-
Later, someone asks where things stand
Questions come in plain language and the agent picks the tool.
earnie_project_posturereports the gate, what needs attention and the key counts.earnie_search_findingsandearnie_get_findinggo into the detail.is invoices-service blocked? earnie_project_posture gate warn needs notice file missing
-
And then for the record
earnie_export_bomreturns a CycloneDX 1.7 SBOM, CBOM or AIBOM from a snapshot Earnie has already made.earnie_exportmakes notices, reports and compliance packages, each one saved to the project’s Reports page under the key’s name.export the CBOM for invoices-service earnie_export_bom include: crypto format CycloneDX 1.7 stale false
An example session. The project, package and policies are made up; the tool names, gates and files are Earnie’s.
The key decides what a coding agent can do
The agent authenticates with an API key, created by an Admin or Operator with the Coding agent (MCP) preset. It sees only the tools the key’s permissions allow, and only the projects the key reaches.
Triage stays off unless someone turns on Allow agents to triage findings when they create the key. Every decision the agent records is logged under the key’s name.
| Permission | Tools it unlocks |
|---|---|
| Any valid key | platform_health_ping |
projects:read | earnie_list_projects |
policies:read | earnie_policy_context |
findings:read | earnie_search_findingsearnie_get_findingearnie_list_vulnerabilities |
scans:read | earnie_project_postureearnie_export_bomearnie_list_exports |
scans:write | earnie_review_codeearnie_export |
findings:write | earnie_triage_finding, only with triage turned on |
vulnerabilities:decide | earnie_decide_vulnerability |
Which coding agents can connect
The MCP server lives at your Earnie address followed by /mcp/v1. Every Earnie runs one, with nothing to switch on.
| Client | What the Earnie CLI sets up |
|---|---|
| Policy block, review hooks and session-start hook | |
| Policy block, review hooks and session-start hook | |
Policy block, review hooks and session-start hook, once you approve the hooks with /hooks | |
| VS Code | Policy block. Hooks follow when VS Code’s hook support leaves preview. |
| Claude.ai, ChatGPT | Limited. They connect from the vendor’s cloud and expect OAuth, which Earnie doesn’t offer yet. |
Set it up
- Earnie MCP overview ↗What MCP is, how the connection works, and what you need before setup.
- Connecting a client ↗Setup for Claude Code, Cursor, VS Code and Codex, with
earnie mcp setupor an install snippet. - Using Earnie through MCP ↗Every tool, what it returns, and the key permission each one needs.
- Troubleshooting ↗What to do when the connection fails, starting with
earnie mcp doctor.
# Earnie for coding agents
Earnie's MCP server gives you the project's policies as plain rules
before you write, and reviews your changes before anyone sees them.
## Connection
- Endpoint: your Earnie address + /mcp/v1
- Auth: Authorization: Bearer <key> on every request
- Key: created with the Coding agent (MCP) preset
- Clients: Claude Code, Cursor, Codex, VS Code
## At the start of a session
If the Earnie CLI set up your repository, the rules are already in
your instructions file, between <!-- earnie:policies:start --> and
<!-- earnie:policies:end -->. Otherwise call earnie_policy_context.
## After you write or edit code
If you added or changed a dependency, copied code, used cryptography,
or called an AI SDK, model or agent framework, send the changed files
or a diff to earnie_review_code. (With review hooks, this happens at
the end of each turn.)
Gates: pass, warn, block, require, error, none.
- require: held until a Policy Approval is granted. Not mergeable.
- error: a policy applies but lacks the evidence it needs.
- none: no policy applied. Not a pass.
A review is a Self-check of only what you sent. It creates no findings
and doesn't change posture. The pull request check decides what merges.
## When asked where things stand
- earnie_project_posture gate, what needs attention, key counts
- earnie_search_findings OSS, dependencies, crypto, AI provenance
- earnie_get_finding one finding in full, with policy verdicts
## When asked for the record
- earnie_list_exports check first
- earnie_export_bom CycloneDX 1.7 SBOM, CBOM or AIBOM
- earnie_export notice, report or compliance package;
each call is a permanent record
## Limits
You see only the tools your key allows. Triage needs
"Allow agents to triage findings" on the key. Decisions are logged
under the key's name.
## Docs
- Overview: https://docs.scanoss.com/en/latest/earnie/mcp/overview
- Connecting a client: https://docs.scanoss.com/en/latest/earnie/mcp/connecting-a-client
- Tools: https://docs.scanoss.com/en/latest/earnie/mcp/tools
- Troubleshooting: https://docs.scanoss.com/en/latest/earnie/mcp/troubleshooting
