mcpField
A
agent-firewall-mcp

agent-firewall-mcp

Local
github.com/mlawsonkingSecurity1Updated today

About agent-firewall-mcp

agent-firewall-mcp is an MCP server for deterministic checks of untrusted content, URLs, IPs, secrets, PII and passwords. It uses pattern matching and external reputation sources rather than an LLM, with documented limits on detection.

Key features

  1. 01Scan text or fetched URLs for known injection patterns
  2. 02Detect obfuscation techniques
  3. 03Find and redact supported secrets and PII
  4. 04Check URL and IP reputation
  5. 05Check passwords against breached-password data

Use cases

  1. 01Screen external text before it reaches an agent
  2. 02Review URLs and IP addresses from untrusted sources
  3. 03Find exposed credentials or PII in text
  4. 04Check whether a password appears in breach data

MCP support

Exposes security-check tools to MCP clients, including content, secret, URL, IP and password checks. Some checks use external services and reputation data.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mlawsonking-agent-firewall": {
"command": "npx",
"args": [
"-y",
"agent-firewall-mcp"
]
}
}
}
Run commandnpx -y agent-firewall-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmagent-firewall-mcp1.3.0

Tools

5

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
urlstringNoA page to fetch and scan instead of text. Fetching is SSRF-guarded.
textstringNoThe text to scan.

Details

From the project README

agent-firewall-mcp

An MCP server that treats every external input as untrusted. It matches text against known prompt-injection patterns, checks URLs and IPs, screens for leaked secrets and PII, and checks passwords against known breaches. Deterministic, no LLM, free.

The basic rule for agent security (OWASP's LLM01) is to treat anything the agent reads from the outside as potentially hostile: web pages, tool output, files, user input. These are the checks for doing that at the point where the content comes in, before it reaches the model.

Install

{ "mcpServers": { "agent-firewall": { "command": "npx", "args": ["-y", "agent-firewall-mcp"] } } }

Tools

  • scan_content: match text or a fetched URL against 11 known prompt-injection and jailbreak patterns, plus 5 obfuscation checks (zero-width characters, bidi tricks, the Unicode tag block, CSS-hidden text, HTML-comment instructions). Returns allow, review, or block, and the rule IDs that fired. It is a pattern matcher, not a classifier: a novel phrasing or a paraphrase will not be caught, and allow means nothing matched rather than that the content is safe.
  • scan_secrets: match text against 22 secret patterns — AWS access key ids, GitHub tokens, OpenAI, Anthropic, Google API keys, Slack, Stripe live secret keys, Twilio, npm tokens, JWTs, PEM private-key blocks, Azure storage keys, SAS tokens and AD client secrets, GCP service-account key ids and OAuth refresh tokens, database and ODBC connection-string passwords, SendGrid, GitLab, Hugging Face, and a generic key = "value" assignment — and 3 PII patterns: email, US SSN, Luhn-checked card numbers. A credential from a vendor not on that list is not found unless it happens to be written as one of those assignments, and that rule is narrow: api-key = "abc12345" matches, {"api_key": "abc12345"} does not, and an unquoted value does not. A clean result is not proof the text is clean. Returns the findings (masked) and a redacted copy: the secret value is replaced and the label stays, api_key = "[REDACTED:Generic Secret Assignment]". The line is not dropped and the document is not scrubbed. A PEM block is removed in full.
  • check_url: URL and domain safety, using structural heuristics (punycode host, 14 known shorteners, 23 abuse-prone TLDs, raw-IP host, credentials in the URL, brand lookalikes), domain age from RDAP, and the final URL after redirects. "Brand lookalike" is a substring test — one of 14 brand names in the hostname that is not the registrable domain, like paypal.com.secure-login.tk. It is not edit distance and not homoglyphs, so paypa1.com gets past it. Only the final URL is re-checked, not every hop, and its flags only count when the redirect lands on a different host. Domain age is looked up for the host you passed in, not the host you land on. Returns safe, suspicious, or malicious.
  • check_ip: IP reputation, covering Tor exit nodes (Tor Project bulk exit list), ASN and org (via Team Cymru), reverse DNS, whether the org name looks like a datacenter, and one DNSBL lookup: Spamhaus ZEN, IPv4 only. Spamhaus refuses queries from many cloud resolvers, so the lookup can be inconclusive; that comes back as listed: null with a note and adds nothing to the score. Only listed: true moves the verdict, so an inconclusive lookup ends up with the same verdict as a clean one — read blocklist.listed rather than the verdict alone.
  • check_password: check a password against HIBP's Pwned Passwords using k-anonymity, so the plaintext never leaves the server.

Rule updates

About once a day this server asks the rules feed whether there is a newer ruleset, and applies it if there is. The request carries two things: which surface asked, which here is facade, and the rules version already installed. No machine id, no user id, no file names, nothing you scanned.

Bundles are signed with Ed25519 and verified against a public key compiled into this package, so it does not matter which mirror served one. A bundle that fails its signature, its schema, or its ReDoS check is discarded and the rules you already had stay in place. --offline turns updates off, as does AGENT_GUARDS_NO_FEED=1 or {"feed": false} in ~/.agent-guards/config.json. The bundle format and how to verify one yourself: https://github.com/mlawsonking/MCP/blob/main/rules/README.md

Data comes from HIBP, RDAP, the Tor Project, Team Cymru, DNS, and curated rulesets. It calls https://agent-firewall-seven.vercel.app (set AGENT_FIREWALL_API to override). One of six agent guards in this repo. MIT.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.