reveng游标正则表达式mcp
rev-eng-cursor-regex-mcp 是一个可移植的TypeScript模型上下文协议服务器,用于在本地工作区进行快速文字和正则表达式搜索。它使用稀疏n元语法索引进行候选修剪,然后对真实文件内容进行确定性验证。
特性
index.ensure,index.status,以及index.clear用于本地索引生命周期管理- 自动
.gitignore本地引导.rev-eng-cursor-regex-mcp/当缓存位于工作区内时进行缓存 search.literal用于精确字符串搜索search.regex用于使用稀疏n元语法规划的ECMAScript正则表达式搜索query.explain用于锚点提取和回退分析document.inspect_terms用于三元组、掩码三元组和稀疏项诊断- 用于算法注释、存储布局和代理工作流指导的静态资源
- 用于调查流程和正则表达式优化的可重用提示
stdio以及可流式传输的HTTP入口点
需求
- Node.js 20或更新版本
从源头快速开始
npm install
npm run build
npm run start:stdio这将通过stdio从新克隆启动MCP服务器,无需全局安装。
运行模式
从本地克隆运行stdio:
npm run start:stdio从本地克隆运行Streamable HTTP:
npm run start:http直接运行构建的CLI:
node dist/cli.js stdio
node dist/cli.js http --host 127.0.0.1 --port 3333在包发布后不进行克隆运行:
npx rev-eng-cursor-regex-mcp stdio
npx rev-eng-cursor-regex-mcp http --host 127.0.0.1 --port 3333环境
REV_ENG_CURSOR_REGEX_MCP_WORKSPACE_ROOT:默认工作区根目录REV_ENG_CURSOR_REGEX_MCP_INDEX_DIR:父目录,其中.rev-eng-cursor-regex-mcp/创建REV_ENG_CURSOR_REGEX_MCP_BOOTSTRAP_GITIGNORE:设置为时false,0,off,或no,自动跳过.gitignore自举REV_ENG_CURSOR_REGEX_MCP_HTTP_HOST:默认HTTP绑定主机REV_ENG_CURSOR_REGEX_MCP_HTTP_PORT:默认HTTP绑定端口
验证新克隆
npm install
npm run typecheck
npm test
npm run buildClaude桌面示例
{
"mcpServers": {
"rev-eng-cursor-regex-mcp": {
"command": "node",
"args": [
"/absolute/path/to/rev-eng-cursor-regex-mcp/dist/cli.js",
"stdio"
]
}
}
}备注
- Git工作区使用提交键控基索引和可变覆盖来更改工作树。
index.ensure将缓存目录添加到.gitignore当缓存根位于工作区内时自动执行。通过bootstrapGitignore: false或设置REV_ENG_CURSOR_REGEX_MCP_BOOTSTRAP_GITIGNORE=false选择退出。- 非git工作区回退到快照模式
.gitignore-风格过滤。 - 忽略大小写正则表达式搜索会退回到确定性全扫描,因为稀疏索引区分大小写。
