MCPGex
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., "@MCPGextest the pattern \d{3}-\d{3}-\d{4} for phone number extraction"
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.
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.
MCPGex is still in its early stages.
Index
Related MCP server: RegexForge
How it works
Define the goal: You provide what the goal regex pattern should return. The LLM will generate test cases for you.
Test patterns: The LLM can test different regex patterns against all defined test cases to see which ones pass or fail.
Iterate: Based on the results, the LLM can refine the regex pattern until all test cases pass.
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 mcpgexUsage
Running the Server
If you want to start the MCP server:
mcpgexConfiguration
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!
Available Tools (click to expand)
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 againstexpected_matches(required): The array of substrings that should be extracted/matcheddescription(optional): Description of what this test case validates
Example:
{
"input_string": "Contact me at john@example.com for details",
"expected_matches": ["john@example.com"],
"description": "Basic email extraction"
}2. test_regex
Test a regex pattern against all current test cases.
Parameters:
pattern(required): The regex pattern to testflags(optional): Regex flags like 'i' (case-insensitive), 'm' (multiline), 's' (dotall)
Example:
{
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"flags": "i"
}3. get_test_cases
View all currently defined test cases.
4. clear_test_cases
Remove all test cases to start fresh.
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.
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
- 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
- AlicenseCqualityAmaintenanceA 66-tool reasoning pipeline that intercepts prompts to classify intent, check past mistakes, and generate execution plans, enabling any LLM to think harder and avoid repeating errors.Last updated921MIT
- FlicenseAqualityCmaintenanceEnables LLM agents to extract, validate, and mask personally identifiable information using deterministic regular expressions, reducing token usage and hallucination risks.Last updated3213
Related MCP Connectors
Deterministic regex synthesis from labeled examples. Zero LLM, proof matrix, backtracking audit.
33 tools that make AI write, implement, and verify intent against explicit, testable constraints.
Deterministic validation for AI-generated artifacts: JSON Schema, OpenAPI response, SQL syntax.
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/PatzEdi/MCPGex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server