← Back to Chronicle

TextGrep MCP

THE DEADLY DUO // DECEMBER 2025

The Headline Number

250-500x
Faster than PowerShell Select-String

25 seconds became <100ms. Same results. Structured output. No ANSI garbage.

The Problem

AI agents need to search inside files. Not just find files—read their contents, extract patterns, understand code. The existing options:

Method Speed Output Verdict
PowerShell Select-String ~25 seconds Lines + ugly ANSI codes Unusable for iteration
Everything content search 500-2000ms Filenames only No content extraction
Load files into context Variable Full files Token-expensive
"Before TextGrep, searching file contents meant either waiting 25 seconds for PowerShell to chug, or burning thousands of tokens loading entire files hoping the answer was somewhere inside."
- DC, Desktop Claude

The Deadly Duo

Everything MCP

WHERE are the files?

<100ms file discovery

Indexed search across entire filesystem

+

TextGrep MCP

WHAT's inside?

<100ms content extraction

Surgical line/pattern retrieval

Everything finds the needle's location. TextGrep pulls exactly what's needed from it. Together: surgical precision instead of dumping the whole haystack into context.

Benchmark: Real World

Task: Find all Rust projects using Tokio

# PowerShell (the old way)
Get-ChildItem "X:\dev\*.toml" -Recurse | Select-String "tokio"
→ 25,537ms (25+ seconds)
→ Output cluttered with ANSI escape codes

# TextGrep (the new way)
textgrep:grep_files paths="X:\dev\**\*.toml" pattern="tokio"
→ <100ms
→ Clean JSON: {"files": [...], "count": 5}
        
25.5s
PowerShell
<0.1s
TextGrep

Context Efficiency

Speed is one thing. But the real win is token efficiency—how much context an AI agent burns to get answers.

Scenario Old Way With TextGrep Savings
"Find all tokio versions" Load 15 Cargo.toml (~3000 tokens) Extract 5 lines (~50 tokens) 98%
"Where's that error handler?" Read 10 .rs files (~8000 tokens) grep + context (~100 tokens) 99%
"Compare two configs" Load both files fully compare_files → just diffs 80-95%
"60-95% token reduction on file investigation tasks. That's not incremental—that's a different game."
- DC

Capabilities

Feature PowerShell Everything TextGrep
Line numbers
Context lines (before/after) Manual ✓ Built-in
Regex capture groups Clunky ✓ Native
Unique extraction Manual ✓ One param
File comparison/diff External tool ✓ Built-in
Search & Replace preview
Recursive globs Get-ChildItem
Structured JSON output

Tool Arsenal

Core Search

Extraction

Analysis

Modification

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    AI AGENT (DC/KALIC)                      │
├─────────────────────────────────────────────────────────────┤
│  "Find tokio versions in project"                           │
│                                                             │
│  Step 1: everything_search "*.toml"     → File locations    │
│  Step 2: textgrep:grep "tokio"          → Exact lines       │
│  Step 3: Extract version numbers        → Structured data   │
│                                                             │
│  Total context used: ~50 tokens (vs ~3000 old way)          │
└─────────────────────────────────────────────────────────────┘
        

The combination enables a new operational pattern: locate → extract → act. No more loading entire files hoping the answer is inside. No more waiting for slow searches. No more parsing messy output.

Implementation

Rust
Language
MCP
Protocol
14
Tools
<1MB
Binary Size

Built on the regex crate for pattern matching, glob for file discovery, and standard Rust I/O for speed. No external dependencies. Instant startup. Minimal memory footprint.