About Rexact
Rexact is an MCP server for testing, analyzing and explaining regular expressions, with ReDoS checks and engine compatibility reports. Four tools work offline; regex generation requires an Anthropic API key.
Key features
- 01Verify patterns against test cases
- 02Check patterns for ReDoS risk
- 03Explain regex tokens
- 04Find engine compatibility issues
- 05Generate verified regex patterns
Use cases
- 01Test patterns against example inputs
- 02Assess patterns for ReDoS risk
- 03Understand complex regex syntax
- 04Check compatibility across engines
MCP support
Rexact exposes five regex tools to MCP clients: verification, ReDoS analysis, explanation, compatibility checks and generation. The first four work offline; generation requires an Anthropic API key.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y rexact-mcpANTHROPIC_API_KEYSecretOptional. Only needed by the generate_regex tool; the four other tools work offline without it.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
5Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| cases | array | Yes | Test cases to run the pattern against. |
| flags | string | No | JavaScript regex flags, e.g. "gi". |
| pattern | string | Yes | The regex source, without delimiters. |
Details
From the project READMErexact-mcp
Serveur MCP (Model Context Protocol) pour Rexact — vérification, analyse ReDoS, explication et compatibilité multi-moteurs de regex, adossées à @rexact/core (le même moteur déterministe que le site).
Quatre des cinq outils fonctionnent hors ligne, sans clé API, sans coût :
| Outil | Entrée | Sortie |
|---|---|---|
verify_regex | pattern, flags, cases | CorpusReport |
check_redos | pattern, flags | RedosVerdict |
explain_regex | pattern, flags, locale | ExplainToken[] |
check_compat | pattern, flags, targets | CompatIssue[] |
generate_regex | description, cases, flavor | motif vérifié — nécessite ANTHROPIC_API_KEY |
Aucune regex fournie n'est jamais exécutée en dehors d'un bac à sable worker_threads avec timeout dur et terminaison forcée (invariant I2 du dépôt) — jamais un new RegExp().test() direct côté serveur.
Installation locale (transport stdio)
Le plus simple pour un client MCP comme Claude Desktop : coller ce bloc dans sa configuration MCP.
{
"mcpServers": {
"rexact": {
"command": "npx",
"args": ["-y", "rexact-mcp"]
}
}
}
Pour activer generate_regex (facultatif), ajouter votre propre clé Anthropic — c'est votre clé, à votre coût, jamais le quota gratuit du site :
{
"mcpServers": {
"rexact": {
"command": "npx",
"args": ["-y", "rexact-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
Transport HTTP streamable
Pour héberger le serveur (auto-hébergement, réseau interne) :
pnpm --filter rexact-mcp build
PORT=3300 pnpm --filter rexact-mcp start:http
Le serveur écoute sur / (POST pour ouvrir une session et envoyer des requêtes, GET pour le flux SSE d'une session existante). L'en-tête mcp-session-id, renvoyé à l'initialisation, identifie la session sur les requêtes suivantes.
Développement
pnpm --filter rexact-mcp dev # rebuild à chaque changement
pnpm --filter rexact-mcp typecheck
Liens
Page d'accueil, exemples et installation par client : https://rexact.dev/fr/mcp (EN : https://rexact.dev/en/mcp). Licence : MIT.
Comments
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.