MCP Server Reference

The StrataDB MCP (Model Context Protocol) server exposes StrataDB as a tool provider for AI assistants like Claude.

Installation

# From crates.io
cargo install strata-mcp

# From source
git clone https://github.com/stratadb-labs/strata-core
cd strata-core
cargo install --path crates/mcp

Configuration

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "stratadb": {
      "command": "strata-mcp",
      "args": ["/path/to/data"]
    }
  }
}

In-Memory Mode

For ephemeral databases:

{
  "mcpServers": {
    "stratadb": {
      "command": "strata-mcp",
      "args": ["--memory"]
    }
  }
}

Command Line Options

OptionDescription
<PATH>Path to the database directory
--memoryUse ephemeral in-memory database
-h, --helpShow help
-V, --versionShow version

Tools

The MCP server exposes 50+ tools to AI assistants, organized by category.

Database Tools

ToolDescription
strata_pingCheck connectivity, returns version
strata_infoGet database statistics
strata_flushFlush pending writes to disk
strata_compactTrigger database compaction

KV Store Tools

ToolParametersDescription
strata_kv_putkey, valueStore a key-value pair
strata_kv_getkeyGet value by key
strata_kv_deletekeyDelete a key
strata_kv_listprefix?, limit?, cursor?List keys
strata_kv_historykeyGet version history

State Cell Tools

ToolParametersDescription
strata_state_setcell, valueSet state cell
strata_state_getcellGet state cell
strata_state_initcell, valueInitialize if not exists
strata_state_cascell, value, expected_version?Compare-and-swap
strata_state_deletecellDelete state cell
strata_state_listprefix?List state cells

Event Log Tools

ToolParametersDescription
strata_event_appendevent_type, payloadAppend event
strata_event_getsequenceGet by sequence
strata_event_listevent_type, limit?, after?List events
strata_event_lenGet event count

JSON Store Tools

ToolParametersDescription
strata_json_setkey, path, valueSet at JSONPath
strata_json_getkey, pathGet at JSONPath
strata_json_deletekey, pathDelete at JSONPath
strata_json_listprefix?, limit, cursor?List documents

Vector Store Tools

ToolParametersDescription
strata_vector_create_collectioncollection, dimension, metric?Create collection
strata_vector_delete_collectioncollectionDelete collection
strata_vector_list_collectionsList collections
strata_vector_upsertcollection, key, vector, metadata?Insert/update
strata_vector_getcollection, keyGet vector
strata_vector_deletecollection, keyDelete vector
strata_vector_searchcollection, query, k, filter?Search
strata_vector_batch_upsertcollection, entriesBatch insert

Branch Tools

ToolParametersDescription
strata_branch_createnameCreate branch
strata_branch_getnameGet branch info
strata_branch_listList branches
strata_branch_existsnameCheck existence
strata_branch_deletenameDelete branch
strata_branch_forksource, destinationFork branch
strata_branch_diffbranch_a, branch_bCompare branches
strata_branch_mergesource, target, strategy?Merge branches
strata_branch_usenameSwitch branch
strata_current_branchGet current branch
strata_branch_exportbranch, pathExport to bundle
strata_branch_importpathImport from bundle
strata_branch_validatepathValidate bundle

Space Tools

ToolParametersDescription
strata_space_createnameCreate space
strata_space_listList spaces
strata_space_existsnameCheck existence
strata_space_deletenameDelete empty space
strata_space_usenameSwitch space
strata_current_spaceGet current space

Transaction Tools

ToolParametersDescription
strata_txn_beginread_only?Begin transaction
strata_txn_commitCommit transaction
strata_txn_rollbackRollback transaction
strata_txn_infoGet transaction info
strata_txn_is_activeCheck if active

Search Tool

ToolParametersDescription
strata_searchquery, k?, primitives?Cross-primitive search

Usage with Claude

Once configured, Claude can use StrataDB tools naturally:

User: “Store my name as Alice”

Claude: I’ll store that for you. [Calls strata_kv_put with key=“name”, value=“Alice”]

Done! I’ve stored your name as “Alice” in the database.

User: “Create a branch called ‘experiment’ and switch to it”

Claude: I’ll create that branch and switch to it. [Calls strata_branch_create with name=“experiment”] [Calls strata_branch_use with name=“experiment”]

Done! Created the “experiment” branch and switched to it.


Error Handling

Tool errors are returned in the standard MCP error format:

{
  "error": {
    "code": -32000,
    "message": "Branch not found: nonexistent"
  }
}

Common error codes:

  • -32000: Application error (invalid operation, not found, etc.)
  • -32602: Invalid parameters
  • -32603: Internal error