# AdversaryGate

> AdversaryGate is an open-source MCP server for developer tools. Fail-closed merge gate that tells an AI coding agent MERGE, BLOCK or INCONCLUSIVE. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://sanflow10.github.io/adversary-gate/
- **Repository:** https://github.com/sanflow10/adversary-gate
- **MCP Registry name:** io.github.Sanflow10/adversary-gate
- **Categories:** developer tools
- **Listing updated:** 2026-11-15

## About

Most before-and-after checks treat a test that never ran as no change. This gate treats it as missing evidence: import errors, wrong test IDs, timeouts and runs killed by limits count as unverified, and the answer becomes INCONCLUSIVE rather than a pass. Exit codes are 0 for merge, 1 for block and 2 for inconclusive.

It runs the named tests, or those that coverage says touched the changed lines, three times each on the baseline and on the patch. It computes diff coverage from your unified diff and a coverage.py JSON report, recording both by SHA-256, then mutation-tests only the lines the patch wrote. The suite-strength floor uses the lower bound of an 80% confidence interval, so a very small change can be too small to judge.

No language model runs inside the verifier. It measures Python and pytest projects today; other stacks get INCONCLUSIVE. Operators can pin the baseline git ref so the agent cannot choose it.

## Features

- **Three-way decision:** Answers MERGE, BLOCK or INCONCLUSIVE with a reason and next steps.
- **Baseline versus patch runs:** Runs the same tests on both sides, three times each.
- **Diff coverage from artefacts:** Computes coverage from a diff and a coverage.py report, with inputs hashed.
- **Mutation testing on changed lines:** Breaks only the lines the patch wrote to gauge test strength.
- **Pinned baseline:** An environment variable can force a fixed baseline ref the agent cannot pick.
- **CLI, Action and MCP:** Available as a command line, a GitHub Action and an MCP server.

## Good for

- Stop an agent from reporting done on a patch that breaks a passing test
- Catch patches that rewrite their own tests to agree with a bug
- Gate agent-authored pull requests in CI
- Require measured coverage before accepting an automated fix

## Install

### Claude Code (Terminal)

```sh
claude mcp add adversary-gate -- uvx adversary-gate-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "adversary-gate": {
      "command": "uvx",
      "args": [
        "adversary-gate-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "adversary-gate": {
      "command": "uvx",
      "args": [
        "adversary-gate-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "adversary-gate": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "adversary-gate-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "adversary-gate": {
      "command": "uvx",
      "args": [
        "adversary-gate-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "adversary-gate": {
      "command": "uvx",
      "args": [
        "adversary-gate-mcp"
      ]
    }
  }
}
```

## FAQ

### Which languages does it measure?

Python and pytest projects. Other languages return INCONCLUSIVE, never MERGE.

### What licence applies?

AGPL-3.0 for current releases; the 2.x line up to 2.14.2 was MIT.

### Does an LLM judge the patch?

No. The rules are plain code and are the same for any agent.

### Why was my one-line fix inconclusive?

The README explains that the floor needs at least 5 killed mutants, so a very small change can be too small to measure.

### Is AdversaryGate free?

Yes. AdversaryGate is open source, so you can use and self-host it for free.

### How do I add AdversaryGate to Claude Code?

Run this command in your terminal: claude mcp add adversary-gate -- uvx adversary-gate-mcp

### What are the best alternatives to AdversaryGate?

The closest alternatives to AdversaryGate are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/adversarygate
