Make SQLite work safer than ad-hoc shell commands. pi-sqlite-tools
reminds agents to use the gated mcp-sqlite-tools workflow for
inspecting, querying, backing up, and modifying databases instead of
raw sqlite3 scripts.
pi install npm:@spences10/pi-sqlite-toolsLocal development from this monorepo:
pnpm --filter @spences10/pi-sqlite-tools run build
pi install ./packages/pi-sqlite-tools
# or for one run only
pi -e ./packages/pi-sqlite-toolsThe extension injects a system reminder telling the model to use
mcp-sqlite-tools when working with SQLite files such as:
.db.sqlite.sqlite3
It encourages the safer MCP workflow:
- open databases with
open_database - inspect structure with
database_info,list_tables,describe_table, andexport_schema - run reads with
execute_read_query - back up and use transactions before writes or schema changes
- close databases when finished
It adds no slash commands and no custom tools.
mcp-sqlite-tools must be configured separately, for example in
~/.pi/agent/mcp.json:
{
"mcpServers": {
"mcp-sqlite-tools": {
"command": "npx",
"args": ["-y", "mcp-sqlite-tools"]
}
}
}import sqliteTools from '@spences10/pi-sqlite-tools';
// pass `sqliteTools` as an ExtensionFactory to your Pi runtimemy-pi imports this package directly and enables it as the built-in
SQLite tools reminder.
Package scripts build transitive workspace dependencies first, then
run local tools through Vite+ with vp exec.
pnpm --filter @spences10/pi-sqlite-tools run check
pnpm --filter @spences10/pi-sqlite-tools run test
pnpm --filter @spences10/pi-sqlite-tools run buildMIT
