regex-le-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@regex-le-mcpAre any regex patterns in this code vulnerable to ReDoS?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Useful? A star or rating is how other developers find it — ★ GitHub · ★ Marketplace · ★ Open VSX
What it does
Open any file and run one of three commands. Extract lists every regex pattern found in the document. Test (Ctrl+Alt+R / Cmd+Alt+R) runs a found — or manually entered — pattern against the file content and reports matches with real line/column positions and capture groups (named groups included). Validate checks every found pattern for syntax errors and screens it for ReDoS-prone shapes. Works in VS Code and VS Code–based editors like Cursor and VSCodium (installable from Open VSX).
Related MCP server: File Context MCP Server
Use it from an AI agent
The same engine runs as an MCP server, so an agent can call it directly instead of you running a command.
Editor | How |
VS Code 1.101+ | Nothing to install — the extension registers |
Zed | Regex-LE — pending review |
Claude Code |
|
Cursor, Windsurf, anything else | point it at |
extract_patterns(content, maxResults?)Returns every pattern with its flags, 1-based position and a ReDoS verdict, so "are any of the regexes in this file dangerous?" is one call rather than two.
The server takes content and returns data — it reads no files and makes no network requests of its own. Published as regex-le-mcp on npm and as io.github.nolindnaidoo/regex-le in the MCP registry.
Most hosts read a JSON config. Add one entry:
{
"mcpServers": {
"regex-le": {
"command": "npx",
"args": ["-y", "regex-le-mcp"]
}
}
}-y skips the install prompt on first run. Pin a version if you would rather not track releases — regex-le-mcp@2.2.1.
Prefer not to go through npx on every launch? Install it once and point at the binary instead:
npm install -g regex-le-mcp{
"mcpServers": {
"regex-le": { "command": "regex-le-mcp" }
}
}It speaks MCP over stdio and needs no environment variables, no API key and no configuration of its own. To check it before wiring it into anything:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npx -y regex-le-mcpThat prints the tool list and exits — if you see extract_patterns, the server works.
What gets extracted
Extraction scans the whole document (any file type), so constructors split across lines are found too:
Form | Example |
Literal |
|
Constructor |
|
Bare constructor call |
|
What is deliberately not extracted:
Division, dates, and filesystem paths (
a / b,10/29/2025,/usr/local/bin): a/preceded by an identifier, number,),],., or another/is not treated as a regex — after keywords likereturn, it is.Candidates that do not compile as JavaScript regexes, or with invalid/duplicate flags.
Constructor calls whose pattern argument is a variable or template literal (only literal string arguments are visible to a text scanner).
Duplicate pattern+flags pairs are listed once. This is lexing by heuristic, not a full JS parser: a slash inside a string or comment can still be picked up when its context looks expression-like.
ReDoS screening
Validate (and Test, before running a risky pattern) screens for the common catastrophic-backtracking shapes:
High severity — nested unbounded quantifiers:
(a+)+,([a-z]+)*Medium severity — quantified alternation with overlapping branches:
(a|ab)+
This is a structural scanner, not an automaton analysis: it cannot prove a pattern safe, only flag the dangerous shapes it recognizes. The reports also include a rough performance score based on execution time relative to input size — treat it as a hint, not a benchmark (memory is not measured).
Commands
Command | Description |
| Test a found or entered pattern against the file |
| List every regex pattern found in the document |
| Syntax + ReDoS report for every found pattern |
| Open Regex-LE settings |
| Built-in documentation |
Settings
Setting | Default | Description |
|
| Open results beside the current editor |
|
| Also copy results to the clipboard |
|
|
|
|
| Guardrails for very large files and outputs |
|
| Refuse processing above this file size |
|
| Refuse result documents above this line count |
|
| Show the status bar item |
|
| Local-only event log (see Privacy) |
|
| ReDoS screening in Test/Validate |
|
| Cap on matches collected per test (10–10000) |
Languages
Twelve languages besides English:
German · Spanish · French · Indonesian · Italian · Japanese · Korean · Portuguese (Brazil) · Russian · Ukrainian · Vietnamese · Chinese (Simplified)
Both halves are covered — the manifest (command titles, setting names and descriptions) and everything shown while the extension runs (notifications, the status bar, quick-picks and prompts). The extension follows VS Code's display language, so it matches whatever the editor is already set to; no setting of its own.
Privacy & security
No network access. The extension never sends data anywhere. The
telemetryEnabledsetting only writes events to a local Output Channel you can inspect (Regex-LE Telemetry).Testing a pattern the ReDoS screen rates high-severity asks for confirmation first.
The MCP server holds the same line. It takes content as an argument and returns data: no filesystem access, no network calls, no telemetry. Your agent already has file-read tools, so duplicating them inside the server would add a path-traversal surface for no capability.
check:mcp-bundlefails the build if the server ever imports something that could reach either.Error notifications redact home directories and credential-shaped fragments.
Development
bun install
bun run build # esbuild bundle -> dist/extension.js
bun run typecheck # tsc --noEmit (includes tests)
bun run test # vitest unit suite
bun run test:integration # real VS Code extension host
bun run lint # biome
bun run package # VSIX into release/Architecture and conventions live in AGENTS.md. Changes are tracked in CHANGELOG.md.
Performance
Input | Size | Found | Time | Rate | Scan speed |
JS with literals | 1.12 MB | 25,000 | 44.19 ms | 565,679/sec | 25.4 MB/s |
JS with constructors | 1.27 MB | 25,000 | 41.86 ms | 597,268/sec | 30.3 MB/s |
Source without regexes | 1.24 MB | 0 | 18.75 ms | — | 66 MB/s |
Median of 7 runs after warmup, on Apple M5 Pro, 24 GB RAM, Node 24.3.0. Inputs are generated
by scripts/benchmark.ts rather than checked in, so the sizes above are
exactly what was measured. Reproduce with bun run benchmark.
These are machine-specific and are not asserted in CI — a benchmark that gates a build only tells you how busy the runner was.
Testing
Metric | Coverage |
Statements | 90.66% |
Branches | 75.89% |
Functions | 97.36% |
Lines | 91.16% |
133 test cases across 12 files, plus an integration suite that runs
in a real VS Code extension host and an end-to-end test that installs the
built .vsix into a clean profile.
Generated from coverage/coverage-summary.json by
scripts/coverage-readme.js; CI fails if this section drifts from a fresh
run. Reproduce with bun run test:coverage.
More from the LE Family
Every tool in the family, one page: letools.dev
All ten also ship as MCP servers — npx <name>-mcp gives any agent the same engine.
String-LE - Extract string values for i18n from JSON, YAML, CSV, TOML, INI, and .env
Numbers-LE - Extract numeric values from JSON, YAML, CSV, TOML, INI, and .env
EnvSync-LE - Spot missing keys across your .env files, with a markdown report
Paths-LE - Extract file paths from JS/TS imports, JSON, HTML, CSS, TOML, CSV, and .env
Secrets-LE - Detect and sanitize credentials locally, before you commit
Scrape-LE - Check whether a page is scrapeable before you write the scraper
Colors-LE - Extract and analyze colors from CSS, SCSS, LESS, Stylus, HTML, JS/TS, and SVG
URLs-LE - Extract URLs from documentation, configs, and code
Dates-LE - Extract and analyze dates from logs, configs, and code
Also by nolindnaidoo
Rust
pixelcoords — Freeze your screen, mark regions, get pixel-exact coordinates and crops pixelcoords.dev · crates.io · docs.rs
pixelactions — Consume human-verified coordinates, perform the interaction, confirm it landed pixelactions.dev · crates.io · docs.rs
Contact Developer — GitHub · LinkedIn
License
MIT © nolindnaidoo
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables AI assistants to search and analyze codebases using Abstract Syntax Tree (AST) pattern matching with ast-grep. Supports structural code search, pattern testing, and AST visualization across multiple programming languages.Last updated4442MIT
- Flicense-qualityDmaintenanceEnables AI assistants to read, search, and analyze local file systems with tools for reading file contents, listing directories, searching by patterns, and analyzing folder structures for context-aware queries.Last updated
- Alicense-qualityDmaintenanceProvides a suite of regex and text processing tools for AI agents, including pattern testing, extraction, and replacement with capture group support. It also enables various text transformations like case conversion, line sorting, and deduplication through the Model Context Protocol.Last updated27MIT
- Flicense-qualityCmaintenanceRegexForge gives AI agents a reliable way to get a regex without asking an LLM to hallucinate one. Pass in labeled examples (strings that should match, strings that shouldn't) plus an optional description; get back the regex, a proof matrix showing it handles every example, and a backtracking-risk audit flagging catastrophic-backtracking patterns. Pure symbolic synthesis over a template bank withLast updated
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Parallel regex across all Boolsai scans — discover new vendor patterns, niche signals. 4 tools.
Read-only tools over the Safer Agentic AI framework: 238 patterns + 14 heuristics.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nolindnaidoo/regex-le'
If you have feedback or need assistance with the MCP directory API, please join our Discord server