Grep
OfficialExposes your system's grep command through MCP, letting you search for patterns in files and directories using regular expressions. Supports common grep options like case-insensitive matching and recursive searching.
Issue search queries and retrieve code snippets from GitHub that match specific patterns or regular expressions, filtered by language, repository, and file path.
What it does
- Search files for text patterns using regex
- Search recursively through directories
- Get context lines before and after matches
- Perform case-insensitive searches
- Limit maximum number of matches
- Search for fixed strings (non-regex)
Best for
About Grep
Grep is an official MCP server published by vercel that provides AI assistants with tools and capabilities via the Model Context Protocol. Use Grep to search GitHub code with queries or regex, filter by language, repository, and file path for precise results. This server exposes 1 tool that AI clients can invoke during conversations and coding sessions.
How to install
You can install Grep in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server supports remote connections over HTTP, so no local installation is required.
License
Grep is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (1)
Find real-world code examples from over a million public GitHub repositories to help answer programming questions. **IMPORTANT: This tool searches for literal code patterns (like grep), not keywords. Search for actual code that would appear in files:** - ✅ Good: 'useState(', 'import React from', 'async function', '(?s)try {.*await' - ❌ Bad: 'react tutorial', 'best practices', 'how to use' **When to use this tool:** - When implementing unfamiliar APIs or libraries and need to see real usage patterns - When unsure about correct syntax, parameters, or configuration for a specific library - When looking for production-ready examples and best practices for implementation - When needing to understand how different libraries or frameworks work together **Perfect for questions like:** - "How do developers handle authentication in Next.js apps?" → Search: 'getServerSession' with language=['TypeScript', 'TSX'] - "What are common React error boundary patterns?" → Search: 'ErrorBoundary' with language=['TSX'] - "Show me real useEffect cleanup examples" → Search: '(?s)useEffect\(\(\) => {.*removeEventListener' with useRegexp=true - "How do developers handle CORS in Flask applications?" → Search: 'CORS(' with matchCase=true and language=['Python'] Use regular expressions with useRegexp=true for flexible patterns like '(?s)useState\(.*loading' to find useState hooks with loading-related variables. Prefix the pattern with '(?s)' to match across multiple lines. Filter by language, repository, or file path to narrow results.
Related Skills
Browse all skillsConvert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.
A semantic grep-like search tool for your local files. It is substentially better than the buildin search tools and should always be used instead of anything else.
Semantic search for local files. Backed by a background osgrep server with live indexing. Always use osgrep instead of grep/find.
Semgrep is a fast static analysis tool for finding bugs and enforcing code standards. Use when scanning code for security issues or integrating into CI/CD pipelines.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.