---
name: "MCP tools for code search (grep and glob)"
---

# Story 348: MCP tools for code search (grep and glob)

## User Story

As a non-Claude agent connected via MCP, I want search tools so that I can find files and search code contents in my worktree.

## Acceptance Criteria

- [ ] grep tool — searches file contents with regex support, returns matching lines with context
- [ ] glob tool — finds files by pattern (e.g. '**/*.rs')
- [ ] Both scoped to the agent's worktree
- [ ] grep supports output modes: content (matching lines), files_with_matches (just paths), count
- [ ] grep supports context lines (-A, -B, -C)
- [ ] Results limited to prevent overwhelming the LLM context

## Out of Scope

- TBD
