# MCP Security Gateway Hardening

> Turn any stdio MCP server into a zero-trust, policy-enforced endpoint for Claude Code, Cursor, and Copilot without relying on system prompts as a firewall.

MCP Security Gateway Hardening is a free AI agent skill on Agensi by Alexey Zhuykov, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Alexey Zhuykov](https://www.agensi.io/creators/alexey-zhuykov)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mcp-security-gateway-hardening
- Tags: mcp, security, zero-trust, devsecops, ai-agents, audit

## About this skill

Harden any local or third-party Model Context Protocol (MCP) stdio server with deterministic zero-trust controls instead of fragile system-prompt guardrails. What this skill gives your AI agent:
- 4-layer security audit workflow stopping Tool Poisoning, Rug-Pull schema mutations (SHA-256 pinning), Path Traversal, covert exfiltration arguments, and Indirect Prompt Injection.
- Standalone zero-dependency Python 3.11+ validator (`scripts/validate_mcp_policy.py`) that audits declarative `policy.json` files and verifies SHA-256 hash-chained `audit.jsonl` logs offline.
- Drop-in wrapper snippets for Claude Desktop, Cursor, and hardened non-root Docker Compose (`UID 10001`, `read_only`, `cap_drop: [ALL]`, `network_mode: none`). Official open-source MIT gateway repository: Author & B2B security consulting:

## Requires

- Security Gateway MCP
- Python

## Known limitations

Supports only stdio transport for MCP. Requires Python 3.11+ with no third-party dependencies. Does not support SSE or WebSocket MCP servers.

## 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 Security Gateway Hardening 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 security gateway differ from just adding 'safety instructions' to my system prompt?

While system prompts rely on LLM 'obedience,' this skill adds a physical security layer at the transport level. It prevents unauthorized tool execution and path traversal even if an agent is successfully targeted by a prompt injection attack.

### Which AI agents and MCP servers are compatible with this hardening skill?

This gateway works with any AI agent that supports the Model Context Protocol (MCP) over stdio, including Claude Desktop, Cursor, and GitHub Copilot. It is designed to wrap any standard MCP server regardless of the underlying language.

### What exactly is included in the purchase of this skill?

You will receive a suite of Python-based validation scripts, the security gateway proxy logic, and a set of declarative JSON policy templates. These components allow you to audit, wrap, and enforce zero-trust rules on your existing MCP servers.

### How technical is the installation process for a new MCP server?

The setup involves running a classification script on your target MCP server to generate a policy.json, which you then customize to your security needs. Once validated, you simply update your agent's config file to point to the gateway wrapper instead of the raw server command.

### Can this skill prevent an agent from accessing sensitive files outside of my project directory?

The path jail enforcement uses regex patterns and root directory constraints to ensure file-access tools cannot escape their designated folders. If an agent attempts to access a path outside the 'jail,' the gateway intercepts and blocks the request before it ever reaches the server.

### Does the gateway protect against silent updates to third-party MCP servers?

Yes, the gateway includes SHA-256 tool pinning, which locks tool schemas to specific hashes. If an MCP server update silently changes its capabilities or parameters, the gateway will detect the mismatch and block execution to prevent 'rug-pull' vulnerabilities.

---

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.
