
Database Mcp Libsql
io.github.arifulislamat由 GitHub 账号 arifulislamat 发布v0.5.0更新于 Oct 24, 2026
MCP server for libSQL/Turso, local or remote. Read-only by default, row caps, timeouts.
概览
本地 MCP 服务器,通过两个工具让 AI 助手以受保护的方式访问本地或远程 libSQL/Turso 数据库。
- 可以做什么
- 通过 execute_sql 对本地文件或远程 libSQL/Turso 数据库执行 SQL 语句
- 通过 search_objects 探索结构:先列出表,再查看某张表的列、索引和外键
- 默认启用保护措施:只读模式、行数上限(默认 1000)和语句超时(默认 30 秒)
- 连接信息在启动时通过命令行参数、YAML 配置文件或环境变量提供
- 适用场景
- 当助手需要查询或查看 libSQL/Turso 数据库,又不希望暴露庞大的 SQL 工具集,并希望默认只读、结果集受限时适用。适合结构探索和临时只读查询,而非完整的数据库管理。
- 运行要求
- 以本地 stdio 进程运行;可通过 npm(@database-mcp/libsql)、PyPI(database-mcp-libsql,用 uvx 运行)或 Rust crate 二进制安装。需要 LIBSQL_URL 提供数据库地址(文件路径或 libsql:// 远程地址),远程数据库还需 LIBSQL_AUTH_TOKEN 认证令牌。连接信息也可来自命令行参数或 YAML 配置文件。
安装
在 SourceWeft 中
- 打开 控制台中的 Database Mcp Libsql,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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 分
