# Regex Lab MCP

> Regex Lab MCP is an open-source MCP server for developer tools. Test, explain and replace regex patterns from your AI assistant or IDE. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API
- **Repository:** https://github.com/ryudi84/sovereign-mcp-servers/tree/HEAD/regex-lab
- **MCP Registry name:** io.github.ryudi84/regex-lab-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Regex Lab is a small MCP server that gives an AI client tools for working with regular expressions. The README describes it as a way to avoid switching to a separate regex tester: you ask the assistant to run a pattern against a string and it returns the matches along with their positions and capture groups.

The server is published on npm and runs over stdio, so it is started locally by the client through npx. The README shows configuration for Claude Desktop, Cursor and Windsurf. It exposes three tools: one for testing a pattern, one for find-and-replace, and one for checking whether a pattern is syntactically valid.

It suits developers who write or debug patterns inside their editor or chat assistant and want quick feedback without leaving the workflow. It is MIT licensed and part of a larger set of MCP servers from the same author.

## Features

- **Pattern testing:** Runs a regex against input text and returns all matches with positions and capture groups.
- **Find and replace:** Applies a regex and replacement string to a text and returns the result.
- **Syntax validation:** Checks whether a regex pattern is syntactically valid before it is used.
- **Local stdio setup:** Runs locally via npx and connects to common MCP clients through a JSON configuration entry.

## Good for

- Debugging a regex pattern while working in an AI-enabled editor
- Checking capture groups and match positions for a sample string
- Previewing find-and-replace results before applying them to code or data
- Validating a pattern's syntax before adding it to a codebase

## Install

### Claude Code (Terminal)

```sh
claude mcp add regex-lab-mcp -- npx -y regex-lab-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "regex-lab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "regex-lab-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "regex-lab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "regex-lab-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "regex-lab-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "regex-lab-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "regex-lab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "regex-lab-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "regex-lab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "regex-lab-mcp"
      ]
    }
  }
}
```

## Tools

- `test_regex`: Test a regex pattern against a string and return all matches with positions and capture groups.
- `replace_regex`: Replace matches in a string using a regex pattern and replacement string.
- `validate_regex`: Check if a regex pattern is syntactically valid.

## FAQ

### What license is Regex Lab MCP released under?

The README states the project is licensed under MIT.

### How do I install it?

The README shows running it with npx regex-lab-mcp, and gives a JSON configuration snippet for Claude Desktop, Cursor and Windsurf that launches it with npx -y.

### How many tools does it provide?

The README lists three tools: test_regex, replace_regex and validate_regex.

### Is Regex Lab MCP free?

Yes. Regex Lab MCP is open source, so you can use and self-host it for free.

### How do I add Regex Lab MCP to Claude Code?

Run this command in your terminal: claude mcp add regex-lab-mcp -- npx -y regex-lab-mcp

### What are the best alternatives to Regex Lab MCP?

The closest alternatives to Regex Lab MCP are Regex Lab, Slop Patterns, Rexact, Edit MCP and Mobai MCP.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Regex Lab](https://ai-powered.com/mcp/regex-lab): Regex Lab is an open-source MCP server for developer tools.
- [Slop Patterns](https://ai-powered.com/mcp/slop-patterns): Slop Patterns is an open-source MCP server for design and media.
- [Rexact](https://ai-powered.com/mcp/rexact): Rexact is an open-source MCP server for developer tools.
- [Edit MCP](https://ai-powered.com/mcp/edit-mcp): Edit MCP is an open-source MCP server for developer tools.
- [Mobai MCP](https://ai-powered.com/mcp/mobai-mcp): Mobai MCP is an open-source MCP server for developer tools.
- [Testing](https://ai-powered.com/mcp/testing): Testing is an open-source MCP server for developer tools.
- [Lens MCP](https://ai-powered.com/mcp/lens-mcp-2): Lens MCP is an open-source MCP server for developer tools.
- [Test Shape MCP](https://ai-powered.com/mcp/test-shape-mcp): Test Shape MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/regex-lab-mcp
