explaingit

sainitish1609/mcp-guard

Analysis updated 2026-05-18

2GoAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A local Go proxy that sits between AI coding tools and MCP servers, redacting secrets and blocking access to sensitive files.

Mindmap

mindmap
  root((mcp-guard))
    What it does
      Sits between editor and MCP
      Redacts secrets
      Blocks protected paths
    Features
      Credential redaction
      Write protection
      Token compression
    Tech stack
      Go binary
      Zero dependencies
    Use cases
      Protect API keys
      Guard SSH and env files
      Save context tokens
    Audience
      AI tool developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Prevent an AI coding agent from accidentally leaking an AWS key or database password to a cloud model

USE CASE 2

Block AI tools from reading or modifying protected paths like SSH keys or .env files

USE CASE 3

Compress tool output to save context window space in long agent sessions

What is it built with?

Go

How does it compare?

sainitish1609/mcp-guardanomalroil/1keyanshuman852/dasan-router-cli
Stars222
LanguageGoGoGo
Last pushed2019-05-17
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Single Go binary, no external dependencies to install.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

mcp-guard is a small, fast local security tool written in Go that sits between an AI coding assistant, such as Claude Code or Cursor, and any Model Context Protocol server it talks to. Model Context Protocol, or MCP, is a standard way for AI tools to connect to external data sources and actions. mcp-guard runs as a proxy in that connection, inspecting both what goes out to the AI and what comes back, so it can catch problems before they cause harm. The main concern it addresses is that when an AI agent reads files from your computer through an MCP server, such as a filesystem or database server, sensitive information like API keys, passwords, or private paths can end up being sent to a cloud based AI provider in plain text. mcp-guard scans outgoing tool results for over ten common secret formats, including cloud provider keys, database connection strings, and private keys, and replaces them with a redacted marker before they reach the AI. It also blocks the AI from reading or writing to protected paths such as SSH keys, cloud credentials, and git internals, even if the AI tries clever path tricks to get around the restriction. A separate optional feature strips comments and extra whitespace from text before it is sent, to save space in the AI's context window without changing the underlying files. The tool installs as a single Go binary with no other dependencies, so it starts quickly and adds very little delay. It is configured with command line flags that control which protections are turned on, what counts as a protected path, and how much detail gets logged. It is licensed under MIT, so it can be freely used, modified, and redistributed.

Copy-paste prompts

Prompt 1
Show me how to wrap my postgres MCP server with mcp-guard for secret redaction
Prompt 2
Explain what --block-shell does and why I would enable it
Prompt 3
Help me configure mcp-guard for Cursor using the vscode mcp.json format
Prompt 4
What secret formats does mcp-guard detect and redact by default

Frequently asked questions

What is mcp-guard?

A local Go proxy that sits between AI coding tools and MCP servers, redacting secrets and blocking access to sensitive files.

What language is mcp-guard written in?

Mainly Go. The stack also includes Go.

What license does mcp-guard use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is mcp-guard to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is mcp-guard for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.