Sqlite

io.github.ofershap由 GitHub 账号 ofershap 发布v1.0.1更新于 Oct 24, 2026

SQLite MCP — query databases, inspect schemas, explain queries, export data.

已验证STDIO仅桌面数据库数据与分析

概览

AI 生成的概览

让助手查询本地 SQLite 数据库文件、查看表结构、解释查询计划并导出结果。

可以做什么
提供对本地 SQLite 文件执行 SQL 的工具,结果以表格形式返回。可以列出完整表结构(含列、类型和行数),查看单张表的详细信息,运行 EXPLAIN QUERY PLAN 帮助优化查询,并列出目录中的 .db、.sqlite 和 .sqlite3 文件。默认以只读方式运行,仅允许 SELECT、PRAGMA、EXPLAIN 和 WITH,除非显式开启写入模式。
适用场景
适合处理本地 SQLite 数据库的场景,例如让助手查看有哪些表、执行查询或理解查询计划,而无需离开编辑器。对于偏好 npm 服务器而非 Python 参考实现的 TypeScript 或 Node.js 环境也很合适。
运行要求
通过 npm 包 mcp-sqlite-server 以 stdio 方式在本地运行,通常用 npx 启动,因此需要 Node.js。它读取本地 .db 文件,声明不需要认证、环境变量或请求头。支持 Claude Desktop、Cursor、VS Code Copilot 等桌面 MCP 客户端。
安装前请注意
默认只读,但在工具参数中设置 readonly=false 后会启用 INSERT、UPDATE 和 DELETE,可能修改或删除所打开数据库中的数据。只对愿意暴露给助手的数据库使用,并在开启写入模式前备份文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sqlite,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-server-sqlite

[npm version] [npm downloads] [CI] [TypeScript] [License: MIT]

Query SQLite databases, inspect schemas, and explain queries from your AI assistant. Read-only by default for safety.

bash
npx mcp-sqlite-server

Works with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Reads local .db files, no auth needed.

[MCP server for querying SQLite databases and inspecting schemas]

Demo built with remotion-readme-kit

Why

SQLite is everywhere. It's the default database for mobile apps, Electron apps, local-first tools, and increasingly for server-side projects too (Turso, Cloudflare D1, Bun's built-in SQLite). The official MCP reference includes a basic SQLite server, but it's Python-only. If you're working in a TypeScript/Node.js environment and want to ask your assistant "what tables are in this database?" or "run this query and show me the results," this server handles that. It opens the database read-only by default so you can explore safely, and you can opt into write mode when you need it.

Tools

ToolWhat it does
queryExecute SQL (SELECT, PRAGMA, EXPLAIN, WITH). Returns results as a table.
schemaGet full schema: all tables with columns, types, and row counts.
table_infoDetailed info for a single table: columns, constraints, row count.
explainRun EXPLAIN QUERY PLAN to optimize queries.
list_databasesList .db, .sqlite, .sqlite3 files in a directory.

Quick Start

Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "sqlite": {      "command": "npx",      "args": ["mcp-sqlite-server"]    }  }}

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "sqlite": {      "command": "npx",      "args": ["mcp-sqlite-server"]    }  }}

VS Code

Configure the MCP server in your VS Code settings to run npx mcp-sqlite-server.

Example prompts

  • "Show me the schema of my database at ./data.db"
  • "Query the users table: SELECT * FROM users LIMIT 10"
  • "Explain the query plan for this complex join"
  • "What tables are in this database?"
  • "Find all .db files in the current directory"

Safety

Read-only by default. The query tool accepts only SELECT, PRAGMA, EXPLAIN, and WITH in readonly mode. Set readonly=false in the tool args to enable INSERT, UPDATE, DELETE, etc.

Development

bash
npm installnpm run typechecknpm run buildnpm testnpm run formatnpm run lint

See also

More MCP servers and developer tools on my portfolio.

Author

[Made by ofershap]

[LinkedIn] [GitHub]


README built with README Builder

License

MIT © 2026 Ofer Shapira

来源:README.md,提交 a3b0323

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分