Skip to main content
MCP (Model Context Protocol) is an open standard that lets an AI coding agent call tools on an external service. Earnie runs an MCP server, so a coding agent such as Claude Code, Cursor, VS Code, or Codex can ask Earnie questions and check its own work while it writes code. With Earnie connected, an agent can:
  • read the policies in force for your project, and follow them as it works
  • check the code it has just written against those policies, before showing it to you
  • look up a project’s findings, posture, and merge gate
  • export a project’s bill of materials
  • record a triage decision you’ve asked it to make, if you allow it
This moves your policies to the earliest point in a change: while the code is being written, before it’s committed or reaches a pull request.

How It Fits Together

Three parts are involved: The client sends each tool call to the MCP server over HTTPS, with your API key. You don’t call the tools yourself. You ask the agent something in plain language, such as “is this project blocked?”, and the agent decides which Earnie tool to call. Using Earnie Through MCP lists every tool.

The Connection and the Repository Setup

Connecting a client to the MCP server gives the agent its tools. If you set up with the Earnie CLI, you also get two things written into your repository:
  • A managed policy block — your project’s policies, written as plain rules into the file your agent reads for instructions, such as CLAUDE.md or AGENTS.md.
  • Review hooks — for Claude Code, Cursor, and Codex, an automatic review of the agent’s changed files at the end of each turn. Each review is a Self-check.
Connecting an AI Client explains both routes.

Supported Clients

Before You Start

You need:
  • An Earnie deployment your machine can reach. Each deployment has its own address, and its MCP server is at that address followed by /mcp/v1.
  • A project that has been scanned, so there’s something for the agent to ask about. See Your First Scan.
  • Policies attached to that project, if you want the agent to follow rules and review its code. See Setting Policies.
  • An API key created with the Coding agent (MCP) preset. Creating one needs the Admin or Operator role. See Creating a Key.
  • A supported AI client, installed on your machine.
  • The Earnie CLI (optional, but recommended for working in a repository). See Installing.
What the agent can do depends on the key. The Coding agent (MCP) preset lets the agent read projects, policies, findings, and scans, and submit scans. It can’t change triage decisions unless you turn on Allow agents to triage findings when you create the key.

What’s Next

Start by connecting your AI client to Earnie.