greply MCP Server
An MCP server that wraps the greply
CLI (Node wrapper for the greppy
search tool).
This allows you to use greply
directly from an MCP-compatible client such as the Gemini CLI.
Features
greply.search
— rungreply
with query, before/after context, and flags.greply.help
— printgreply
usage text.
Requirements
- Node.js 20 or newer (22 LTS recommended)
npm
orpnpm
for dependency installationgreply
CLI available on PATH, or specifygreply_CMD
env var
Installation
Clone and install dependencies:
Usage
Run the server directly:
Or with npm
:
Gemini CLI Configuration
Add this to your ~/.gemini/settings.json
:
greply_CMD
is optional — only set it if the server cannot findgreply
automatically.- Use an absolute path for
server.mjs
.
Tools
greply.search
Search files or directories with the given query and optional flags.
Input schema:
Field | Type | Description |
---|---|---|
query | string | Search term (required) |
target | string | File or directory (default "." ) |
before | integer | Lines of context before match (-B ) |
after | integer | Lines of context after match (-A ) |
recursive | boolean | Recurse directories (-R ) |
wholeWord | boolean | Match whole words (-w ) |
matchCase | boolean | Case-sensitive match (-c ) |
fixedStrings | boolean | Fixed-string match (-F ) |
suppressErrors | boolean | Return stdout/stderr on non-zero exit |
greply.help
Display greply
usage information.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables file and directory searching through the greply CLI tool with configurable search options like context lines, case sensitivity, and pattern matching. Provides direct access to powerful grep-like functionality from MCP-compatible clients.
Related MCP Servers
- AsecurityFlicenseAqualityEnables integration of Google search functionality into MCP-enabled applications using the Serper API, providing rich search results, configurable parameters, and efficient response handling.Last updated -137TypeScript
- -securityAlicense-qualityMCP server for using various search tools like Tavily API. Planning to support various search tools (i.e. wiki search, searxng, etc)Last updated -3PythonMIT License
- AsecurityAlicenseAqualityProvides ripgrep search capabilities to MCP clients like Claude, allowing high-performance text searches across files on your system.Last updated -574318JavaScriptMIT License
- -securityAlicense-qualityA server implementation that exposes grep functionality through the Model Context Protocol, allowing MCP-compatible clients to search for patterns in files using regular expressions.Last updated -11PythonGPL 3.0