Rexact

v0.1.2
io.github.Nicolasmar91/rexact-mcp Checked 4 days ago Published 1 month ago

Verify, explain and audit regexes (ReDoS, engine compatibility) offline.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

verify_regex Verify a regex against test cases

Runs a regular expression against a set of test cases in a sandboxed worker (never on the calling process) and returns a pass/fail report. Offline, no API key required.

ParameterTypeDescription
cases *arrayTest cases to run the pattern against.
pattern *stringThe regex source, without delimiters.
flagsstringJavaScript regex flags, e.g. "gi".

check_redos Check a regex for catastrophic backtracking (ReDoS)

Statically and dynamically analyzes a pattern for ReDoS risk — never executes it against user-supplied input. Offline, no API key required.

ParameterTypeDescription
pattern *stringThe regex source, without delimiters.
flagsstringJavaScript regex flags, e.g. "gi".

explain_regex Explain a regex token by token

Breaks a pattern down into an ordered list of tokens (anchors, groups, quantifiers...) with a plain-language explanation for each. Offline, no API key required.

ParameterTypeDescription
pattern *stringThe regex source, without delimiters.
flagsstringJavaScript regex flags, e.g. "gi".
localestringLanguage for the plain-text explanation.

check_compat Check cross-engine regex compatibility

Reports syntax and semantic differences when a pattern is ported from its source flavor to one or more target engines (PCRE, RE2, Python, Java, .NET, POSIX grep). Offline, no API key required.

ParameterTypeDescription
pattern *stringThe regex source, without delimiters.
targets *arrayEngines to check compatibility against.
flagsstringJavaScript regex flags, e.g. "gi".
sourceFlavorstringThe flavor the pattern was authored for. Not in SPEC-TECHNIQUE.md's input list for this tool — added because checkCompat() requires it; defaults to "js".

generate_regex Generate a regex from a natural-language description

Asks an LLM to draft a pattern from a description and test cases, then deterministically verifies it (compile, corpus, ReDoS) before returning it — never returns unverified model output. Requires ANTHROPIC_API_KEY in the MCP server's own environment (your own key, your own cost).

ParameterTypeDescription
cases *arrayTest cases the generated pattern must satisfy.
description *stringNatural-language description of the pattern to generate.
flavor *stringTarget regex flavor for the generated pattern.