Skip to main content
The sqlite MCP adapter reads and writes local .db files on the connector host. It provides read-only queries, optional mutating SQL (when allow_write is enabled), schema introspection, and row sampling. Use it for local analytics, embedded app data, prototyping, lightweight ETL, and schema exploration before promoting logic to Postgres or MySQL.

Prerequisites

  • A SQLite database file (.db) accessible to the connector runtime
  • Read access for reporting workflows; write access only when allow_write is enabled
  • database_path must resolve under data_root when that constraint is configured
  • project_contributor access

Connect in AgentRuntime

1

Configure the database path

On Connections, click New custom connection (or edit the MCP instance profile) and set:
  • default_database_path — absolute or relative path to your .db file (e.g. /data/app/metrics.db)
  • data_root — optional root directory; all database_path values must resolve under it
  • allow_write — set to true only if workflows need sqlite_execute or sqlite_execute_sql
2

Add sqlite MCP instance

Go to MCP, click Add instance for sqlite, set path and write settings on Instance config, then set the profile active.
3

Test with database info

Add a workflow with mcp_callsqlite_get_database_info. Run it to confirm the file path and SQLite version before queries.
4

Explore schema (optional)

Run mcp_callsqlite_list_tables and sqlite_describe_table on a known table to verify schema access.
See Authentication for binding connections to MCP instances.

What you can build

  • CSV ingest pipeline — Parse uploaded CSV → sqlite_execute bulk INSERT → sqlite_query validation report.
  • Local dashboard feed — Scheduled sqlite_query on metrics tables → LLM summary → Slack notification.
  • Schema explorationsqlite_list_tables + sqlite_describe_table → Autopilot answers questions with grounded SQL.
  • Prototype ETLsqlite_query extract → transform in Lua → sqlite_execute load into staging tables.

Tools

ToolDescription
sqlite_get_database_infoReturn basic SQLite database metadata
sqlite_queryRun a read-only SQLite query and return columns and rows as JSON
sqlite_list_viewsList all views in the SQLite database
sqlite_get_table_schemaReturn detailed SQLite schema, including columns and indexes, for a table
sqlite_list_indexesList SQLite indexes on a table using PRAGMA index_list
sqlite_executeExecute SQLite SQL that may modify data
sqlite_execute_sqlExecute mutating SQLite SQL; alias of execute_sql
sqlite_list_tablesList all user tables in the SQLite database
sqlite_describe_tableShow SQLite column schema for a table using PRAGMA table_info
sqlite_sample_table_rowsPreview rows from a SQLite table

Example

Run a read-only report query:
{
  "id": "daily-sales",
  "type": "mcp_call",
  "name": "Daily sales total",
  "tool_name": "sqlite_query",
  "tool_args": {
    "sql": "SELECT date(created_at) AS day, SUM(amount) AS total FROM orders GROUP BY day ORDER BY day DESC LIMIT 7"
  },
  "timeout_s": 30
}
Omit database_path to use sqlite_default_database_path from configuration.

Configuration

KeyRequiredDefaultDescription
sqlite_data_rootNoRoot directory; database_path must resolve under this path when set
sqlite_default_database_pathNoDefault .db file path when a tool omits database_path
sqlite_query_timeout_secondsNo30Per-query timeout in seconds
sqlite_max_rowsNo1000Maximum rows returned per read query
sqlite_allow_writeNofalseSet to true to enable sqlite_execute and sqlite_execute_sql

Troubleshooting

IssueFix
Database file not foundVerify default_database_path and that the file exists on the connector host
Path outside data_rootMove the file under data_root or adjust the configured root directory
Write rejectedSet sqlite_allow_write to true on the MCP instance profile
database is lockedEnsure no other process holds a long write lock; retry with backoff
Row limit exceededAdjust sqlite_max_rows or add LIMIT to read queries