Powerful text searching for AI agents
## Grep MCP Server: Advanced Text Search The **Grep MCP Server** provides powerful text search capabilities directly within Google Antigravity, enabling AI assistants to search files and content using regular expressions and advanced patterns programmatically. This integration brings Unix-style text searching to your development workflow. ### Why Grep MCP? - **Regex Support**: Full regular expression support for complex pattern matching - **Recursive Search**: Search across directories and nested file structures - **Context Display**: Show surrounding lines for matched content - **Multiple Patterns**: Search for multiple patterns simultaneously - **File Filtering**: Filter searches by file type, name pattern, or modification date ### Key Features #### 1. Pattern Search ```python from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Search for all TODO comments in the src directory" }], tools=[{ "name": "grep_search", "description": "Search with patterns" }] ) ``` #### 2. Regex Matching ```python # Advanced regex search response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Find all email addresses in the log files using regex" }], tools=[{"name": "grep_regex", "description": "Regex search"}] ) ``` #### 3. Context Search ```python # Show surrounding context response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Search for error messages and show 5 lines of context around each match" }], tools=[{"name": "grep_context", "description": "Context search"}] ) ``` #### 4. Multi-Pattern ```python # Search multiple patterns response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Find all occurrences of console.log, console.error, and console.warn" }], tools=[{"name": "grep_multi", "description": "Multi-pattern search"}] ) ``` ### Configuration ```json { "mcpServers": { "grep": { "command": "npx", "args": ["-y", "@anthropic/mcp-grep"], "env": { "DEFAULT_CONTEXT_LINES": "3" } } } } ``` ### Use Cases **Code Search**: Find patterns, functions, and references across codebases. **Log Analysis**: Search log files for errors, warnings, and specific events. **Content Audit**: Search documentation and content for specific terms or patterns. **Data Extraction**: Extract matching content from large text files. The Grep MCP Server brings powerful text search directly into your development workflow, enabling sophisticated pattern matching and content discovery.
{
"mcpServers": {
"grep": {
"mcpServers": {
"grep": {
"args": [
"-y",
"grep-mcp"
],
"command": "npx"
}
}
}
}
}