
Database Mcp Sqlite
io.github.arifulislamat由 GitHub 账号 arifulislamat 发布v0.5.0更新于 Oct 25, 2026
MCP server for SQLite databases. Read-only by default, row caps, statement timeouts.
概览
本地 MCP 服务器,通过 execute_sql 和 search_objects 两个工具,让 AI 助手以受保护、结构化的方式访问 SQLite 数据库文件。
- 可以做什么
- 对已配置的 SQLite 数据库文件执行 SQL 语句,默认启用只读模式、行数上限和语句超时(execute_sql)。逐步查看数据库结构:不带参数时列出数据表,指定表名时获取列、索引和外键(search_objects)。连接信息在启动时通过命令行参数、YAML 配置文件或环境变量设定,不接受通过工具调用传入。
- 适用场景
- 适合需要让助手查询或查看本地 SQLite 数据库的场景,例如回答关于库中数据的问题或了解表结构,同时不希望给予不受限制的写入权限。
- 运行要求
- 以 stdio 方式在本机运行,可用 npm 包、配合 uvx 运行的 PyPI 包,或用 cargo 安装的 Rust 二进制。需要设置 SQLITE_PATH 环境变量或用 --dsn 参数指向 SQLite 数据库文件。未声明任何身份验证。
安装
在 SourceWeft 中
- 打开 控制台中的 Database Mcp Sqlite,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
database-mcp
[CI] [License: MIT] [npm] [PyPI] [crates.io] [Node >= 22]
MCP servers that give AI clients safe, structured access to SQL databases.
One installable package per database engine, in TypeScript (npm), Python
(PyPI), and Rust (crates.io). Every package exposes the same minimal
two-tool surface, execute_sql and search_objects, with guardrails on by
default: read-only mode, row caps, and statement timeouts.
Packages
All three lines are published and pass the same language-agnostic conformance suite against real databases in CI, so behavior is identical regardless of language. Every engine is also listed on the MCP Registry with all three install options: npm, PyPI, and cargo.
Rust crates are named database-mcp-rs-<engine> because the plain names are
taken on crates.io; the command each one installs is still
database-mcp-<engine>. Go is planned.
Design principles
- Two tools, no more. A tiny tool surface keeps the model's context window
clean.
search_objectsprogressively discloses schema: call it with no arguments to list tables, with a table name to get columns, indexes, and foreign keys. - Safe by default. Read-only mode is enforced in two layers: a conservative SQL guard, plus a session-level read-only setting in the database itself. Rows are capped (default 1000) and statements time out (default 30s).
- Configured at launch, never via chat. Connection details come from flags, a YAML config file, or environment variables. Credentials are never accepted through a tool call.
- Secrets never appear in logs. Passwords live in non-printable secret types, DSNs are sanitized before logging, and a redaction filter guards the log boundary.
Quick start
Pick your engine's package; each README has the full config surface. SQLite via npm:
Or via PyPI: use "command": "uvx" and
"args": ["database-mcp-sqlite", "--dsn", "/absolute/path/to/database.db"].
Or as a native binary, with no Node or Python runtime: run
cargo install database-mcp-rs-sqlite, then use
"command": "database-mcp-sqlite" with the same args minus the package
name.
Flags, environment variables, and YAML config are identical across all three lines.
Networked engines take credentials from the environment (MYSQL_*,
MARIADB_*, POSTGRES_*/DATABASE_URL, LIBSQL_URL/LIBSQL_AUTH_TOKEN),
*_FILE mounted secrets, or a YAML file via --config. Never from a chat
prompt.
Contributing
See CONTRIBUTING.md. The short version: the conformance
suite is the definition of done. A change is mergeable only when
conformance/run.mjs passes against every affected server.
License
来源:README.md,提交 775af94
工具
0版本历史
2- v0.5.0最新Oct 17, 2026
- v0.4.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分