
MCP的推荐 grep.app
概览
一款模型上下文协议(MCP)服务器,利用 grep.app API 在公共 GitHub 仓库中提供强大的代码搜索功能。非常适合代码发现、从开源项目学习以及寻找实现示例。 - : 在 GitHub 上数百万个公共仓库中搜索 - : 从GitHub获取特定文件或批量文件 - : 按语言、仓库、文件路径等筛选 - : JSON、编号列表或格式化文本 - : 高效并行检索多个文件 - : 缓存搜索结果以实现快速文件检索 - : 内置日志,带每日轮换 - Node.js 18+ - npm 或纱线 - Claude Code CLI 将此服务器添加到您的Claude Code MCP配置中: 对于HTTP模式,请在配置中添加: run.sh 脚本提供了便捷的服务器启动方式: - - 支持 流媒体的 HTTP 服务器(默认)- - STDIO 服务器用于直接集成 MCP - - 带热装填的开发模式(默认)- - 生产模式(需要构建步骤)
概述(AI 翻译)
一款模型上下文协议(MCP)服务器,利用 grep.app API 在公共 GitHub 仓库中提供强大的代码搜索功能。非常适合代码发现、从开源项目学习以及寻找实现示例。
🚀 特色
- ** 🔍 高级代码搜索**:在GitHub上数百万个公共仓库中搜索
- ** 📁 文件检索**:从GitHub获取特定文件或文件批次
- ** 🎯 灵活过滤**:按语言、仓库、文件路径等筛选
- ** 📊 多种输出格式**:JSON、编号列表或格式化文本
- ** ⚡ 批处理操作**:高效并行检索多个文件
- ** 🔄 结果缓存**:缓存搜索结果以实现快速文件检索
- ** 📝 全面日志**:内置日志,带每日轮换
🛠️ 安装与设置
先决条件
- Node.js 18+
- NPM或纱线
- Claude Code CLI
快速开始
-
克隆或下载此仓库
-
安装依赖关系
-
构建项目
-
测试服务器
🔧 添加克劳德代码
方法1:使用 MCP 配置
将此服务器添加到您的Claude Code MCP配置中:
方法2:使用 HTTP 传输
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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_mcp -
Install dependencies
npm install -
Build the project
npm run build -
Test 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:
{
"mcpServers": {
"grep_app": {
"command": "node",
"args": ["/path/to/grep_app_mcp/dist/server-stdio.js"],
"env": {}
}
}
}
Method 2: Using HTTP Transport
For HTTP mode, add to your configuration:
{
"mcpServers": {
"grep_app": {
"url": "http://localhost:8603/mcp"
}
}
}
Then start the server:
./run.sh http prod
📖 run.sh Usage
The run.sh script provides convenient ways to start the server:
Basic Usage
./run.sh [mode] [environment]
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
# Development (default) - HTTP server with hot reload
./run.sh
# Development - HTTP server
./run.sh http dev
# Production - HTTP server
./run.sh http prod
# Development - STDIO server
./run.sh stdio dev
# Production - STDIO server
./run.sh stdio prod
# Show help
./run.sh help
HTTP Endpoints (when using HTTP mode)
- HTTP Streaming:
http://localhost:8603/mcp - Server-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)
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"grep_app": {
"command": "node",
"args": ["/path/to/grep_app_mcp/dist/server-stdio.js"],
"env": {}
}
}
}