Guide
Add document search to pi
After this, pi can answer from your own documents and quote the page it read. One command does it, and the file it writes is shown below for a reader who prefers the file.
1. Give pi the tool
Paste this into a pi session and let it work:
Fetch https://retrievr.io/install and follow it.The sheet gets a key without printing it, writes it to ~/.config/retrievr/credentials, and downloads the MCP server to ~/.config/retrievr/mcp.mjs.
2. Register the server — one command
pi has a CLI for this, so the shell expands the path for you:
pi mcp add retrievr -- node ~/.config/retrievr/mcp.mjsThat writes the entry into ~/.pi/agent/mcp.json. If you would rather add it yourself, this is what lands in the file — note that the path is absolute here, because a JSON argument reaches node without a shell and nothing expands a tilde:
{
"mcpServers": {
"retrievr": {
"command": "node",
"args": ["/home/you/.config/retrievr/mcp.mjs"]
}
}
}The CLI form and the file form disagree about ~ for a real reason: the command is a shell line and the file is not. Both are correct where they are written, and copying either into the other place is the mistake.
The shape is checked against pi’s own repository.
3. Check it loaded
Start a new session — the tool list is read when one starts — and look for retrievr with five tools: retrievr_search, retrievr_documents, retrievr_upload, retrievr_upload_status and retrievr_delete_document.
4. Ask it something
Add a document from your library — the first five are free — then ask:
In the agreement, what does it say about renewal?
Which of my documents mentions the invoice?Passages come back with the page, the character range and the licence. The service is always ready: a query is answered in well under a second.
When the tool does not appear
If you used pi mcp add, the path was expanded by your shell and is already absolute — open ~/.pi/agent/mcp.json and confirm it. If you edited the file by hand and copied the CLI form, the tilde survived and node is looking for a directory literally named ~.
The other cause is the session: pi reads its servers when a session starts, so the one you have open predates the entry. Start a new one before concluding anything.
What it costs
$0.01 per query, charged when it is accepted; uploading and indexing are free. The full price list, or the same guide for Kiro or Claude Code.