verified-regex-generator
Lets users generate regex patterns from plain-English descriptions, then verifies them with Python's real re engine against generated positive and negative test strings, iterating on failures until they pass. It exposes this as a tool callable from MCP clients such as Claude Desktop or Claude Code.
README
<div align="center">
Verified Regex Generator
</div>
MCP → Verified Regex Generator. The user describes a pattern in plain English. An LLM generates the regex. An agent generates real sample strings (positive + negative examples), tests the regex against them with the actual
reengine, and iterates if it's wrong. Regex is infamous for looking right while being subtly wrong — verification is the whole value here, not the generation.
Runs on Groq (openai/gpt-oss-120b by default) — fast and free-tier
friendly, so it's cheap to demo publicly.
This isn't "ask an LLM for a regex and hope." It's a closed verification loop:
description ──► LLM writes a candidate regex
│
description ──► LLM writes real test strings (incl. tricky near-misses)
│
▼
Python's `re` engine checks the candidate
against every test string — ground truth,
not the model's opinion of itself
│
┌─────────┴─────────┐
all pass something failed
│ │
▼ ▼
done feed the exact failures
back to the model, try again
Demo
A real run: "US phone number" → the agent writes 16 test strings, proposes a candidate regex,
checks it against Python's real re engine, and converges on a verified pattern in 2 iterations.

<details> <summary>Full page + live tester screenshot</summary>

</details>
What's in here
-
regex_agent/core.py— the actual agent loop (model-agnostic of transport). Everything else is a thin wrapper around this. -
mcp_server/— a real MCP server exposinggenerate_verified_regexas a tool, so it can be used directly from Claude Desktop or Claude Code. -
web/— a FastAPI + vanilla-JS demo with two parts:- A live, animated view of the agent's reasoning: test cases, each candidate regex, and the pass/fail table per iteration.
- A regex101-style live tester underneath — an editable pattern field with flags
(
g/i/m/s/full-match), live match highlighting against your own test string, a match list with capture groups, and a plain-English token-by-token breakdown of the regex (all client-side, no API calls). It auto-fills with whatever the agent just verified, but works standalone for any regex you paste in — useful even if you already know regex and just want to test one.
No MCP client required — runs in a browser.
Setup
pip install -r requirements.txt
cp .env.example .env # then add your GROQ_API_KEY
Run the web demo
cd web
python server.py
Open http://127.0.0.1:8000.
Run the MCP server
Add this to your MCP client config (e.g. Claude Desktop's claude_desktop_config.json,
or .claude/settings.json for Claude Code):
{
"mcpServers": {
"verified-regex-generator": {
"command": "python",
"args": ["/absolute/path/to/2 project/mcp_server/server.py"]
}
}
}
Then ask Claude something like "Use the verified regex generator to build me a regex for a US phone number." — it will call the tool, which runs the full generate → test → verify loop server-side and returns a JSON report.
Why this is a good showcase
Most "AI writes code" demos stop at generation. This one treats the LLM's first answer as a
hypothesis, not an answer — and only claims success once it's checked against ground truth
(the real regex engine, on real strings, including adversarial near-misses the model itself
proposes). That loop — generate → verify → revise — is the core pattern behind reliable
agentic tools, and it's small enough to read end-to-end in regex_agent/core.py.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。