MCP clients and tools
Add the zn-gate MCP server to Claude Code, Codex, Cursor, OpenCode and other MCP clients, and what each of its tools does.
npx -y zn-gate mcp starts a local MCP server (stdio). It needs no install, no account and no network.
To protect the MCP servers you already use, rather than adding tools for the agent to call, see Protect MCP servers.
Tools
| Tool | Phase | What it does | Network |
|---|---|---|---|
analyze_prompt |
Before the model | Checks a prompt for injection, jailbreak and exfiltration patterns | Only with ZN_CLOUD=1 and a key, redacted |
check_tool_call |
Before execution | Checks the tool name and arguments; returns sanitized_arguments with secrets masked |
Never |
check_tool_result |
Before the agent reads the output | Checks tool output for indirect injection; returns it with secrets redacted, or neutralized if it carries an injection | Never |
zn_status |
Any | Engine, rules version and what (if anything) leaves the machine | Never |
check_tool_result
Arguments: tool_name (for example fetch, web_search, read_file) and content (the text, Markdown or JSON the tool returned). The response includes:
| Field | Meaning |
|---|---|
safe_to_ingest |
false if the output carries a prompt injection |
sanitized_content |
What the model should read: the output with secrets redacted, or a short notice if it was blocked |
secrets_redacted |
How many secrets were replaced |
assessment |
verdict, rule, reason and confidence of the injection check |
A full example is in the quickstart. On whole source files the local rules currently produce false positives on ordinary code comments: use check_tool_result for web and third-party content rather than your own repository files.
Claude Code
claude mcp add zn-gate -- npx -y zn-gate mcp
This adds the MCP tools only. For automatic protection in Claude Code, install the plugin: see the Quickstart.
Codex CLI
codex mcp add zn-gate -- npx -y zn-gate mcp
Or in ~/.codex/config.toml:
[mcp_servers.zn-gate]
command = "npx"
args = ["-y", "zn-gate", "mcp"]
Cursor
~/.cursor/mcp.json (Claude Desktop and Antigravity use the same shape):
{
"mcpServers": {
"zn-gate": { "command": "npx", "args": ["-y", "zn-gate", "mcp"] }
}
}
OpenCode
~/.config/opencode/opencode.json:
{
"mcp": {
"zn-gate": {
"type": "local",
"command": ["npx", "-y", "zn-gate", "mcp"],
"enabled": true
}
}
}
Other clients
Any client that supports stdio MCP servers works the same way: command npx, arguments -y zn-gate mcp.
Optional cloud second opinion
To let analyze_prompt also ask the cloud model, add "env": { "ZN_CLOUD": "1", "ZN_API_KEY": "zn_live_your_key" } to the server entry (OpenCode uses "environment"). Tool output and arguments stay local either way. See Configuration. A hosted MCP endpoint is also available: Hosted MCP endpoint.