Install
$ agentstack add mcp-sainitish1609-mcp-guard β scanned Β· β verified, works with Claude Code, Cursor, and more.
Security review
β PassedNo issues found. Passed automated security review. Β· v0.1.0 How review works β
- β Prompt-injection patterns
- β Secret / credential exfiltration
- β Dangerous shell & filesystem operations
- β Untrusted network calls
- β Known-malicious package signatures
What it can access
- β Network access No
- β Filesystem access No
- β Shell / process execution No
- β Environment & secrets Used
- β Dynamic code execution No
From automated source analysis of v0.1.0. βUsedβ means the capability is present in the source β more access means more to trust, not that itβs unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work βAbout
mcp-guard π‘οΈ
[](https://golang.org/) [](https://opensource.org/licenses/MIT)
> The local privacy firewall, secret sanitizer, and token compressor for AI coding agents.
A security guardrail proxy for Model Context Protocol (MCP) servers.
mcp-guard is an ultra-fast, zero-dependency Go binary that sits transparently in the stdio JSON-RPC path between your editor (Claude Code, Cursor, VS Code) and any Model Context Protocol (MCP) server.
It acts as a local security proxyβensuring your sensitive API keys, database credentials, and protected paths (~/.ssh, .env, .git) are never leaked to cloud LLMs or mutated by autonomous tool execution.
π‘ Why mcp-guard?
When AI agents run tools like @modelcontextprotocol/server-filesystem or postgres-mcp, they read raw files directly from your disk. If a file contains AWS keys, JWTs, or database passwords, those credentials are sent directly to cloud AI APIs in plain text.
mcp-guard runs locally on your machine to solve this without breaking agent execution:
- π Zero-Trust Input/Output Inspection: Intercepts both requests and responses on
stdin/stdout. - β‘ Zero-Dependency Go Binary: Negligible performance overhead ( Note: Compression automatically skips read-for-edit tools (
read_file,get_file_contents) to preserve exact diff boundaries for safe file editing.
π Installation
# Install via Go
go install github.com/sainitish1609/mcp-guard/cmd/mcp-guard@latest
# Or build from source
git clone https://github.com/sainitish1609/mcp-guard.git
cd mcp-guard
go build -o mcp-guard ./cmd/mcp-guard
---
## βοΈ Configuration & Integration
### Claude Code
Wrap any standard MCP server command using `mcp-guard --`:
```bash
claude mcp add postgres -- mcp-guard --redact-secrets --max-tokens 4000 -- npx -y @modelcontextprotocol/server-postgres
Cursor / VS Code (.vscode/mcp.json)
{
"mcpServers": {
"filesystem": {
"command": "mcp-guard",
"args": [
"--redact-secrets",
"--block-shell",
"--",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/projects"
]
}
}
}
π Flag Reference
| Flag | Default | Description | | --- | --- | --- | | --redact-secrets | true | Mask API keys, tokens, and database passwords in tool responses | | --block-shell | true | Block execution of shell scripts in exec tools | | --annotate-tools | true | Append policy notices to tools/list so agents know boundaries upfront | | --compress | false | Strip comments and blank lines from context (safe tools only) | | --max-tokens N | 0 | Approximate token budget cap per result block (0 = unlimited) | | --protect-paths | (defaults) | Custom comma-separated protected paths (overrides defaults) | | --log-level | info | Set logging verbosity (silent, error, info, debug on stderr) | | --dry-run | false | Log security events to stderr without mutating stdin/stdout |
π§ͺ Testing & Verification
# Run unit and integration tests
go test ./... -v
# Run static analysis
go vet ./...
π License
Distributed under the MIT License. See LICENSE for details.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source β we do not rehost the code.
- Author: sainitish1609
- Source: sainitish1609/mcp-guard
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.