
Basalt
io.github.joshiii-xyz由 GitHub 帳號 joshiii-xyz 發布v0.1.6更新於 Oct 24, 2026
Local SQL workspaces with bounded, recoverable writes for coding agents.
概覽
Basalt 是一個本機嵌入式 SQL 資料庫與 stdio MCP 伺服器,為編碼代理提供有界、可復原的 SQL 工作區。
- 可以做什麼
- Basalt 以本機 stdio MCP 伺服器形式執行,底層是以 Rust 撰寫的嵌入式 SQL 資料庫。在工作區模式下,它提供 workspace_import、workspace_inspect、workspace_preview、workspace_plan、workspace_apply、workspace_history、workspace_diff、workspace_undo 與 workspace_export 等工具,以及有界的 query、list_tables、describe_table 工具和位於 basalt://schema 的結構描述資源。寫入遵循明確的預覽/套用流程:可以先檢查擬議的變更,依精確的 plan ID 套用,再進行差異比較或復原。也提供直接資料庫模式,預設為唯讀。
- 適用情境
- 當代理或指令碼需要一個一次性的本機關聯式區域來處理 CSV、JSON、日誌、問題匯出或測試資料,而且有界、可復原的寫入比取代現有資料庫更重要時,適合使用。它不是 SQLite 相容替代品,也不是託管資料庫;需要相容性或分析效能時應使用 SQLite 或 DuckDB。
- 執行需求
- 以本機程序透過 stdio 執行。透過 Cargo 安裝 basalt-db 套件需要 Rust 1.88 或更新版本;帶標籤的發行版也提供適用於 Linux、macOS 與 Windows 的預建二進位檔與含校驗和的安裝程式。MCP 主機必須設定絕對工作區路徑,直接模式則設定資料庫路徑。未宣告任何帳戶、API 金鑰、環境變數或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Basalt,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Basalt is an embedded SQL database and command-line application built from scratch in Rust. It provides a small library API, an interactive shell, durable storage, snapshot-isolated transactions, crash recovery, portable structured-data workspaces, and a stdio MCP server for local AI agents. It is not a SQLite-compatible replacement or a hosted database.
Highlights
- SQL lexer and recursive-descent parser with expressions, joins, grouping, aggregates, aliases, and transaction statements.
- Atomic statement execution with primary-key, UNIQUE, and user-created indexes.
- Snapshot-isolated transactions with optimistic conflict detection.
- Checksummed page snapshots and a write-ahead log that recovers committed state after a process crash.
- Simple query planning with table scans, equality indexes, and range indexes.
- Interactive and scriptable CLI output in table, CSV, and JSON-lines formats.
- Portable workspaces with versioned metadata and atomic CSV, JSON/JSONL, and SQL dump import/export.
- Installable MCP server with typed SQL tools, bounded workspace imports and exports, engine-bounded SQL, schema resources, and recoverable agent changes.
Installation
Rust 1.88 or newer is required for a Cargo install.
The published package is named basalt-db; the installed command remains
basalt. To install the current checkout instead, use
cargo install --path . --locked.
Tagged releases include checksummed installers and prebuilt binaries for Linux, macOS, and Windows. See GitHub Releases for the current no-toolchain install. The latest tagged release is verified from its published installer and its checksums:
To run directly from a checkout:
Quick start
Open a database and run SQL interactively:
For a one-shot command:
Use Database::in_memory() for an ephemeral database. Durable writes are
appended to the WAL immediately; call checkpoint() to fold the current state
into the snapshot and clear old WAL frames. A durable path is owned by one
process at a time; cloned Database handles share that owner safely across
threads, while a second process receives an "already open" error.
Workspaces
Use a workspace when an agent or script needs a disposable, local relational area for CSV, JSON, logs, issue exports, or fixtures:
Imports are atomic, recoverable, and return a durable change_id; exports are
deterministic. Add --json to workspace import/export commands when an agent or
script needs a machine-readable operation report; raw exports to - remain
clean data streams. Later writes can be previewed, applied by exact plan ID,
inspected in history, diffed with schema and row-change counts, and undone when
they are the latest change. A workspace is owned by one Basalt process while
open, so stop a
workspace MCP server before using that workspace from the CLI or by opening its
data.basalt file directly. See docs/workspaces.md for
the format and boundaries.
The reason to use Basalt for agent-owned data is the write boundary: inspect a proposed change before it is durable, apply only the exact reviewed plan, then diff or undo the latest change if needed.
Use SQLite or DuckDB when you need their compatibility or analytical performance. Basalt is for local structured-data work where a bounded, recoverable write matters more than replacing an existing database.
If that describes your workflow, use the early-user validation guide with a disposable, non-sensitive input and record the concrete task and blocker. Basalt does not claim adoption until developers complete this workflow against the tools they already use.
MCP server
Basalt can run as a local Model Context Protocol server over stdio. Install the binary from this checkout:
Then configure an MCP host with an absolute workspace path. Workspace mode is the recommended agent integration: it scopes data access and requires an explicit preview/apply lifecycle for writes.
--init-workspace creates the configured workspace only when its path does not
exist; it never replaces an existing directory or manifest. Omit it when the
workspace must be provisioned separately. Add "--allow-writes" only when the
host has an explicit operator approval policy for applying workspace plans and
undoing changes. Direct database mode is still available with "args": ["mcp", "/absolute/path/to/app.basalt"], but it is read-only by default; execute and
checkpoint require the same flag. Use "args": ["mcp", ":memory:"] for an
ephemeral direct-mode session. The installed binary is preferred for host
configuration; running from a checkout is also possible with cargo run --quiet -- mcp --workspace /absolute/path/to/project-data.
When a modern MCP host advertises form elicitation, Basalt returns an
input_required approval request before each workspace import, apply, or undo
and executes only after the host retries with an explicit approval. Legacy
initialized hosts receive elicitation/create; hosts that do not advertise
elicitation use the explicit --allow-writes startup policy.
The release metadata carries the visible Cargo ownership marker used by the MCP Registry listing:
- MCP Registry ownership marker: mcp-name: io.github.yoshiii-xyz/basalt
- Published listing: io.github.yoshiii-xyz/basalt
Workspace mode exposes workspace_import, workspace_inspect,
workspace_preview, workspace_plan, workspace_apply,
workspace_history, workspace_diff, workspace_undo, and
workspace_export, alongside bounded query, list_tables, and
describe_table tools. It also exposes the current schema at
basalt://schema. See docs/mcp.md for the complete tool
contract, configuration details, approval boundary, and troubleshooting.
CLI
Execute a SQL file:
Run commands in order on one connection, including a transaction spanning multiple commands:
Use --file - to read SQL from stdin. Repeat --command and --file as
needed; they execute in the order they appear. Table output is human-readable,
CSV emits query rows, and --json emits one JSON object per statement. Run
.help inside the shell for .tables, .schema, .mode, .headers,
.checkpoint, .show, and .clear. Each CLI SQL action and the pending
interactive buffer is limited to 16 MiB; larger scripts should be split into
smaller actions or use the bounded workspace import formats.
Library usage
Use database.connect() when SQL transaction statements need to span multiple
calls.
Project layout
Development
For the complete Unix release preflight, use:
It installs the exact packaged crate into a temporary prefix and runs the
installed-binary smoke journey. It also runs cargo audit and dist plan
when those tools are available.
See CONTRIBUTING.md for contribution guidelines and CHANGELOG.md for project history. The release checklist is in docs/release.md, including the generated release workflow and clean-binary smoke test.
License
MIT. See LICENSE.
來源:README.md,提交 f03e8d3
工具
0版本歷史
1- v0.1.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分