# mcp guard

> Guides your agent to install and run mcp-guard, an open-source proxy that redacts PII and secrets from MCP tool results. Includes audit logs, read-only database scans, and clear notes on privacy limits.

mcp guard is a free AI agent skill on Agensi by Kirtikumar Alone, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Kirtikumar Alone](https://www.agensi.io/creators/kirtikumar-alone)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mcp-guard
- Tags: llm-ops, pii-masking, mcp, security-proxy, data-loss-prevention, typescript

## About this skill

### What it does

This skill teaches your AI agent to install, run and use **mcp-guard**, an open-source data-loss-prevention (DLP) proxy for MCP traffic. mcp-guard sits between your agent and an MCP server, scans tool calls in both directions, and replaces sensitive values with stable placeholders such as `[REDACTED_SSN_1]` before the model sees them.

Instead of reading the README and explaining it to your agent, you ask in plain language and the agent already knows the steps.

### What your agent will be able to do

- Clone, build and start mcp-guard (Node 20+)
- Point it at your own MCP server and route tool calls through it
- Verify masking with a test scan before you rely on it
- Scan pasted text or data from a read-only PostgreSQL database, a MongoDB collection or an HTTP API
- Read the audit log and summary (what was redacted, by type, direction and origin)
- Troubleshoot common problems (upstream unreachable, empty audit log, rate limits)

### What it detects

SSNs, card numbers, emails, phone numbers, IP addresses, IBANs, API keys and CVVs. Placeholders are stable, so the same value always gets the same placeholder and the agent can still reason about which records match.

### Honest limits

This skill tells your agent to explain these up front:

- **The optional AI pass sends text to OpenRouter** to catch names and addresses. For sensitive data, run in regex-only mode, where nothing leaves your machine.
- **Regex-only mode does not catch names or free-form addresses.**
- **Matching is shape-only**, so long digit strings (such as order numbers) may be redacted as card numbers. It errs toward over-redacting.
- **No per-type block/allow policy yet.** Everything detected is redacted.
- Early-stage project. Not audited, and not a sole control for regulated data (HIPAA, PCI, GDPR).

### Tested

Checked on a local run (Node 22, regex-only mode, with a mock upstream MCP server): scanning, inbound and outbound redaction, the audit log, and the SQL and URL safety filters. Not tested: the OpenRouter AI pass, live PostgreSQL/MongoDB connectors, and the dashboard.

### Requirements

Node.js 20 or newer, git, and network access to clone the repo and install packages. An OpenRouter API key is optional or any local model or trusteed AI API key provider .  .

### Source

mcp-guard is MIT licensed: https://github.com/kirtikumarAlone/mcp-guard

## Requires

- Git
- Node.js
- AI API key

## Known limitations

Requires Node 20+. 16-digit numbers trigger false positives for credit cards. Regex-only mode misses unstructured names/addresses. Not for regulated HIPAA/PCI data.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the mcp guard skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this approach differ from just telling my AI agent not to look at sensitive data?

Unlike system prompts which can be ignored or bypassed by LLMs, mcp-guard acts as a hard programmatic firewall that physically removes sensitive data from the traffic stream before it ever reaches the model's context window.

### Which AI agents or frameworks are compatible with mcp-guard?

The skill works with any AI agent or framework that uses the Model Context Protocol (MCP). Simply point your agent's tool calls to the mcp-guard proxy endpoint instead of the direct tool server.

### Can I choose between different levels of PII detection sensitivity?

Yes, you can toggle between a high-speed local regex mode for common patterns (like SSNs and API keys) and an LLM-assisted mode for identifying more complex PII like names or physical addresses.

### What exactly is included in this skill package?

The purchase includes the full Node.js source code, a pre-configured Express server for proxying, setup scripts for local installation, and documentation for connecting to PostgreSQL, MongoDB, or HTTP sources.

### Will masking the data break my AI's ability to compare or identify duplicate records?

The system uses stable placeholders, meaning the same sensitive value will receive the same label (e.g., [REDACTED_EMAIL_1]) throughout a session. This allows the AI to perform tasks like deduplication or pattern analysis without ever seeing the raw data.

### Does any of my sensitive data leave my local environment during the masking process?

In regex-only mode, all processing is done locally on your machine or server; if you enable LLM-based detection for higher accuracy, data is sent to OpenRouter for classification before being returned to your agent.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
