PM

patzedi/mcpgex

Developer tools
6 stars 3 forks Quality 54 Trend 14MIT

MCP server for finding, testing and refining regex patterns

Overview

MCP server for finding, testing and refining regex patterns MCPGex is an MCP server that allows LLMs to test and validate regex patterns against test cases. It provides a systematic way to develop regex patterns by defining or generating expected outcomes and iteratively testing patterns until all requirements are satisfied. 1. : You provide what the goal regex pattern should return. The LLM will generate test cases for you. 2. : The LLM can test different regex patterns against all defined test cases to see which ones pass or fail. 3. : Based on the results, the LLM can refine the regex pattern until all test cases pass. 4. : Once all tests pass, you have a regex pattern that works for your specific use cases. You can also add a configuration. For example, for Claude Desktop, you can have: Then, you will be able to use the server in these tools without having to run the python script manually! Add a new test case with an input string and expected match.

README

MCPGex

MCP server for finding, testing and refining regex patterns

MCPGex is an MCP server that allows LLMs to test and validate regex patterns against test cases. It provides a systematic way to develop regex patterns by defining or generating expected outcomes and iteratively testing patterns until all requirements are satisfied.

[!WARNING] MCPGex is still in its early stages.

Index

How it works

  1. Define the goal: You provide what the goal regex pattern should return. The LLM will generate test cases for you.
  2. Test patterns: The LLM can test different regex patterns against all defined test cases to see which ones pass or fail.
  3. Iterate: Based on the results, the LLM can refine the regex pattern until all test cases pass.
  4. Validate: Once all tests pass, you have a regex pattern that works for your specific use cases.

Installation

Go ahead and install through pip:

pip3 install mcpgex

Usage

Running the Server

If you want to start the MCP server:

mcpgex

Configuration

You can also add a configuration. For example, for Claude Desktop, you can have:

{
  "mcpServers": {
    "mcpgex": {
      "command": "python3",
      "args": ["-m", "mcpgex"]
    }
  }
}

Then, you will be able to use the server in these tools without having to run the python script manually!

Benefits

  • Comprehensive testing: Ensure patterns work across various use cases
  • Iterative improvement: Easy to test and refine patterns
  • Documentation: Test cases serve as examples and documentation
  • Confidence: Know your regex works before deploying it
  • Fully Automated: Give it instructions, let it do the rest

Requirements (installed automatically through pip3)

  • Python 3.8+
  • MCP library (pip3 install mcp)

License

This project is open source under the MIT license. Feel free to use and modify as needed.

View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "mcpgex": { "command": "python3", "args": ["-m", "mcpgex"] } } }