# DiffGate MCP server

> Provides a deterministic guardrail for coding agents by performing diff-scoped security and maintainability checks before code is written to disk.

- Repository: https://github.com/srbsa/diffgate
- Page: https://hostedmcp.org/servers/srbsa/diffgate
- Transport: stdio
- Stars: 5
- License: Apache-2.0
- Latest version: 0.8.0

## Install

### Claude Code

```sh
claude mcp add diffgate -- npx -y diffgate-review
```

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

```json
{
  "mcpServers": {
    "diffgate": {
      "command": "npx",
      "args": [
        "-y",
        "diffgate-review"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "diffgate": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "diffgate-review"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"diffgate","type":"stdio","command":"npx","args":["-y","diffgate-review"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "diffgate": {
      "command": "npx",
      "args": [
        "-y",
        "diffgate-review"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add diffgate -- npx -y diffgate-review
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.diffgate]
command = "npx"
args = ["-y", "diffgate-review"]
```

### Gemini CLI

```sh
gemini mcp add -s user diffgate npx -- -y diffgate-review
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "diffgate": {
      "command": "npx",
      "args": [
        "-y",
        "diffgate-review"
      ]
    }
  }
}
```

## FAQ

### Does DiffGate use LLM tokens for its checks?

No, DiffGate provides structured findings using a deterministic engine that requires zero LLM tokens.

### How does DiffGate handle false positives and noise?

It uses diff-scoped findings to only report on changed lines and employs a tiered triage system (Green, Yellow, Orange) to decide what requires attention.

### Can DiffGate run my existing tests?

Yes, on high-impact (orange) changes, DiffGate can run your specified test command and show the output.
