MCP Grep Server
Project description
MCP-Grep
A grep server implementation that exposes grep functionality through the Model Context Protocol (MCP).
Installation
pip install mcp-grep
Usage
MCP-Grep runs as a server that can be used by MCP-compatible clients:
# Start the MCP-Grep server
mcp-grep-server
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
Example API Usage
Using the MCP Python client:
from mcp.client import MCPClient
# Connect to the MCP-Grep server
client = MCPClient()
# Get information about the grep binary
grep_info = client.get_resource("grep://info")
print(grep_info)
# Search for a pattern in files
result = client.use_tool("grep", {
"pattern": "search_pattern",
"paths": ["file.txt", "directory/"],
"ignore_case": True,
"recursive": True
})
print(result)
Development
# Clone the repository
git clone https://github.com/erniebrodeur/mcp-grep.git
cd mcp-grep
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_grep-0.1.1.tar.gz.
File metadata
- Download URL: mcp_grep-0.1.1.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f76ff908aef694dab79876390027c17d1aefa82b130c251a5f943c66d1a807d
|
|
| MD5 |
aa4a00367bef08ea375e93098acaf73f
|
|
| BLAKE2b-256 |
614b74a67f767b803af942ef34c25df14f5121cadacfd2446e11621114d19906
|
Provenance
The following attestation bundles were made for mcp_grep-0.1.1.tar.gz:
Publisher:
python-publish.yml on erniebrodeur/mcp-grep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_grep-0.1.1.tar.gz -
Subject digest:
5f76ff908aef694dab79876390027c17d1aefa82b130c251a5f943c66d1a807d - Sigstore transparency entry: 185852795
- Sigstore integration time:
-
Permalink:
erniebrodeur/mcp-grep@9818b06679fbc24739b9d989dc05da7fbfa7321e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/erniebrodeur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9818b06679fbc24739b9d989dc05da7fbfa7321e -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_grep-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_grep-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90059ca2e4dd3e2328c61d253c9ff5fe8c08b11f83fa1c2ba80768a82060b3a1
|
|
| MD5 |
22647d266039aa93ad8e08e5a53921c9
|
|
| BLAKE2b-256 |
9981f3f260b93d3cf29336afc89aba5380803f2572fda0a473b87739adf31892
|
Provenance
The following attestation bundles were made for mcp_grep-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on erniebrodeur/mcp-grep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_grep-0.1.1-py3-none-any.whl -
Subject digest:
90059ca2e4dd3e2328c61d253c9ff5fe8c08b11f83fa1c2ba80768a82060b3a1 - Sigstore transparency entry: 185852796
- Sigstore integration time:
-
Permalink:
erniebrodeur/mcp-grep@9818b06679fbc24739b9d989dc05da7fbfa7321e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/erniebrodeur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9818b06679fbc24739b9d989dc05da7fbfa7321e -
Trigger Event:
release
-
Statement type: