pi-satori-bridge
v0.2.0
Published
Pi extension package that proxies Satori MCP tools through satori-cli
Downloads
211
Maintainers
Readme
pi-satori-bridge
pi-satori-bridge connects a PI agent to Satori by exposing Satori's MCP tools inside PI and proxying every call through satori-cli.
Repository: https://github.com/ham-zax/satori
How this helps PI agents
Without this extension, PI does not have Satori tools registered in its tool surface.
With this extension:
- PI sees Satori tools as native extension tools.
- The extension forwards tool calls to
satori-cli. satori-clitalks to Satori MCP and returns deterministic tool responses.
Connection flow:
PI Agent -> pi-satori-bridge -> satori-cli -> Satori MCPExposed tools
list_codebasesmanage_indexsearch_codebasecall_graphfile_outlineread_file
Forwarding command shape:
satori-cli tool call <toolName> --args-json '<json>'Install and run
Install from npm:
pi install npm:pi-satori-bridgeLoad local extension directly:
pi --no-extensions -e /absolute/path/to/satori-bridgeHealth check inside PI:
/satori-mcpThis runs satori-cli tools list and confirms connectivity/reflection.
Detailed diagnostics (resolved config/env/transport + quick health check):
/satori-mcp-doctorConfig resolution order
The bridge resolves config in this order:
SATORI_CLI_CONFIG(explicit config path)<cwd>/.pi/satori-bridge.json(project local)~/.pi/agent/satori-bridge.json(global legacy shortcut)~/.pi/agent/extensions/satori-bridge/config.json(global extension path)
If SATORI_CLI_CONFIG is set to a missing file, the bridge now fails fast with a direct error that names the missing path.
CLI resolution order
After config is loaded, the bridge resolves how to invoke satori-cli in this order:
- Explicit command (
SATORI_CLI_COMMANDor configcommand) - Local CLI path (
SATORI_CLI_LOCAL_PATH/ configcliPath/localPath, defaultpackages/mcp/dist/cli/index.js) - npm fallback (
npx -y --package <npmPackage> satori-cli)
Start from config.example.json:
{
"envFile": ".env.satori",
"guardRecovery": "auto",
"forceNpx": false,
"npmPackage": "@zokizuan/satori-mcp@latest",
"startupTimeoutMs": 180000,
"callTimeoutMs": 600000,
"debug": false
}For source-checkout development, point to a local CLI command:
{
"command": "pnpm",
"args": [
"-C",
"/absolute/path/to/satori/packages/mcp",
"exec",
"tsx",
"src/cli/index.ts"
],
"envFile": ".env.satori"
}Runtime behavior
pathtool arguments are absolute paths.- If a model prepends
@to path-like arguments, the bridge strips the leading@before forwarding. file_outline.fileis repo-relative to the indexed codebase root.- Missing
envFileis non-fatal (bridge warns and continues). - Bridge error messages include actionable hints (missing config path, command-not-found, likely missing env vars, stdout JSON guard hint), and redact likely secrets in diagnostics.
- Auto-recovery retries once (guard-off) only for protocol/transport failures.
- Valid tool-level non-ok responses (for example
not_readyorblocked) are passed through, not retried. - If
manage_indexreturnsstatus=\"blocked\"withreason=\"unnecessary_reindex_ignore_only\", usemanage_index {\"action\":\"sync\",\"path\":\"...\"}. Override only when explicitly intended viaallowUnnecessaryReindex=true. - Default timeouts are
startupTimeoutMs=180000andcallTimeoutMs=600000;/satori-mcphealth check clamps both to15000. - For reproducible behavior across teams, pin
npmPackageto a specific@zokizuan/satori-mcp@<version>instead of@latest.
Optional env vars
SATORI_CLI_COMMANDSATORI_CLI_ARGS_JSONSATORI_CLI_CWDSATORI_CLI_LOCAL_PATHSATORI_CLI_FORCE_NPXSATORI_CLI_NPM_PACKAGESATORI_CLI_STARTUP_TIMEOUT_MSSATORI_CLI_CALL_TIMEOUT_MSSATORI_CLI_DEBUGSATORI_CLI_STDOUT_GUARD(dropdefault,redirect,off)SATORI_CLI_GUARD_RECOVERY(autodefault,never)SATORI_CLI_CONFIG
Satori runtime variables (embedding/vector/API keys) can be set via shell env or envFile.
