Ceregrep MCP Server
MCP (Model Context Protocol) server that exposes ceregrep query capabilities to other agents.
What is This?
This MCP server allows any MCP-compatible agent (like Claude Desktop) to use ceregrep as a tool for querying and analyzing codebases. Instead of the agent manually using bash and grep, it can ask ceregrep (which has its own LLM-powered analysis) to find context.
Features
- ceregrep_query: Query ceregrep to find context in codebases
- Natural language queries (e.g., "Find all async functions", "Explain the auth flow")
- Automatic code exploration using ceregrep's bash + grep tools
- LLM-powered analysis and context gathering
Prerequisites
-
Ceregrep CLI installed globally:
npm install -g ceregrep
-
Python ≥ 3.10 (for pip installation) or uvx (for no-install usage)
Installation
Option 1: Using uvx (Recommended - No Installation Required)
# No installation needed! Just use uvx to run it
uvx ceregrep-mcp
Option 2: Install via pip
pip install ceregrep-mcp
Option 3: Install from source (Development)
cd mcp-server
pip install -e .
Usage
Using with uvx (Recommended)
The easiest way to use ceregrep-mcp is with uvx, which runs the package without installation:
uvx ceregrep-mcp
Add to Claude Desktop
Method 1: Using Claude MCP CLI (Easiest)
claude mcp add ceregrep uvx ceregrep-mcp
This automatically adds ceregrep-mcp to your Claude configuration.
Method 2: Manual Configuration
Edit your Claude Desktop MCP configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"ceregrep": {
"command": "uvx",
"args": ["ceregrep-mcp"]
}
}
}
If you installed via pip:
{
"mcpServers": {
"ceregrep": {
"command": "ceregrep-mcp"
}
}
}
Add to Other MCP Clients
For any MCP-compatible client, add to your mcp.json or equivalent config file:
{
"mcpServers": {
"ceregrep": {
"command": "uvx",
"args": ["ceregrep-mcp"],
"env": {}
}
}
}
Add to Ceregrep Itself (Recursive Pattern)
You can even use ceregrep's own MCP client to connect to this server! Add to .ceregrep.json or ~/.ceregrep.json:
{
"mcpServers": {
"ceregrep-context": {
"type": "stdio",
"command": "uvx",
"args": ["ceregrep-mcp"]
}
}
}
Now ceregrep can delegate context-finding to another instance of itself!
Available Tools
ceregrep_query
Query ceregrep to find context in a codebase.
Parameters:
query(required): Natural language querycwd(optional): Working directory to run ceregrep inmodel(optional): LLM model to useverbose(optional): Enable verbose output
Example queries:
- "Find all async functions in this codebase"
- "Explain how the authentication system works"
- "Show me all API endpoints"
- "Find files that handle database connections"
- "Analyze the project architecture"
How It Works
- Agent sends a natural language query to ceregrep_query tool
- MCP server invokes the ceregrep CLI with the query
- Ceregrep uses its own LLM + bash + grep tools to explore the codebase
- Results are returned to the requesting agent
This creates a recursive agent pattern where agents can delegate complex context-finding to specialized sub-agents.
Configuration
The MCP server uses the ceregrep CLI, which reads configuration from:
.ceregrep.jsonin the working directory~/.config/ceregrep/config.json(global config)- Environment variables (
ANTHROPIC_API_KEY,CEREBRAS_API_KEY)
Development
Project Structure
mcp-server/
├── mcp_server.py # Main MCP server
├── tool_discovery.py # Auto-discovery system
├── tools/
│ ├── base_tool.py # Base tool class
│ └── ceregrep_query_tool.py # Ceregrep query tool
├── pyproject.toml # Dependencies
└── README.md # This file
Adding New Tools
- Create a new file in
tools/ - Inherit from
BaseTool - Implement
name,description,input_schema, andexecute() - Restart server - tool is auto-discovered!
Troubleshooting
"ceregrep command not found"
Run npm link in the ceregrep-client directory to install the CLI globally.
MCP connection errors
Ensure Python ≥ 3.10 and uv are installed:
python --version # Should be ≥ 3.10
uv --version # Should be installed
Query failures
Check ceregrep configuration:
ceregrep config # View current config
Ensure API keys are set:
ANTHROPIC_API_KEYfor ClaudeCEREBRAS_API_KEYfor Cerebras
License
AGPL-3.0-or-later
Metadata
Release files for ceregrep-mcp 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ceregrep_mcp-0.2.2.tar.gz | 7.2 kB | Without provenance | Details for ceregrep_mcp-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ceregrep_mcp-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for ceregrep_mcp-0.2.2-py3-none-any.whl |
Total release size: 15.2 kB
Release files / ceregrep_mcp-0.2.2.tar.gz
| Download URL | ceregrep_mcp-0.2.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
318c6b0893aca2facf6e4402f4fd53b19bdf5c2450359a02062697ac4260ccac
|
|
BLAKE2b-256 checksum How to use checksums |
ea19bda0dda8e412e1037c98a1ec72fc295afec3566c9bc8416890fb2d16ae04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / ceregrep_mcp-0.2.2-py3-none-any.whl
| Download URL | ceregrep_mcp-0.2.2-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5cd901d62b1cda23bfbeecbbcffee644d0fe0d33d041de891143dcac19a07385
|
|
BLAKE2b-256 checksum How to use checksums |
9bc0d3c0a7482c8c64cb341181e761e4e20455fc2d2c41bf6b3971e796930a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Security for ceregrep-mcp 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.