PM

patzedi/mcpgex

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

6 stars 3 forks 品質 54 トレンド 14MIT

MCP server for finding, testing and refining regex patterns

概要

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

以下は原文 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!

The server provides four main tools:

1. add_test_case

Add a new test case with an input string and expected match.

Parameters:

  • input_string (required): The text to test against
  • expected_matches (required): The array of substrings that should be extracted/matched
  • description (optional): Description of what this test case validates

Example:

{
  "input_string": "Contact me at [email protected] for details", 
  "expected_matches": ["[email protected]"],
  "description": "Basic email extraction"
}

2. test_regex

Test a regex pattern against all current test cases.

Parameters:

  • pattern (required): The regex pattern to test
GitHub で README 全文を見る

インストール

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

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

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