fastmcp-sqlite
Provides a high-performance, token-optimized SQLite MCP server for AI coding agents, with non-blocking schema discovery, safe query execution, VDBE opcode watchdog protection, and compact tabular result formatting.
fastmcp-sqlite
A High-Performance, Token-Optimized SQLite Model Context Protocol (MCP) Server Built for AI Coding Agents.
Zero Native Build Toolchain · Sub-15ms Cold Start · Prompt Cache Prefix Stability (>97%) · VDBE Opcode Watchdog · Fast Non-Blocking Schema Discovery
Overview and Design Principles
Many SQLite Model Context Protocol (MCP) servers in the ecosystem rely on Node.js native addons (better-sqlite3) or unbounded serialization formats, introducing distinct operational challenges in autonomous AI agent environments:
Native Build Toolchain Overhead: Relying on
node-gypor platform-specific C++ build toolchains (such as MSVC on Windows) introduces installation friction in minimal container environments, restricted CI/CD runners, and locked-down developer workstations.Context Token Inefficiency: Formatting query results as verbose JSON object arrays repeats schema keys for every record, consuming 2.2x to 3.7x more context tokens than compact tabular representations.
Prompt Cache Invalidation: Injecting dynamic execution timestamps or metrics into response headers alters the message prefix, preventing KV-cache reuse on Claude, GPT-4o, and Gemini architectures.
Unbounded Query Execution: Executing full
SELECT COUNT(*)table scans on multi-gigabyte databases creates prolonged disk read locks, while unconstrained recursive Common Table Expressions (WITH RECURSIVE) or Cartesian joins can stall agent stdio subprocesses.
fastmcp-sqlite addresses these challenges through a lightweight, standard-library architecture:
Zero Native Build Dependencies: Pure Python implementation using the standard library
sqlite3and the officialmcpSDK, eliminating C/C++ compilation requirements.Non-Blocking Schema Probing: Inspects
sqlite_stat1and performs rightmost Table B-Tree leaf seeks (MAX(_rowid_)) in $O(\log N)$ time, avoiding sequential disk scans.VDBE Opcode Watchdog: Employs SQLite's
sqlite3_progress_handlerbytecode instruction counter to halt runaway recursive queries within milliseconds without freezing the agent process.Prefix-Stable Serialization: Relocates execution timing metrics strictly to response footers, preserving >97% byte invariance across schema inspections for prompt cache retention.
Token-Budgeted Serialization: Provides compact GitHub-flavored Markdown tables, vertical record inspection for wide schemas, 200-character cell truncation, and a 24KB UTF-8 payload ceiling.
┌─── MODEL CONTEXT PROTOCOL: INTERACTION TRACE ─────────────────────────────────────────────┐
│ │
│ 🤖 AI AGENT (Claude / Cursor / Antigravity / Windsurf / Cline) │
│ └─▶ Tool Call: schema(db="production.db") │
│ │
│ ⚡ fastmcp-sqlite Engine (Non-Blocking B-Tree Leaf Probe: 0.82 ms) │
│ ┌────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ # SQLite Schema Overview: production.db (400 MB, WAL Mode, 256MB MMAP) │ │
│ │ | Table Name | Type | Columns | Est. Rows | Primary Key | Foreign Keys | │
│ │ | :--------- | :---- | :-----: | :---------- | :---------- | :-------------------- | │
│ │ | `users` | table | 12 | ~2,500,000 | id (INTEGER)| None | │
│ │ | `events` | table | 8 | ~2,070,000 | id (INTEGER)| `user_id` -> users.id | │
│ │ *Discovery Latency: 0.82 ms (B-Tree Leaf Probe: MAX(_rowid_) | 12 Shadows Hidden)* │ │
│ └────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🤖 AI AGENT (Typo in SQL Query: `SELECT user_nam FROM users`) │
│ └─▶ Tool Call: query(sql="SELECT user_nam FROM users") │
│ │
│ 💡 Schema Diagnostics (<1.2 ms via difflib) │
│ ┌────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ SQLite OperationalError: no such column: user_nam │ │
│ │ └─ Suggestion: Column 'user_nam' does not exist. Did you mean: `username`? │ │
│ └────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🤖 AI AGENT (Runaway Accidental Cartesian / Recursive CTE Query) │
│ └─▶ Tool Call: query(sql="WITH RECURSIVE loop(n) AS (SELECT 1 UNION ALL...)") │
│ │
│ 🛑 VDBE Opcode Watchdog Interruption (3.6 ms) │
│ ┌────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ OperationalError: Query execution aborted by watchdog: exceeded 1,000,000 opcodes. │ │
│ │ └─ Execution halted gracefully · Zero process hang · Transaction rolled back │ │
│ └────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────┘Related MCP server: @renzynx/memory-mcp
Quickstart
fastmcp-sqlite runs as a headless standard I/O (stdio) JSON-RPC Model Context Protocol server directly managed by your AI coding assistant (Claude Desktop, Cursor, Antigravity, Windsurf, Cline).
Run instantly with uvx (Recommended)
Execute with uvx without pre-installing dependencies:
# Start with a specific SQLite database (read-only by default)
uvx fastmcp-sqlite --db /path/to/database.db
# Enable write operations (INSERT, UPDATE, DELETE, CREATE, DROP)
uvx fastmcp-sqlite --db /path/to/database.db --allow-write
# Load SQLite extensions (e.g. sqlite-vec) with automatic post-init security lockdown
uvx fastmcp-sqlite --db /path/to/database.db --extension /path/to/vec0.so --allow-writeWhen executed directly in a terminal,fastmcp-sqlite listens quietly on stdio for JSON-RPC messages from MCP clients. To interactively inspect and test tools in a visual browser UI, launch with the MCP Inspector:
npx @modelcontextprotocol/inspector uvx fastmcp-sqlite --db /path/to/database.dbOr install via pip / pipx:
pip install fastmcp-sqlite
fastmcp-sqlite --db /path/to/database.db --allow-write🤖 1-Prompt AI Agent Bootstrapper
If you are using Claude Code, Cursor, Google Antigravity, Windsurf, or Cline, copy and paste this single prompt into your chat window to let your agent configure and verify fastmcp-sqlite automatically:
Please inspect my workspace for any SQLite database files (*.db, *.sqlite, *.sqlite3). Once located, configure fastmcp-sqlite in our MCP configuration file (e.g. .cursor/mcp.json, claude_desktop_config.json, or mcp_config.json) using command 'uvx' and args ['fastmcp-sqlite', '--db', '<ABSOLUTE_OR_WORKSPACE_PATH>', '--allow-write']. Then call the 'schema' tool to verify connectivity and show me an overview of the tables.Multi-Agent Client Configuration
Connect fastmcp-sqlite to your AI coding assistant using the configuration blocks below:
Windows Path Formatting: In JSON configuration files on Windows, use forward slashes (e.g., "C:/path/to/database.db") or escaped backslashes ("C:\\path\\to\\database.db").
Path Resolution: Providing an absolute path guarantees reliable database resolution across all client environments.
Configuration file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json(or via Claude Settings → Developer → Edit Config)Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "/absolute/path/to/database.db", "--allow-write"]
}
}
}Windows Store / MSIX Virtualization Note: If Claude Desktop was installed via the Windows Store package, Windows may virtualize the configuration path to %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json. Opening the file via Claude Settings → Developer → Edit Config always opens the active configuration.
Add to your project root .cursor/mcp.json or configure under Cursor Settings → Features → MCP:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "/absolute/path/to/data/app.db", "--allow-write"]
}
}
}Cursor executes MCP servers with the project workspace root as the current working directory. You can specify a relative path (e.g.,"data/app.db") or an absolute path.
Add to ~/.gemini/antigravity/mcp_config.json or project .gemini/mcp_config.json:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "${workspaceFolder}/database.db", "--allow-write"]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json (or %USERPROFILE%\.codeium\windsurf\mcp_config.json on Windows):
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "/absolute/path/to/database.db", "--allow-write"]
}
}
}Add to cline_mcp_settings.json:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "/absolute/path/to/database.db", "--allow-write"],
"disabled": false,
"autoApprove": [
"schema",
"table_info",
"explain",
"list_databases",
"query"
]
}
}
}{
"servers": {
"sqlite": {
"type": "stdio",
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "${workspaceFolder}/app.db", "--allow-write"]
}
}
}{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "./app.db", "--allow-write"]
}
}
}extensions:
sqlite:
name: FastMCP SQLite Engine
type: stdio
cmd: uvx
args: ["fastmcp-sqlite", "--db", "/path/to/app.db", "--allow-write"]
enabled: true
timeout: 300{
"context_servers": {
"sqlite": {
"command": {
"path": "uvx",
"args": ["fastmcp-sqlite", "--db", "/path/to/database.db", "--allow-write"]
}
}
}
}Under Program → MCP Servers → Edit mcp.json:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "C:/databases/analytics.db", "--allow-write"]
}
}
}{
"mcpServers": {
"sqlite-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/data:/data",
"ghcr.io/kenb38291-tech/fastmcp-sqlite:latest",
"--db",
"/data/production.db",
"--allowed-dir",
"/data",
"--allow-write"
]
}
}
}npx -y fastmcp-sqlite --db /path/to/database.db --allow-writeRegister directly from your terminal:
claude mcp add sqlite -- uvx fastmcp-sqlite --db /absolute/path/to/project.db --allow-writeFor Gemini CLI (~/.gemini/settings.json):
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["fastmcp-sqlite", "--db", "/absolute/path/to/database.db", "--allow-write"]
}
}
}For OpenAI Codex (.codex/config.toml or ~/.codex/config.toml):
[mcp_servers.sqlite]
command = "uvx"
args = ["fastmcp-sqlite", "--db", "/absolute/path/to/database.db", "--allow-write"]MCP Tools Reference
fastmcp-sqlite exposes 6 focused, token-budgeted tools (<1.4k system tokens total):
Tool | Intent & Action | Parameters | Return Format & Context Budget |
| Non-Blocking Schema OverviewTable listing, column types, foreign keys, and estimated row counts via B-tree leaf inspection ($O(\log N)$) without full table scans. |
| Markdown table schema overview. (Deterministic prefix >97%). |
| SQL ExecutionExecutes SQL queries with parameter binding, VDBE opcode watchdog guardrails, and output truncation. |
| Markdown table, vertical record view, or JSON (capped at 24KB UTF-8). |
| Streaming Out-of-Band ExportStreams query results directly to local CSV or JSONL disk file with zero context token consumption and $O(1)$ memory. |
| Markdown summary with rows exported, file size, and execution latency. |
| Deep Table InspectionDetailed table metadata: columns, data types, nullability, defaults, indexes, triggers, DDL SQL, and estimated rows. |
| Detailed Markdown table specification. |
| Query Plan AnalysisAnalyzes query execution plans and index utilization via |
| Tree view of SQLite VDBE query plan. |
| Directory DiscoveryLists all SQLite database files ( |
| List of resolved database paths and file sizes. |
Performance and Tokenomics
Empirical Benchmark Comparison
Measured on a 400MB database with 4.57 million rows (tracker.db) and a wide 39-column schema (aegis.db):
Benchmark Metric | fastmcp-sqlite (Python / FastMCP) | Node.js MCP (better-sqlite3) | Comparison | Technical Mechanics & Root Cause |
CLI Cold-Start Latency | 6.8 ms – 13.1 ms (PEP 562 lazy imports) | ~1,320.0 ms (Node runtime + addon init) | ~100x faster startup | Defers heavy SDK submodules until execution via module-level |
Schema Prefix Invariance | >97% prefix invariant | 0% (Header timestamps bust cache) | High Cache Retention | Relocates variable execution timers strictly to output footers, keeping schema definitions byte-invariant. |
Schema Discovery Latency | 0.8 ms (B-tree leaf probe) | 482.0 ms (Full scan | Non-blocking scan | Probes |
Runaway Query Interruption | 3.6 ms (VDBE progress opcode limit) | Unresponsive / Process Timeout | Deterministic Abort | SQLite VDBE progress handler interrupts execution when reaching 1,000,000 VM opcodes. |
Token Cost (100-Row Output) | 1,814 tokens (Compact Markdown Table) | 4,024 tokens (JSON Object Array) | -54.9% tokens | Markdown tables declare column headers once ($O(K) + O(N)$) instead of repeating keys per row ($O(N \cdot K)$). |
Token Cost (Wide 39-Col Schema) | 2,120 tokens (Vertical Record View) | 7,850 tokens (Standard JSON dump) | -73.0% tokens | Formats wide records as individual bulleted blocks to prevent wrapping degradation. |
Process Memory (RSS) | ~18 MB (CPython standard library) | ~85 MB (V8 runtime + native addon) | -78.8% memory | Standard library |
Extension Sandbox Security | Post-startup lockdown | Unrestricted native runtime | Sandboxed SQL Surface | Calls |
Installation Requirements | Pure Python standard library | Requires MSVC / | Zero Build Toolchain | Pure-Python distribution running on any platform without native compilation steps. |
Prompt Caching Optimization
Many MCP servers output dynamic execution timers or timestamps in the header of their schema responses. Because modern LLM prompt caching mechanisms (Anthropic Claude Prompt Caching, OpenAI Prefix Caching) match exact token prefixes from the beginning of the message, variable header lines invalidate cache entries on successive invocations.
fastmcp-sqlite relocates dynamic timing measurements to the footer:
Prefix Stability: >97% deterministic prefix stability across successive schema discovery calls.
Cache Retention: Maximizes KV-cache reuse by keeping 100% of schema table and column definitions byte-invariant.
Latency & Cost Efficiency: For prompts exceeding the model caching threshold (e.g., 1,024 tokens on Claude 3.5/3.7 Sonnet), cached prefix matches reduce time-to-first-token (TTFT) and input token billing.
Token Consumption Comparison & Financial ROI
By formatting records as compact Markdown tables and offering vertical views for wide schemas, fastmcp-sqlite reduces context window usage by 54.9% – 73.0%:
Implementation | Tool Count | Base System Tokens | 100-Row Query Output | Memory Footprint (RSS) |
| 5 | ~1.2k tokens | ~1.8k tokens (Markdown / Truncated) | ~18 MB |
Official SQLite MCP Server | 6 | ~4.2k tokens | ~8.9k tokens (Raw JSON Objects) | ~65 MB |
Community Node.js CRUD Servers | 22 | ~9.8k tokens | ~14.5k tokens (Unbounded JSON Arrays) | ~110 MB |
Token Overhead Comparison (100 Rows Output):
fastmcp-sqlite [████████░░░░░░░░░░░░░░░░] 1.8k tokens (-54.9% vs Node.js JSON)
Official SQLite [████████████████████░░░░] 8.9k tokens
Community Node [████████████████████████] 14.5k tokensFinancial Impact across Agent Workflows:
Claude 3.5 / 3.7 Sonnet ($3.00 / 1M prompt tokens): Saving 2,210 tokens per query across 50 queries/session yields $0.33 saved per session (~$9.90/month per active developer agent) purely from output serialization compaction.
Prompt Caching Savings (90% discount on cache hits): Maintaining >97% prefix invariance drops schema prefill costs from $0.030 to $0.003 per turn on cache hits.
Runaway Query Watchdog
Accidental infinite recursive CTEs or Cartesian product joins are interrupted within milliseconds via SQLite's VDBE bytecode instruction limit:
WITH RECURSIVE loop(n) AS (
SELECT 1 UNION ALL SELECT n + 1 FROM loop
)
SELECT * FROM loop;OperationalError: Query execution aborted by watchdog: exceeded 1,000,000 opcodes.Fuzzy Schema Typo Diagnostics & Self-Healing
When an agent misspells a table or column name, fastmcp-sqlite analyzes the catalog using Python's standard difflib and returns targeted correction hints directly in the error response, enabling Turn-2 error resolution without redundant exploratory queries:
SELECT user_nam, email FROM users;SQLite OperationalError: no such column: user_nam
💡 Suggestion: Column 'user_nam' does not exist. Did you mean: `username`?Architecture
flowchart TD
subgraph Clients["AI Coding Agent Ecosystem"]
direction LR
C1["Claude Desktop / Code"]
C2["Cursor IDE"]
C3["Google Antigravity"]
C4["Windsurf / Cline / Roo"]
end
subgraph FastMCPServer["fastmcp-sqlite Core Engine Layer"]
direction TB
JSONRPC["Stdio JSON-RPC Dispatcher (UTF-8 Windows Safe)"]
subgraph SafetyGuards["Runtime Safety and Watchdog Layer"]
WD["Opcode Watchdog (1M Instruction Limit)"]
TX["DML RETURNING (ACID Auto-Commit)"]
DZ["Fuzzy Typo Matcher (difflib Pattern Match)"]
EX["Extension Security (Dynamic Load Lockdown)"]
end
subgraph TokenEngine["Tokenomics and Serialization"]
F1["Markdown Table Formatter"]
F2["Vertical Record View (Wide Tables)"]
F3["Cell Truncator (200c) & 24KB UTF-8 Byte Ceiling"]
end
subgraph Discovery["Non-Blocking Schema Discovery"]
P1["MAX(_rowid_) B-Tree Leaf Probe (O(log N))"]
P2["sqlite_stat1 Fast Path"]
P3["Dynamic Shadow Filter (FTS3/4/5, R*Tree)"]
end
end
subgraph SQLiteStorage["SQLite Storage Engine"]
DB[("Primary Database (.db / .sqlite)<br/>PRAGMA WAL • MMAP 256MB • 64MB Cache")]
end
Clients <==>|"JSON-RPC (Stdio)"| JSONRPC
JSONRPC --> SafetyGuards
JSONRPC --> TokenEngine
JSONRPC --> Discovery
SafetyGuards & TokenEngine & Discovery <==>|"C-API sqlite3"| DB
classDef clientStyle fill:#2d3748,stroke:#4a5568,stroke-width:2px,color:#fff;
classDef engineStyle fill:#1a202c,stroke:#3182ce,stroke-width:2px,color:#fff;
classDef guardStyle fill:#2c5282,stroke:#63b3ed,stroke-width:1px,color:#fff;
classDef storeStyle fill:#234e52,stroke:#38b2ac,stroke-width:2px,color:#fff;
class C1,C2,C3,C4 clientStyle;
class FastMCPServer engineStyle;
class WD,TX,DZ,EX,F1,F2,F3,P1,P2,P3 guardStyle;
class DB storeStyle;Connection Hygiene and PRAGMA Configuration
Every database connection is initialized with tuned concurrency and performance settings:
PRAGMA busy_timeout = 5000;(Waits up to 5,000ms to resolve lock contention before raisingSQLITE_BUSY)PRAGMA journal_mode = WAL;(Enables concurrent readers alongside an active writer; gracefully handled on read-only mounts)PRAGMA synchronous = NORMAL;(Provides safe, low-latency disk I/O under WAL mode)PRAGMA mmap_size = 268435456;(Maps up to 256MB into virtual memory for zero-copy reads)PRAGMA cache_size = -64000;(Allocates approximately 64MB of RAM for the page cache)PRAGMA temp_store = MEMORY;(Backs temporary tables and indices with memory instead of disk)PRAGMA foreign_keys = ON;(Enforces relational foreign key constraint validation)PRAGMA query_only = ON;(Enforces read-only safety at the connection level when--allow-writeis omitted)
When should you NOT use fastmcp-sqlite?
We believe in engineering clarity. fastmcp-sqlite is purpose-built for local and embedded SQLite database interactions in AI agent workflows. You should NOT use fastmcp-sqlite if your workload requires:
Scenario / Requirement | Why fastmcp-sqlite is NOT suitable | Recommended Alternative |
Multi-Node OLTP Clusters | SQLite uses single-writer file locking and is not designed for distributed, multi-master write topologies. | PostgreSQL with |
Distributed Edge Replication |
| Turso ( |
Petabyte-Scale OLAP Analytics | Row-oriented SQLite B-Trees are not optimized for columnar aggregations across billions of records. | DuckDB ( |
Direct Unauthenticated Sockets |
| SQLite with gRPC / authenticated REST gateway |
For AI Agents
When interacting with fastmcp-sqlite, follow this optimal workflow:
Discover schema: Call
schemafirst to inspect tables, row estimates, and foreign keys in sub-millisecond time.Inspect wide tables: Use
table_info(table="name")to inspect specific columns and constraints before generating complex SQL.Execute queries: Use
query(sql="SELECT ..."). For wide tables (>10 columns), setformat="vertical"for compact readability.Optimize query plans: Run
explain(sql="SELECT ...")to verify index coverage.Execute safe writes: Use parameter binding (
params=[...]orparams={"key": "val"}) for insertions and updates withRETURNINGclauses.
Security Boundaries of Parameter Binding:
SQLite parameter binding (params=[...] or params={"key": "val"}) safely escapes value literals in WHERE, VALUES, and SET clauses. Parameter placeholders cannot be used for SQL identifiers (table names, column names, or clauses). When generating SQL statements containing dynamic table or column identifiers, always validate identifiers against known schema definitions to prevent SQL injection.
CLI Reference
usage: fastmcp-sqlite [-h] [--db DB] [--name NAME] [--read-only] [--allow-write]
[--max-rows MAX_ROWS] [--max-bytes MAX_BYTES]
[--cell-max-chars CELL_MAX_CHARS]
[--opcode-limit OPCODE_LIMIT] [--timeout TIMEOUT]
[--extension EXTENSION] [--allowed-dir ALLOWED_DIR] [-v]
[db_positional]
Production-Grade Token-Optimized FastMCP SQLite Server
positional arguments:
db_positional Path to SQLite database file (positional)
options:
-h, --help Show this help message and exit
--db DB Path to SQLite database file
--name NAME Server name for FastMCP (default: fastmcp-sqlite)
--read-only Enable strict read-only mode (default: True)
--allow-write Allow write operations (disables read-only)
--max-rows MAX_ROWS Maximum rows returned per query (default: 100)
--max-bytes MAX_BYTES Maximum response payload bytes (default: 24576 / 24KB)
--cell-max-chars CHARS Maximum characters per cell before truncation (default: 200)
--opcode-limit LIMIT Opcode instruction watchdog limit (default: 1000000)
--timeout TIMEOUT SQLite busy timeout in seconds (default: 5.0)
--extension EXTENSION Path to SQLite loadable extension shared library (.so, .dylib, .dll)
--allowed-dir ALLOWED_DIR Root directory boundary to restrict database and export operations (Zero-Trust sandbox)
-v, --version Show program's version number and exitReproducing Benchmarks & Test Suite
Verify all benchmark metrics and architectural invariants locally using pytest and hyperfine:
# Run the complete test suite (128+ passed tests)
python -m pytest -v
# Verify sub-20ms CLI cold-start latency (PEP 562 vs eager import)
hyperfine --warmup 5 'python -m fastmcp_sqlite --help'Contributing and License
Contributions are welcome. Please check our Agent Guidelines and Contributing Guide.
Distributed under the MIT License.
Available Tools
6 toolsexplainA
Explain the query plan for a SQL query (EXPLAIN QUERY PLAN). Helps analyze indexes and optimize query performance.
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to SQLite database file. Defaults to configured default database. | |
| sql | Yes | The SQL query statement to analyze. | |
| params | No | Optional query parameters (positional list, named dict, or JSON string). |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of behavioral disclosure. It names the output as a query plan and the purpose as analysis, implying read-only behavior, but it does not explicitly state that the query is not executed or describe any output format/limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, tightly worded sentence with no filler. It front-loads the core action and immediately explains the tool's practical value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present and complete parameter documentation, the description covers the essential context. A slight gap is the absence of an explicit note that this tool analyzes rather than executes the query, which would further differentiate it from the query sibling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters (db, sql, params). The description adds no extra parameter-level detail, but this is acceptable given the strong schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource ('Explain the query plan for a SQL query') and explicitly names the underlying SQLite command (EXPLAIN QUERY PLAN). It clearly distinguishes itself from siblings like query, which executes queries, and schema/table_info, which inspect structure.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description communicates clear context for use: analyzing indexes and optimizing query performance. It does not explicitly name sibling alternatives or state when not to use the tool, but the stated purpose is sufficient to guide selection among the listed siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_queryA
Execute a SQL query and stream results directly to a local CSV or JSONL file on disk. Zero token consumption, constant O(1) memory usage, ideal for large query exports.
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to SQLite database file. Defaults to configured default database. | |
| sql | Yes | The SQL query to execute and export to disk. | |
| format | No | Export file format: 'csv' (comma-separated values) or 'jsonl' (line-delimited JSON). | csv |
| params | No | Optional query parameters (positional list, named dict, or JSON string). | |
| target_file | Yes | Destination file path on disk (e.g. 'output.csv' or 'data.jsonl'). |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. It discloses key behaviors: streaming results directly to disk, zero token consumption, and constant memory usage. It stops short of stating file-overwrite behavior, but the core side effect and performance traits are transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence that front-loads the core action and result, then adds the most distinctive benefits (zero token consumption, O(1) memory) without filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with a fully documented schema and an output schema, the description is largely complete: it explains what happens, where output goes, and why it is useful. It could more explicitly contrast with the query sibling or mention overwrite behavior, but those are minor omissions rather than blockers.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameters are already well-documented. The description reinforces the CSV/JSONL file destination and SQL execution, but adds little semantic value beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Execute') and resource ('SQL query') and clearly states the outcome: streaming results to a local CSV or JSONL file. This makes it easy to distinguish from sibling tools like query, which would return results in-context rather than writing to disk.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context for when to use this tool: 'ideal for large query exports' and highlights zero token consumption and O(1) memory usage. It does not explicitly name alternatives or state when-not-to-use, but the use case is clear enough to guide selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_databasesA
List all SQLite database files (.db, .sqlite, .sqlite3) in a directory.
| Name | Required | Description | Default |
|---|---|---|---|
| directory | No | Root directory path to search for SQLite databases (default: current directory '.'). | . |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It does state that the tool lists only files with .db, .sqlite, or .sqlite3 extensions, which signals a read-only discovery operation. However, it leaves ambiguity about whether the search is recursive, how hidden or unreadable files are handled, and what happens when no databases are found.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no filler, and the core action, resource, scope, and file extensions are all front-loaded. Every part of the sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a simple tool with one well-documented parameter and an output schema, so the basic invocation is fully specified. The description is missing a little context around recursive vs. top-level search and how it fits into the sibling tool workflow, but an agent can reasonably invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the directory parameter is already fully documented, including its default value. The description reinforces the directory scope but adds no new semantic detail beyond what the schema provides, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List'), identifies the resource ('SQLite database files'), names the exact file extensions, and scopes the action to a directory. This clearly distinguishes it from sibling tools like schema, table_info, and query, which operate on databases rather than discover them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance about when to use this tool versus the sibling tools, no stated workflow such as 'use before query', and no explanation of when another tool would be more appropriate. The intended usage as a discovery step is only implied by the tool name and siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryA
Execute a SQL query against a SQLite database with parameter binding and token-efficient formatting. Returns results as Markdown table, vertical record view, or JSON. Protected by opcode execution watchdog and cell truncation.
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to SQLite database file. Defaults to configured default database. | |
| sql | Yes | The SQL query to execute in SQLite engine. | |
| format | No | Output format: 'table' (compact Markdown), 'vertical' (wide records), or 'json'. | table |
| params | No | Optional query parameters (positional list, named dict, or JSON string). | |
| readonly | No | Enforce read-only mode via PRAGMA query_only and AST authorizer. | |
| cell_max_chars | No | Maximum characters per cell before truncation (default: 200, 0 = unlimited). |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full disclosure burden. It usefully mentions parameter binding, token-efficient formatting, and protections like opcode watchdog and cell truncation. However, it does not disclose whether writes can occur when readonly=false, nor does it describe side effects, failures, or error behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, front-loaded with the verb and resource, followed by output-format variety and safety protections. No filler, no redundant restatement of the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the rich input schema, output schema, and protective details in the description, an agent has enough to invoke the tool correctly. The main missing piece is guidance on when to choose this over sibling tools, which prevents a higher score.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all six parameters. The description's mention of parameter binding and output formats is consistent but adds little meaning beyond the parameter descriptions already present. Baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Execute a SQL query against a SQLite database.' It also names output formats, making the tool's core function clear. It does not explicitly distinguish itself from siblings like explain or export_query, though the function is inferable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use is implied by 'Execute a SQL query,' but there is no explicit when-to-use guidance or mention of alternatives such as explain, export_query, or schema. An agent gets no direct help choosing among sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
schemaA
Get the schema of a SQLite database: all tables, views, columns, data types, constraints, indexes, foreign keys, and sub-millisecond O(1) row counts.
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to a SQLite database file (.db, .sqlite, .sqlite3). Defaults to configured default database. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It goes beyond the tool name by specifying the full result scope and making an explicit performance claim ('sub-millisecond O(1) row counts'). It doesn't discuss failure modes, but for a read-only introspection tool this is reasonably transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One front-loaded sentence states the action and resource, followed by a compact list of contents. It is efficient and scannable, though splitting into two sentences would improve readability slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema and a single well-documented optional parameter, nothing critical is missing. The description covers the result contents and performance. It doesn't explicitly distinguish from table_info, but that gap is more about usage guidance than completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of the single parameter's semantics, including accepted file extensions and default-database behavior. The tool description itself adds no parameter detail, but that is acceptable given the high schema coverage baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb and resource: 'Get the schema of a SQLite database,' and enumerates the concrete contents (tables, views, columns, data types, constraints, indexes, foreign keys, row counts). This clearly differentiates it from sibling tools like query, explain, and table_info.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies database-wide schema introspection by listing all tables and views, which hints at when to use it. However, it never explicitly contrasts this with table_info or says 'use table_info for a single table,' so alternatives are left to inference rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
table_infoA
Get detailed info about a single table or view: columns, types, constraints, indexes, foreign keys, triggers, DDL SQL, and row count estimation.
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Optional path to SQLite database file. Defaults to configured default database. | |
| table | Yes | Exact name of the table or view to inspect. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description carries the full behavioral burden. It clearly frames the operation as a read-only 'Get' and adds meaningful detail: the row count is explicitly an estimation, and it discloses that the tool returns generated DDL and multiple metadata categories. It omits an explicit read-only or permission note, but the wording adequately signals a non-mutating operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the action and object, then uses a colon-delimited list to pack the full set of returned information. There is no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists and both parameters are fully documented in the input schema, the description covers purpose and the key behavioral nuance (estimated row count). It does not explicitly route to sibling tools, but an agent has everything needed to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema description coverage is 100%: both db and table already carry descriptive text in the schema. The tool description adds no parameter-specific meaning beyond what the schema states, so it stays at the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: 'Get detailed info about a single table or view,' followed by a concrete enumeration of what is returned (columns, types, constraints, indexes, foreign keys, triggers, DDL SQL, row count estimation). The 'single table or view' qualifier and the depth of listed details distinguish it from sibling tools like schema and query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is given on when to use table_info versus the sibling tools (schema, query, explain). The description implies a use case through scope ('single table or view') and the detailed metadata list, but it does not state when to choose it over alternatives or mention any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
6 tool updates
v1.0.0- First observed
explain - First observed
export_query - First observed
list_databases - First observed
query - First observed
schema - First observed
table_info
TDQS
Each tool has a clearly distinct scope: whole-database schema vs. single-table details, in-chat query results vs. file export, query plan analysis, and database file discovery. There is no meaningful overlap or ambiguity between them.
Names are readable and consistently lowercase snake_case, but they mix noun-style resource names (schema, table_info) with verb-style action names (query, export_query, explain, list_databases). A consistent verb_noun or get_/list_ pattern would improve predictability.
Six tools is a well-scoped set for a SQLite database server. Each tool serves a distinct need—exploration, querying, export, and query planning—without unnecessary duplication or bloat.
Within the apparent read/analysis-oriented scope, the tool surface is complete: it covers database discovery, schema inspection, detailed table metadata, querying, query plan explanation, and large result exports. There are no obvious dead ends or missing operations for this stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Token-free MCP server for structured RevoGrid Core, Pro, and Enterprise knowledge retrieval.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides safe, read-only access to SQLite databases through MCP. This server is built with the FastMCP framework, which enables LLMs to explore and query SQLite databases with built-in safety features and query validation.107-
- AlicenseAqualityDmaintenancePersistent memory MCP server with FTS5 fuzzy search, storing data in SQLite with automatic maintenance and token-efficient TOON output.3161MIT
- AlicenseNot gradedqualityAmaintenanceToken-efficient MCP server for MySQL, PostgreSQL, and SQLite written in Rust, providing SQL query execution and analysis tools with strong security guards.1MIT
- FlicenseNot gradedqualityCmaintenanceMCP server enabling natural-language querying of SQLite databases via schema discovery, GraphRAG retrieval, and safely guarded read-only SQL execution.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kenb38291-tech/fastmcp-sqlite'
If you have feedback or need assistance with the MCP directory API, please join our Discord server