fastmcp-sqlite
Production-grade, token-optimized FastMCP SQLite Server with sub-millisecond O(1) schema discovery, opcode execution watchdog, and fuzzy self-healing.
Install / Use
claude mcp add kenb38291-tech -- npx -y github:kenb38291-tech/fastmcp-sqliteIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of fastmcp-sqlite
fastmcp-sqlite scores 83/100 on our quality scale, 655th of 955 AI & Machine Learning skills we index.
Its MCP Server is 31 KB long, well organised into 26 sections with 27 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so fastmcp-sqlite is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-19. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
fastmcp-sqlite compared with similar skills
All 4 of these similar skills score higher than fastmcp-sqlite; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| fastmcp-sqlite (this skill)by kenb38291-tech | 83 | 3 | 57d ago | MCP Server |
| claude-memby thedotmack | 100 | 113.8k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.5k | 1d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 91.0k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install fastmcp-sqlite?
- Run
claude mcp add kenb38291-tech -- npx -y github:kenb38291-tech/fastmcp-sqlite. The install tabs above show the steps for each supported agent. - Which AI agents does fastmcp-sqlite work with?
- It is written for Claude Code, Claude Desktop, Cursor and Zed, as a MCP Server file. Other agents that read the same format can often use it too.
- Is fastmcp-sqlite safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is fastmcp-sqlite still maintained?
- The repository was last updated about 2 months ago, so fastmcp-sqlite is actively maintained.
Skill content
View source on GitHubfastmcp-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, 400-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 50,000,000 opcodes. │ │
│ │ └─ Execution halted gracefully · Zero process hang · Transaction rolled back │ │
│ └────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────┘
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-write
[!NOTE] When executed directly in a terminal,
fastmcp-sqlitelistens quietly onstdiofor 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.db
Or 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:
<details open> <summary><strong>Claude Desktop (<code>claude_desktop_config.json</code>)</strong></summary>[!IMPORTANT] 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.json - Windows:
%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"]
}
}
}
</details> <details> <summary><strong>Cursor IDE (<code>.cursor/mcp.json</code>)</strong></summary>[!TIP] 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/t
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
113.8kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
109.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
91.0kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
79.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
