Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 2.47 KB

File metadata and controls

90 lines (65 loc) · 2.47 KB

@spences10/pi-sqlite-tools

built with Vite+ tested with Vitest npm version license

my-pi package preview

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.

Installation

pi install npm:@spences10/pi-sqlite-tools

Local 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-tools

What it does

The 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, and export_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.

Example MCP config

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"]
		}
	}
}

Using from a custom harness

import sqliteTools from '@spences10/pi-sqlite-tools';

// pass `sqliteTools` as an ExtensionFactory to your Pi runtime

my-pi imports this package directly and enables it as the built-in SQLite tools reminder.

Development

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 build

License

MIT