MCP-Grep
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A grep server implementation that exposes grep functionality through the Model Context Protocol (MCP).
Installation
Installing via Smithery
To install Grep Server for Claude Desktop automatically via Smithery:
Manual Installation
Usage
MCP-Grep runs as a server that can be used by MCP-compatible clients:
The server exposes the following MCP functionality:
- **Resource:** grep://info - Returns information about the system grep binary
- **Tool:** grep - Searches for patterns in files using the system grep binary
Features
- Information about the system grep binary (path, version, supported features)
- Search for patterns in files using regular expressions
- Support for common grep options:
- Case-insensitive matching
- Context lines (before and after matches)
- Maximum match count
- Fixed string matching (non-regex)
- Recursive directory searching
- Natural language prompt understanding for easier use with LLMs
- Interactive debugging and testing through MCP Inspector
Example API Usage
Using the MCP Python client:
Natural Language Prompts
MCP-Grep understands natural language prompts, making it easier to use with LLMs. Examples:
MCP Inspector Integration
MCP-Grep includes an MCP Inspector integration for interactive debugging and testing:
This opens a web-based UI where you can:
- Explore available resources and tools
- Test grep operations with different parameters
- View formatted results
- Debug issues with your grep queries
Development
License
MIT