grep.app Code Search
About
Search code across millions of public GitHub repositories using the grep.app API.
Details
- Author
- galprz
- Categories
- Search, Other, Developer Tools
Jump to
Setup
Install grep.app Code Search in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/galprz/grep-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
AModel Context Protocol (MCP)server that provides GitHub code search capabilities through thegrep.appAPI. This server enables AI assistants to search through millions of GitHub repositories for specific code patterns, functions, and implementations.
- π GitHub Code Search: Search across millions of GitHub repositories using grep.app's powerful search index
- π― Advanced Filtering: Filter results by programming language, repository, and file path
- π Smart Formatting: Results include syntax highlighting, repository grouping, and summary statistics
- β‘ High Performance: Async implementation with proper error handling and rate limiting
- π οΈ Multiple Transport Modes: Supports both stdio and SSE (Server-Sent Events) transport
- π Rich Results: Returns file paths, line numbers, code snippets, and repository information
- Python: 3.10 or higher
- Dependencies:
- mcp- Model Context Protocol framework
- starlette- Web framework for SSE transport
- uvicorn- ASGI server
- aiohttp- Async HTTP client for API requests
# Install directly from PyPI uv add grep-mcp # Or install from source git clone https://github.com/galperetz/grep-mcp.git cd grep-mcp uv sync
{ "mcpServers": { "grep-mcp": { "command": "uvx", "args": ["grep-mcp"] } } }
# Run with stdio transport (default) python -m grep_mcp # Run with SSE transport python -m grep_mcp --transport sse --host 0.0.0.0 --port 8080
- --transport: Choose betweenstdio(default) orsse
- --host: Host to bind to for SSE mode (default:0.0.0.0)
- --port: Port to listen on for SSE mode (default:8080)
Search GitHub repositories for specific code patterns.
- query(required): The search query string
- language(optional): Programming language filter (e.g., "Python", "JavaScript")
- repo(optional): Repository filter in format "owner/repo" (e.g., "fastapi/fastapi")
- path(optional): Path filter for specific directories (e.g., "src/")
# Basic search grep_query("async def main") # Search Python files only grep_query("FastAPI", language="Python") # Search specific repository grep_query("class Config", repo="fastapi/fastapi") # Search in specific directory grep_query("import", path="src/") # Combined filters grep_query("async def", language="Python", repo="fastapi/fastapi")
{ "query": "your search query", "summary": { "total_results": 12345, "results_shown": 10, "repositories_found": 4, "top_languages": [ { "language": "Python", "count": 8500 }, { "language": "JavaScript", "count": 2000 } ], "top_repositories": [{ "repository": "owner/repo", "count": 150 }] }, "results_by_repository": [ { "repository": "owner/repo", "matches_count": 89, "files": [ { "file_path": "src/main.py", "branch": "main", "total_matches": 5, "line_numbers": [10, 25, 30], "language": "python", "code_snippet": "python\nasync def main():\n app = FastAPI()\n return app\n`" } ] } ] }
- FastMCP Framework: Built on the FastMCP framework for easy MCP server development
- Async HTTP Client: Uses aiohttp for non-blocking API requests
- Response Formatting: Intelligent parsing and formatting of grep.app responses
- Error Handling: Comprehensive error handling for API failures, timeouts, and rate limits
- Transport Flexibility: Supports both stdio and web-based SSE transport modes
The server handles various error conditions gracefully:
- Rate Limiting: Automatic detection and user-friendly error messages
- Network Timeouts: 30-second timeout with proper error reporting
- API Failures: Graceful handling of grep.app API issues
- Invalid Parameters: Comprehensive parameter validation with helpful error messages
# Using uv uv run pytest # Using pytest directly pytest tests/``
- MCP server initialization
- Tool parameter validation
- Error handling scenarios
- Response formatting
- Platform compatibility
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes with tests
- Run the test suite:uv run pytest
- Format code:uv run black . && uv run isort .
- Commit changes:git commit -m 'Add amazing feature'
- Push to branch:git push origin feature/amazing-feature`- Open a Pull Request
This project is licensed under the MIT License - see theLICENSEfile for details.
- grep.appfor providing the excellent GitHub search API
- MCP (Model Context Protocol)for the protocol specification
- FastMCPfor the server framework
- Issues:GitHub Issues
- Repository:GitHub Repository
Made with β€οΈ for the AI development community
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Search code across public GitHub repositories using the grep.app API.
Search all of GitHub from your AI agent β find libraries, drill into repos, find code patterns.
A local-first semantic code search tool with vector and regex capabilities, designed for AI assistants.
Code search and querying using the Greptile API.
A semantic search server for codebases using Qdrant, featuring intelligent GitHub issue and project management.
About Semantic code-search (semcode) MCP. Indexes code symbols and commit history. Combines dense embeddings with sparse BM25 vectors for hybrid search that balances semantic understanding with keyword precision.
Creates a massive, searchable knowledge base from numerous curated and auto-discovered GitHub projects.
Persistent code index using Tree-sitter for fast, precise code search. Replaces grep with ~50 token responses instead of 2000+.
A platform-agnostic code analysis library with semantic search capabilities and MCP server support.
A modular MCP server for code analysis, supporting file operations, code search, and structure analysis.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




