Provides code search capabilities across public GitHub repositories and tools for retrieving single or multiple files from repositories, with support for filtering by language, repository, and file path.
Grep App MCP Server
A Model Context Protocol (MCP) server that provides powerful code search capabilities across public GitHub repositories using the grep.app API. Perfect for code discovery, learning from open source projects, and finding implementation examples.
š Features
š Advanced Code Search: Search across millions of public repositories on GitHub
š File Retrieval: Fetch specific files or batches of files from GitHub
šÆ Flexible Filtering: Filter by language, repository, file path, and more
š Multiple Output Formats: JSON, numbered lists, or formatted text
ā” Batch Operations: Retrieve multiple files efficiently in parallel
š Result Caching: Cache search results for quick file retrieval
š Comprehensive Logging: Built-in logging with daily rotation
š ļø Installation & Setup
Prerequisites
Node.js 18+
npm or yarn
Claude Code CLI
Quick Start
Clone or download this repository
git clone https://github.com/ai-tools-all/grep_app_mcp.git cd grep_app_mcpInstall dependencies
npm installBuild the project
npm run buildTest the server
# HTTP mode (recommended for development) ./run.sh http dev # or STDIO mode ./run.sh stdio dev
š§ Adding to Claude Code
Method 1: Using MCP Configuration
Add this server to your Claude Code MCP configuration:
Method 2: Using HTTP Transport
For HTTP mode, add to your configuration:
Then start the server:
š run.sh Usage
The run.sh script provides convenient ways to start the server:
Basic Usage
Modes
http- HTTP server with streaming support (default)stdio- STDIO server for direct MCP integration
Environments
dev- Development mode with hot reload (default)prod- Production mode (requires build step)
Examples
HTTP Endpoints (when using HTTP mode)
HTTP Streaming:
http://localhost:8603/mcpServer-Sent Events:
http://localhost:8603/sse
šØ Available Tools
1. searchCode
Search for code across public GitHub repositories.
Parameters:
query(required) - Search query stringjsonOutput- Return JSON format (default: false)numberedOutput- Return numbered list format (default: false)caseSensitive- Case-sensitive searchuseRegex- Treat query as regex patternwholeWords- Search whole words onlyrepoFilter- Filter by repository name patternpathFilter- Filter by file path patternlangFilter- Filter by programming language(s)
Example:
2. github_file
Fetch a single file from a GitHub repository.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository namepath(required) - File pathref(optional) - Branch/commit/tag reference
Example:
3. github_batch_files
Fetch multiple files from GitHub repositories in parallel.
Parameters:
files(required) - Array of file objects with owner, repo, path, and optional ref
Example:
4. batch_retrieve_files
Retrieve files from previously cached search results.
Parameters:
query(required) - Original search queryresultNumbers(optional) - Array of result indices to retrieve
Example:
šÆ Common Workflows
1. Code Discovery
2. Learning Patterns
3. API Research
š Development
Available Scripts
npm run build- Build TypeScript to JavaScriptnpm run start- Start production HTTP servernpm run start-stdio- Start production STDIO servernpm run dev- Start development HTTP server with hot reloadnpm run dev-stdio- Start development STDIO server with hot reloadnpm run test-client- Run test client
Project Structure
š Logging
The server includes comprehensive logging with daily rotation:
Location:
logs/directoryRotation: Daily with date-based filenames
Levels: error, warn, info, debug
Format: JSON with timestamps
š¤ Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
š License
ISC License - see package.json for details
š Related
grep.app - The search service powering this tool
Model Context Protocol - MCP specification
Claude Code - Claude's official CLI