local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Exposes the system grep binary functionality through MCP, allowing for searching patterns in files using regular expressions, with support for case-insensitive matching, context lines, maximum match count, fixed string matching, and recursive directory searching.
Mentioned as part of the development workflow, but not as a primary integration target for the MCP server.
Used for implementation and client access, but not as a primary integration target for the MCP server.
MCP-Grep
通过模型上下文协议 (MCP) 公开 grep 功能的 grep 服务器实现。
安装
用法
MCP-Grep 作为服务器运行,可供 MCP 兼容客户端使用:
该服务器公开以下 MCP 功能:
- 资源:
grep://info
- 返回有关系统 grep 二进制文件的信息 - 工具:
grep
- 使用系统 grep 二进制文件搜索文件中的模式
特征
- 有关系统 grep 二进制文件的信息(路径、版本、支持的功能)
- 使用正则表达式在文件中搜索模式
- 支持常见的 grep 选项:
- 不区分大小写的匹配
- 上下文行(匹配之前和之后)
- 最大匹配数
- 固定字符串匹配(非正则表达式)
- 递归目录搜索
- 自然语言提示理解,更易于与法学硕士 (LLM) 一起使用
- 通过 MCP Inspector 进行交互式调试和测试
API 使用示例
使用 MCP Python 客户端:
自然语言提示
MCP-Grep 能够理解自然语言提示,使其更易于与 LLM 一起使用。示例:
MCP 检查器集成
MCP-Grep 包含一个 MCP Inspector 集成,用于交互式调试和测试:
这将打开一个基于 Web 的用户界面,您可以在其中执行以下操作:
- 探索可用的资源和工具
- 使用不同的参数测试 grep 操作
- 查看格式化的结果
- 调试 grep 查询的问题
发展
执照
麻省理工学院
This server cannot be installed
通过模型上下文协议公开 grep 功能的服务器实现,允许 MCP 兼容客户端使用正则表达式在文件中搜索模式。