Litebase

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Oct 29, 2026

SQLite database access for agents: query, write, create and describe tables, record insights.

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

概览

AI 生成的概览

Litebase 让助手操作本地 SQLite 数据库文件:查询、写入、建表、查看表结构,并记录分析笔记。

可以做什么
  • 执行单条 SELECT 或 WITH 查询,返回列名与对象形式的行数据
  • 执行 INSERT、UPDATE、DELETE,并报告影响行数与最后插入的 rowid
  • 创建表,列出并描述数据库中的用户表
  • 把编号笔记追加到内存备忘录,并返回当前全部内容
  • 每个工具只接受对应类型的语句,且一次仅一条
适用场景
适合需要在本机使用一个小型、自包含 SQL 数据库做分析或原型验证的场景,无需部署服务器或编译原生扩展。当文件路径或内存数据库就足够时使用最合适。
运行要求
以本地 stdio 进程运行,可通过 npx 或 Docker 镜像启动。需要 Node 22.5 或更高版本,因为依赖内置的 node:sqlite 模块,推荐 Node 24。数据库路径依次取 mcp 后的参数、LITEBASE_DB 环境变量、当前目录下的 ./litebase.db。无需账号、密钥或网络访问。
安装前请注意
写入类工具会直接修改目标数据库文件,create_table 会新增表;虽然没有删表工具,但 INSERT、UPDATE、DELETE 会立即执行。请指向可丢弃或已备份的数据库文件,不要用于重要数据。备忘录仅存于内存,服务器重启后丢失。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

litebase

litebase gives you a SQLite database you can drive from a terminal or hand to an agent as an MCP server. It covers the everyday loop of working with a small database: create tables, put rows in, change them, read them back, check what a table looks like, and keep a running memo of what you learned from the data along the way.

There is nothing to provision and no native addon to compile: the storage engine is the SQLite library built into Node itself (node:sqlite), so a "database" is just a file path — or :memory: when you want a throwaway one.

Install

bash
npx @reneturcios/litebase tables ./data.db

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/litebase

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

Node version requirement

litebase's engine is Node's built-in node:sqlite module, which only exists in Node 22.5 and newer. The package's engines field says >=20 because that is the fleet standard, but that is an honest gap: on Node 20 the CLI and server start, and then fail the moment a database is opened, with an error that names the Node >= 22.5 requirement. Use Node 22.5+ (Node 24 recommended) to actually read or write data.

CLI

bash
# List the user tables in a database filelitebase tables ./data.db
# Run a read query; rows print as JSON objectslitebase query ./data.db "SELECT id, name FROM users ORDER BY id"
litebase --version

Which database the MCP server opens is resolved in this order: the path argument after mcp, then the LITEBASE_DB environment variable, then ./litebase.db in the current directory.

Exit codes: 0 on success, 1 when a query or the database itself errors (the message says why), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/litebase mcp ./data.db

MCP client configuration:

json
{  "mcpServers": {    "litebase": {      "command": "npx",      "args": ["-y", "@reneturcios/litebase", "mcp", "./data.db"]    }  }}

The database is opened lazily on the first tool call, so starting the server never creates a file by itself.

Tools

ToolInputWhat it does
read_queryquery (string, required)Runs one SELECT (or WITH ... SELECT) statement and returns the column names plus the rows as objects.
write_queryquery (string, required)Runs one INSERT, UPDATE, or DELETE statement and reports how many rows were affected and the last insert rowid.
create_tablequery (string, required)Runs one CREATE TABLE statement.
list_tables—Lists the database's user tables (SQLite's internal sqlite_% tables are hidden).
describe_tabletable_name (string, required)Returns a table's columns with their declared types, nullability, defaults, and primary-key flags.
append_insightinsight (string, required)Adds a note to the in-memory insights memo and returns the full memo text so far.

Statement guards

Each tool only accepts the kind of statement it is for, and only one statement at a time:

  • read_query rejects anything that does not start with SELECT or WITH.
  • write_query rejects SELECT, CREATE, DROP, and everything else that is not INSERT, UPDATE, or DELETE.
  • create_table rejects anything that is not CREATE TABLE.
  • A second statement smuggled in after a ; is rejected before anything executes.
  • describe_table only accepts a plain table name (letters, digits, underscores) — the name goes into a PRAGMA, so it is validated rather than parameterised.

Guard rejections and SQL errors come back as tool errors with a message naming the problem; nothing is executed on a rejected call.

Insights memo

append_insight keeps a numbered memo on the server instance: every call appends one insight and returns the whole memo, so an agent can build up findings during an analysis session and read them back as a single text. The memo lives in memory only — it is not written to the database file and does not survive a server restart.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no networknpm run dev     # run the CLI from source via tsx

Tests run against in-memory and temporary-file databases; no network access is needed.

License

MIT — see LICENSE.

来源:README.md,提交 64d2fce

工具

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

版本历史

1
  1. v0.1.0最新Oct 29, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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