mcpField
R
Regex Safety Audit

Regex Safety Audit

Remote
github.com/tylerscomic-labSecurity0Updated 14w ago
Repository

About Regex Safety Audit

Regex Safety Audit is an MCP server for developers and coding agents that identifies ReDoS risks through structural regex parsing without executing patterns. It also provides JavaScript-compatible rewrite suggestions and bounded test inputs.

Key features

  1. 01AST-based ReDoS analysis
  2. 02Detection of nested quantifiers, ambiguous alternatives, and backreferences
  3. 03JavaScript-safe rewrite suggestions
  4. 04Attack-string candidates with OS-level timeout testing

Use cases

  1. 01Review regexes before adding them to an application
  2. 02Check regex changes during security audits
  3. 03Test flagged patterns without risking a hung process

MCP support

Exposes regex analysis, attack-string generation, and safe-rewrite suggestions as tools for MCP clients.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://regex-safety-audit-mcp.mcpize.run/mcp
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README

regex-safety-audit-mcp

License: MIT Live on MCPize

An MCP server that parses a regex into a real hand-written AST to detect catastrophic-backtracking (ReDoS) risk — without ever executing the pattern itself. A ReDoS scanner that runs the regex it's scanning would be able to hang itself; this one never calls new RegExp(...).test() on anything.

What it catches

Nested unbounded quantifiers ((a+)+), ambiguous alternation inside a repeated group ((a|ab)+), and backreferences — the three shapes behind almost every real-world ReDoS incident. Detection is structural (a real parser, not regex-on-regex string heuristics), verified against the canonical literature examples during testing.

The JS-specific trap

Generic ReDoS advice tells you to wrap the offending group in an atomic group or use a possessive quantifier. JavaScript has neither. analyze_redos_risk says so explicitly, and suggest_safe_rewrite gives the actual JS-safe fix (collapsing redundant nesting, or restructuring with a negated character class) instead of advice that would 400 as a syntax error if you tried it.

Tools

analyze_redos_risk

Full structural analysis. Returns a risk level, every finding with its exact reason, and the JS atomic-group/ possessive-quantifier caveat.

generate_attack_string

For a flagged pattern, generates candidate proof-of-concept inputs at a few sizes, plus a ready-to-run Node snippet that times the match with a hard OS-level subprocess timeout — so testing a genuinely catastrophic regex can't hang your own test process either.

suggest_safe_rewrite

Concrete rewritten pattern for the mechanically-fixable shapes; honest "no mechanical fix, here's what to change by hand" for the ones that aren't.

Use it

Hosted (recommended): MCPize — free tier, $7/mo Pro.

Self-host:

npm install
node server.js

Part of a small suite

mcp-schema-audit-mcp, cron-schedule-audit-mcp, claude-cost-audit-mcp.

License

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.