A complete WarpGrep implementation in Python. No SDK needed — just requests and ripgrep.
This is the same protocol that the TypeScript SDK uses under the hood. Use this as a reference for building WarpGrep integrations in any language.
- Python 3.10+
- ripgrep installed (
brew install ripgrep/apt install ripgrep)
pip install -r requirements.txtMORPH_API_KEY=your-key python search.pySearch a specific repo:
MORPH_API_KEY=your-key python search.py "Find auth middleware" /path/to/repoThe agent runs a multi-turn conversation with the morph-warp-grep-v1 model:
- Send the repo structure + search query to the API
- Parse XML tool calls (
<grep>,<read>,<list_directory>,<finish>) from the response - Execute tools locally using ripgrep and file reads
- Format results as XML and send them back
- Repeat until the model calls
<finish>(max 4 turns)
Each component (API client, XML parser, tool executors, result formatter, agent loop) is clearly separated in the code.