grep.app Code Search logo

grep.app Code Search

Community
galprz

Search code across millions of public GitHub repositories using the grep.app API.

Publishergalprz
Repositorygrep-mcp
LanguagePython
Forks
4
Stars
40
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    grep.app Code Search exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    40 stars and 4 forks from the linked repository.

Grep MCP Server

A Model Context Protocol (MCP) server that provides GitHub code search capabilities through the grep.app API. This server enables AI assistants to search through millions of GitHub repositories for specific code patterns, functions, and implementations.

🚀 Features

  • 🔍 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

📋 Requirements

  • 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

🔧 Installation

Using uv (Recommended)

bash
# 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

Using pip

bash
pip install grep-mcp

🎯 Usage

As MCP Server (Recommended)

Add to your MCP client configuration:

json
{
  "mcpServers": {
    "grep-mcp": {
      "command": "uvx",
      "args": ["grep-mcp"]
    }
  }
}

Direct Execution

bash
# 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

Command Line Arguments

  • --transport: Choose between stdio (default) or sse
  • --host: Host to bind to for SSE mode (default: 0.0.0.0)
  • --port: Port to listen on for SSE mode (default: 8080)

🔧 Available Tools

grep_query

Search GitHub repositories for specific code patterns.

Parameters:

  • 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/")

Examples:

python
# 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")

📊 Response Format

The tool returns structured JSON with:

json
{
  "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```"
        }
      ]
    }
  ]
}

🏗️ Architecture

  • 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

🛡️ Error Handling

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

🧪 Testing

Run the test suite:

bash
# Using uv
uv run pytest

# Using pytest directly
pytest tests/

Test coverage includes:

  • MCP server initialization
  • Tool parameter validation
  • Error handling scenarios
  • Response formatting
  • Platform compatibility

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes with tests
  4. Run the test suite: uv run pytest
  5. Format code: uv run black . && uv run isort .
  6. Commit changes: git commit -m 'Add amazing feature'
  7. Push to branch: git push origin feature/amazing-feature
  8. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Support


Made with ❤️ for the AI development community

Use grep.app Code Search MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once grep.app Code Search is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add grep.app Code Search as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the grep.app Code Search MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "grep-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the grep.app Code Search MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the grep.app Code Search MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use grep.app Code Search to help me with this task?
grep.app Code Search
Sure. I read it.
Here is what I found using grep.app Code Search.

Frequently asked questions

What is the grep.app Code Search MCP server used for?

grep.app Code Search is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use grep.app Code Search MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use grep.app Code Search with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use grep.app Code Search MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With grep.app Code Search connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect grep.app Code Search MCP to TypingMind?

grep.app Code Search runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does grep.app Code Search MCP provide in TypingMind?

grep.app Code Search exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use grep.app Code Search MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If grep.app Code Search requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇