Local SQL workspaces with bounded, recoverable writes for coding agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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:
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.
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.
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:
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.
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.
Use database.connect() when SQL transaction statements need to span multiple
calls.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/basalt-2)<a href="https://allmcps.com/mcp/basalt-2"><img src="https://allmcps.com/api/badge/basalt-2?style=directory" alt="Basalt on AllMCPs" /></a>