Regex

io.github.rog0xPublished by GitHub account rog0xv1.0.1Updated Oct 24, 2026

Regex test, explain, replace patterns for AI agents

VerifiedSTDIODesktop onlyDeveloper ToolsData & Analytics

Overview

AI-generated overview

A local MCP server that gives an assistant regex testing, replacement, extraction, explanation, and text transformation tools.

What you can do
Test a regex pattern against text and get matches with indices, captured groups, and named groups back. Find and replace with capture group references such as $1, $2, $&, and $ . Extract all matches as a structured array, optionally limited to one capture group. Explain a pattern and its flags component by component in plain language. Apply and chain text transforms such as case conversion, trimming, line deduplication, sorting, and word, character, or line counts.
When to use it
Useful when you work with regular expressions or bulk text and want the assistant to check a pattern, rewrite text with capture groups, pull structured matches out of a document, or understand an unfamiliar pattern. Handy for debugging regex and for repetitive text cleanup without leaving the chat.
Requirements
Runs as a local Node.js process installed from the npm package @rog0x/mcp-regex-tools; the README builds it with npm install and npm run build and registers the built dist/index.js with node. Desktop client configuration is needed. No authentication, environment variables, or headers are declared.
Before you install
Text passed to the tools is processed locally by the server process; no third-party services or credentials are declared. Replacement and extraction act only on the text you supply, so review results before using them in files or code.

Installation

In SourceWeft

  1. Open Regex in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

mcp-regex-tools

Regex and text processing tools for AI agents via the Model Context Protocol (MCP).

Tools

ToolDescription
regex_testTest a regex pattern against text. Returns all matches with indices, captured groups, and named groups.
regex_replaceFind and replace using regex with support for capture group references ($1, $2, $&, $<name>).
regex_extractExtract all matches of a pattern from text as a structured array. Optionally return only a specific capture group.
regex_explainParse a regex pattern and return a human-readable explanation of each component and flag.
text_transformApply common text transformations: camelCase, snake_case, kebab-case, PascalCase, UPPER, lower, title case, reverse, trim, deduplicate lines, sort lines, remove blank lines, count words/chars/lines. Chain multiple transforms in one call.

Setup

bash
npm installnpm run build

Usage with Claude Desktop

Add this to your Claude Desktop config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
json
{  "mcpServers": {    "regex-tools": {      "command": "node",      "args": ["D:/products/mcp-servers/mcp-regex-tools/dist/index.js"]    }  }}

Usage with Claude Code

bash
claude mcp add regex-tools node D:/products/mcp-servers/mcp-regex-tools/dist/index.js

Or add to your .mcp.json:

json
{  "mcpServers": {    "regex-tools": {      "command": "node",      "args": ["D:/products/mcp-servers/mcp-regex-tools/dist/index.js"]    }  }}

Examples

Test a regex

regex_test({ pattern: "(\\d{4})-(\\d{2})-(\\d{2})", text: "Today is 2026-03-19 and tomorrow is 2026-03-20" })

Replace with capture groups

regex_replace({ pattern: "(\\w+)\\s(\\w+)", replacement: "$2 $1", text: "hello world" })

Extract matches

regex_extract({ pattern: "[\\w.]+@[\\w.]+", text: "Contact us at [email protected] or [email protected]" })

Explain a regex

regex_explain({ pattern: "^(?:https?://)?(?:www\\.)?([\\w-]+)\\.\\w{2,}$", flags: "i" })

Transform text

text_transform({ text: "hello world example", transforms: ["PascalCase"] })text_transform({ text: "some text\nwith\nlines\nwith\nduplicates\nlines", transforms: ["deduplicate_lines", "sort_lines"] })

License

MIT

Source: README.md at commit b5ed2c9

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts