Rexact for AI assistants (MCP server)
An AI assistant writes a regex with confidence but almost never tests it. Rexact’s MCP server gives it the site’s engine: it checks the regex against examples, detects dangerous patterns and explains the result. Everything runs on your computer, with no key or account.
What your assistant can do
verify_regexTests a regex against cases that should and should not match, and returns the score.check_redosDetects regexes vulnerable to ReDoS, which can freeze a server, with a string that proves it.explain_regexExplains the regex piece by piece, in French or English.check_compatShows what breaks in other engines (RE2, PCRE, Python, Go, etc.).generate_regexGenerates a verified regex from a description. Optional: uses your own Anthropic key.
Installation
You need Node.js 20 or later. Add this block to your assistant’s MCP configuration, then restart it.
Claude Code (one command)
claude mcp add rexact -- npx -y rexact-mcp
Claude Desktop, Cursor and other clients (configuration file)
{
"mcpServers": {
"rexact": {
"command": "npx",
"args": ["-y", "rexact-mcp"]
}
}
}Example
Ask: “Write a regex for a US ZIP code and check it against 5 cases, 2 of which must fail.” The assistant proposes the regex, runs it with Rexact and fixes it if a case fails.
Privacy and cost
The first four tools work offline: no regex is sent to Rexact, and it is free. Only the generation tool calls a model, with your own Anthropic key at your own cost. The code is MIT-licensed.