使用说明
sira-grep
Semantic search MCP server for Claude Code, wrapping jina-grep-cli with benchmarks comparing ripgrep (lexical) vs jina-grep (semantic) search.
What this project does
-
MCP Server (
src/sira_grep/mcp_server.py): Exposes jina-grep as three Claude Code tools via MCP (stdio transport):semantic_search— search files by meaningsemantic_rerank— rerank ripgrep output by relevancecode_search— NL-to-code and code-to-code search
-
Benchmarks (
benchmarks/): 20-query comparison of ripgrep vs jina-grep on a real Python codebase (~23K LOC), measuring:- Latency (cold start, warm query)
- Quality (precision, recall, MRR)
- Context size (tokens consumed, relevance ratio, wasted context)
- Exploration scenarios (simulated plan-mode sessions)
Quick start
Prerequisites
- Apple Silicon Mac (M1+)
- Python 3.13+
- uv
Install
# Clone jina-grep-cli (dependency)
git clone https://github.com/jina-ai/jina-grep-cli.git ../jina-grep-cli
# Install sira-grep
uv venv .venv && source .venv/bin/activate
uv pip install -e .
Register MCP server with Claude Code
claude mcp add --transport stdio sira-grep -- \
$(pwd)/.venv/bin/python -m sira_grep.mcp_server
Run benchmarks
python -m benchmarks.runner
# Report written to docs/04-benchmarks.md
Project structure
sira-grep/
├── src/sira_grep/
│ ├── __init__.py
│ └── mcp_server.py # MCP server (3 tools)
├── benchmarks/
│ ├── queries.py # 20 benchmark query definitions
│ ├── runner.py # Benchmark orchestration
│ ├── metrics.py # Quality metrics (P@10, R@10, MRR)
│ ├── context_analysis.py # Token counting, context efficiency
│ └── report.py # Markdown report generation
├── docs/
│ ├── 01-installation.md # jina-grep-cli install guide
│ ├── 02-mcp-integration.md # MCP setup and architecture
│ ├── 03-usage-guide.md # CLI and tool usage
│ ├── 04-benchmarks.md # Benchmark results (generated)
│ └── 05-conclusions.md # Analysis and perspectives
├── pyproject.toml
├── CLAUDE.md
└── README.md
Documentation
| Doc | Content |
|---|---|
| Installation | Complete jina-grep-cli install guide |
| MCP Integration | Architecture, tool reference |
| Usage Guide | CLI examples, model selection |
| Benchmarks | Full results with metrics |
| Conclusions | Analysis, recommendations |
Key finding
Semantic search and lexical search are complementary:
- ripgrep: instant, exact — use when you know the keyword
- jina-grep: slower, semantic — use when you know the concept
- Hybrid (
rg | jina-grep): best of both worlds
For Claude Code plan/explore phases, semantic search can reduce the number of queries needed to understand a codebase area, potentially lowering total context consumption despite larger individual results.