{
  "markdown": "# mcp-sqlite-tools\n\nA Model Context Protocol (MCP) server for safe, local SQLite database\noperations. It gives MCP clients explicit read, write, schema,\ntransaction, CSV, backup, and maintenance tools.\n\n## Features\n\n- Open, create, inspect, back up, vacuum, and close SQLite databases\n- List, describe, create, and drop tables\n- Run paginated read queries with named or positional parameters\n- Run explicit write and schema queries\n- Import and export headered CSV files\n- Use transactions with nested savepoints\n- Export and import schemas as SQL or JSON\n- Restrict database and CSV paths through configuration\n- Classify destructive tools for client approval policies\n- Use Node's built-in SQLite driver with no native addon dependency\n\n## Requirements\n\n- Node.js 24.12 or later\n- An MCP client with stdio server support\n\n## Configure your MCP client\n\nThe MCP client starts this server through `npx`; a global installation\nis not required.\n\n### Install with MCPick\n\n[MCPick](https://github.com/spences10/mcpick) can add the server to a\nsupported client without manual JSON editing. This command targets\nClaude Code's local scope by default:\n\n```bash\nnpx -y mcpick add \\\n  --name sqlite-tools \\\n  --command npx \\\n  --args \"-y,mcp-sqlite-tools\"\n```\n\nSelect a client and scope explicitly when needed:\n\n```bash\nnpx -y mcpick add \\\n  --name sqlite-tools \\\n  --command npx \\\n  --args \"-y,mcp-sqlite-tools\" \\\n  --client vscode \\\n  --scope project\n```\n\nThe `add` command supports Claude Code, Gemini CLI, VS Code, Cursor,\nWindsurf, OpenCode, and Pi. Run `npx mcpick clients` to see current\nclient capabilities, scopes, and configuration locations.\n\nThe examples track the latest package release. For reproducible\nconfiguration, replace `mcp-sqlite-tools` in `--args` with an exact\nversion such as `mcp-sqlite-tools@x.y.z`.\n\n### Manual configuration\n\nFor unsupported clients or advanced configuration, add the server\nmanually:\n\n```json\n{\n\t\"mcpServers\": {\n\t\t\"mcp-sqlite-tools\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"mcp-sqlite-tools\"],\n\t\t\t\"env\": {\n\t\t\t\t\"SQLITE_DEFAULT_PATH\": \".\",\n\t\t\t\t\"SQLITE_ALLOW_ABSOLUTE_PATHS\": \"true\",\n\t\t\t\t\"SQLITE_BUSY_TIMEOUT\": \"30000\",\n\t\t\t\t\"SQLITE_BACKUP_PATH\": \"./backups\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nVS Code uses a `servers` object instead of `mcpServers`. See the\n[configuration guide](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/configuration.md)\nfor more client-specific examples.\n\n## Environment variables\n\n| Variable                      | Purpose                                  | Default               |\n| ----------------------------- | ---------------------------------------- | --------------------- |\n| `SQLITE_DEFAULT_PATH`         | Base directory for database files        | `.`                   |\n| `SQLITE_ALLOW_ABSOLUTE_PATHS` | Allow absolute database paths            | `true`                |\n| `SQLITE_BACKUP_PATH`          | Default backup directory                 | Default database path |\n| `SQLITE_BUSY_TIMEOUT`         | SQLite lock busy timeout in milliseconds | `30000`               |\n| `DEBUG`                       | Enable diagnostic logging                | `false`               |\n\n`SQLITE_MAX_QUERY_TIME` remains available as a deprecated alias for\n`SQLITE_BUSY_TIMEOUT`. It does not limit wall-clock query runtime.\n\n## Tools\n\nTools are separated by intent so MCP clients can apply clear approval\nrules.\n\n### Safe and read-only\n\n| Tool                 | Purpose                            |\n| -------------------- | ---------------------------------- |\n| `open_database`      | Open an existing database          |\n| `close_database`     | Close one database connection      |\n| `list_databases`     | Find database files in a directory |\n| `database_info`      | Read file and SQLite metadata      |\n| `list_tables`        | List tables and views              |\n| `describe_table`     | Read columns and constraints       |\n| `backup_database`    | Create a consistent online backup  |\n| `export_csv`         | Export a table or read-only query  |\n| `export_schema`      | Export schema as SQL or JSON       |\n| `execute_read_query` | Run one SQLite read-only statement |\n\n### Writes, schema, and maintenance\n\n| Tool                   | Purpose                                 |\n| ---------------------- | --------------------------------------- |\n| `create_database`      | Create a new database file              |\n| `create_table`         | Create a table from validated columns   |\n| `drop_table`           | Drop a table and its data               |\n| `execute_write_query`  | Run `INSERT`, `UPDATE`, or `DELETE`     |\n| `execute_schema_query` | Run one schema statement                |\n| `bulk_insert`          | Insert records in batches               |\n| `import_csv`           | Import a headered CSV file              |\n| `import_schema`        | Apply SQL or JSON schema objects        |\n| `vacuum_database`      | Rebuild a database to reclaim space     |\n| `begin_transaction`    | Begin a transaction or nested savepoint |\n| `commit_transaction`   | Commit or release a savepoint           |\n| `rollback_transaction` | Roll back a transaction or savepoint    |\n\nSee the\n[complete API reference](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/api-reference.md)\nfor parameters, responses, examples, pagination, and CSV options.\n\n## Safety model\n\nThe server does not treat every SQL string as equivalent:\n\n- `execute_read_query` uses SQLite's authorizer API to reject writes,\n  schema changes, unsafe PRAGMAs, attachment, and multiple statements.\n- Write, schema, transaction, and destructive administration actions\n  use separate tools so clients can request approval.\n- Database and CSV paths are resolved and validated before access.\n- Identifiers generated by tools are quoted.\n- Values are bound as parameters rather than interpolated into SQL.\n- Backups use SQLite's online backup API and include committed WAL\n  data.\n\nA client can allow read-only tools and require approval for\ndestructive tools. Always review SQL and file paths before approving\nchanges. Back up important databases before schema changes, imports,\nor large writes.\n\n## Why native SQLite?\n\nUsing `node:sqlite` removes the native addon, its install script, and\nits platform-specific binaries. A clean production install fell from\n31.3 MB with `better-sqlite3` to 3.6 MB with native SQLite, an 88.5%\nreduction. The npm tarball itself is similar in size: 63.1 KB native\nversus 60.0 KB published. The large saving is in the installed\ndependency tree.\n\nThe migration also removes `better-sqlite3` and its type package. It\nmakes installation independent of prebuilt addon availability or a\nworking native compiler.\n\n### Driver benchmark\n\nLower times are better. These medians use 20,000 rows, two warmups,\nand seven measured runs per driver. Each sample uses a new database\nand the driver order alternates. Setup is outside the measured region\nexcept for the insert workload.\n\n| Workload            | `node:sqlite` | `better-sqlite3` | Native result |\n| ------------------- | ------------: | ---------------: | ------------: |\n| Insert transaction  |      11.13 ms |         23.78 ms |  2.14× faster |\n| Indexed point reads |      25.23 ms |         21.40 ms |  17.9% slower |\n| Full row scan       |       6.39 ms |          3.29 ms |  94.3% slower |\n| Update transaction  |       8.04 ms |         15.40 ms |  1.92× faster |\n| Online backup       |       0.55 ms |          0.38 ms |  45.0% slower |\n\nMeasured on Linux x64 with Node.js 24.15.0 and an AMD Ryzen AI 9\nHX 370. Node used SQLite 3.51.3; `better-sqlite3@13.0.1` used SQLite\n3.53.3. These microbenchmarks show driver trade-offs, not complete MCP\nperformance. MCP transport and validation costs are not included.\n\n## Development\n\n```bash\ngit clone https://github.com/spences10/mcp-sqlite-tools.git\ncd mcp-sqlite-tools\npnpm install\npnpm run check\npnpm test\npnpm run build\n```\n\nSee\n[development and architecture](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/development.md)\nfor module responsibilities and other development commands.\n\n## Documentation\n\n- [Configuration](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/configuration.md)\n- [API reference](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/api-reference.md)\n- [Development and architecture](https://github.com/spences10/mcp-sqlite-tools/blob/main/docs/development.md)\n\n## Contributing\n\nIssues and pull requests are welcome.\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n",
  "bytes": 8501,
  "sha": "d5e23f4c3d0518e2b812c153f2d4a6b9ad59b093479f4fb33253df93cc26ac48",
  "repo_slug": "spences10/mcp-sqlite-tools",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_spences10_mcp_sqlite_tools_11314ff2/readme"
}