# mcp-guard

> mcp-guard is a free MCP server for security. Security scanner for MCP servers: poisoning, shadowing, permissions, secrets, transport. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, API
- **Repository:** https://github.com/diegoperezg7/mcp-guard-scan
- **MCP Registry name:** io.github.diegoperezg7/mcp-guard-scan
- **Categories:** [security](https://ai-powered.com/categories/security), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

It connects to a target the way an MCP client would, inventories the tools, prompts and resources it exposes, and checks them against deterministic rules, with no model needed for the core scan. The README describes 24 rules in six families, each with an ID, severity, bad and good examples, remediation and CWE or OWASP references. One rule catches invisible Unicode tag characters and decodes the hidden text.

The same package runs as a command-line tool, a GitHub Action that can fail a build, and an MCP server so an agent can scan something before you install it. Inputs can be a stdio command, a Streamable HTTP URL, or an exported tools/list JSON file, and scanning several at once turns on cross-server shadowing checks. Output formats include SARIF and a self-contained HTML report.

By default the MCP server does not start commands or reach private addresses; setting MCP_GUARD_ALLOW_STDIO adds scan_stdio_server and MCP_GUARD_ALLOW_PRIVATE_NETWORK allows local targets.

## Features

- **24 documented rules:** Tool poisoning, shadowing, excessive permissions, secrets and transport weaknesses.
- **Hidden text detection:** Decodes invisible Unicode tag characters in tool metadata.
- **CI integration:** GitHub Action and exit codes that fail a pipeline.
- **SARIF and HTML output:** Machine-readable results and a single-file report.
- **Cross-server checks:** Spot the same tool name exposed by more than one server.
- **Opt-in risky modes:** Stdio launch and private-network scans are off until enabled.

## Good for

- Vet an MCP server before connecting an agent
- Block risky MCP servers in CI
- Audit an exported tools/list result
- Find leaked credentials in tool metadata

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mcp-guard-scan -- npx -y mcp-guard-scan
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp-guard-scan -- npx -y mcp-guard-scan
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp-guard-scan]
command = "npx"
args = ["-y", "mcp-guard-scan"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user mcp-guard-scan npx -- -y mcp-guard-scan

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "mcp-guard-scan": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-guard-scan"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `scan_server`: Scan a remote MCP server.
- `scan_stdio_server`: Scan a local stdio server; only available when MCP_GUARD_ALLOW_STDIO=1.

## FAQ

### Does mcp-guard need Node?

Yes, Node 22 or later for the CLI.

### Will mcp-guard run commands I give it?

Only if MCP_GUARD_ALLOW_STDIO is set to 1, which adds scan_stdio_server.

### Why is the npm package called mcp-guard-scan?

The README says the name mcp-guard on npm belongs to an unrelated project.

### What formats can mcp-guard report?

Markdown, SARIF and a standalone HTML report, among others.

### Is mcp-guard free?

Yes. mcp-guard is free to use.

### How do I add mcp-guard to Claude Code?

Run this command in your terminal: claude mcp add mcp-guard-scan -- npx -y mcp-guard-scan

### What are the best alternatives to mcp-guard?

The closest alternatives to mcp-guard are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [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): 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.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

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