Spacetimedb Mcp Server — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Spacetimedb Mcp Server (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A comprehensive Model Context Protocol (MCP) server for SpacetimeDB - enabling AI assistants to interact with your SpacetimeDB instances, query tables, call reducers, and manage your database operations.
SpacetimeDB is a database that functions as a server, allowing you to run your application logic directly inside the database. Perfect for:
Bash:
cd spacetimedb-mcp-serverWindows CMD:
cd spacetimedb-mcp-serverBash/CMD:
npm installBash/CMD:
npm run buildAdd to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"spacetimedb": {
"command": "node",
"args": [
"E:\\AI\\claude\\spacetimedb-mcp-server\\dist\\index.js"
]
}
}
}The server runs on stdio transport and can be used with any MCP-compatible client:
Bash/CMD:
node dist/index.jsFirst, establish a connection to your SpacetimeDB instance:
// Connect to local instance
spacetimedb_connect({
uri: "ws://localhost:3000",
module_name: "my-game-server"
})
// Connect to cloud instance with auth
spacetimedb_connect({
uri: "wss://testnet.spacetimedb.com",
module_name: "my-production-module",
auth_token: "your-token-here"
})spacetimedb_list_tables({
include_schema: true
})// Simple query
spacetimedb_query_table({
table_name: "users"
})
// With filtering and pagination
spacetimedb_query_table({
table_name: "messages",
filter: '{"sender": "alice"}',
limit: 50,
offset: 0
})Reducers are server-side functions that modify database state:
// Call a reducer with arguments
spacetimedb_call_reducer({
reducer_name: "send_message",
args: '["Hello, world!", "general"]'
})
spacetimedb_call_reducer({
reducer_name: "set_name",
args: '["Alice"]'
})spacetimedb_subscribe_table({
table_name: "users",
filter: '{"online": true}'
})// Get entire database schema
spacetimedb_get_schema({})
// Get specific table schema
spacetimedb_get_schema({
table_name: "messages"
})spacetimedb_list_reducers({
include_signatures: true
})spacetimedb_execute_sql({
query: "SELECT * FROM users WHERE online = true"
})| Tool | Description |
|---|---|
spacetimedb_connect | Connect to a SpacetimeDB instance |
spacetimedb_disconnect | Disconnect from current instance |
spacetimedb_list_tables | List all tables with optional schema |
spacetimedb_query_table | Query table data with filtering/pagination |
spacetimedb_call_reducer | Invoke a reducer function |
spacetimedb_subscribe_table | Subscribe to real-time table updates |
spacetimedb_get_schema | Get database or table schema |
spacetimedb_list_reducers | List available reducers |
spacetimedb_get_identity | Get current client identity |
spacetimedb_execute_sql | Execute SQL queries |
spacetimedb_get_connection_info | Get connection status |
The server exposes the following resources:
spacetimedb://tables/{table_name} - Direct access to table dataspacetimedb://schema - Complete database schemaspacetimedb://reducers - List of all callable reducersThe SpacetimeDBConnectionManager class handles:
This MCP server uses a hybrid approach:
This provides maximum flexibility for both development and production use.
// Check online players
spacetimedb_query_table({
table_name: "players",
filter: '{"online": true}'
})
// Send player action
spacetimedb_call_reducer({
reducer_name: "player_move",
args: '[100, 200, 50]' // x, y, z coordinates
})// Get recent messages
spacetimedb_query_table({
table_name: "messages",
limit: 100
})
// Send new message
spacetimedb_call_reducer({
reducer_name: "send_message",
args: '["Hello everyone!", "general"]'
})// Subscribe to live metrics
spacetimedb_subscribe_table({
table_name: "system_metrics"
})
// Query historical data
spacetimedb_execute_sql({
query: "SELECT * FROM metrics WHERE timestamp > NOW() - INTERVAL '1 hour'"
})Bash/CMD:
npm run buildBash/CMD:
npm run devBash/CMD:
npm run watchMake sure SpacetimeDB CLI is installed:
Bash/Linux/macOS:
curl -fsSL https://install.spacetimedb.com | bashWindows PowerShell:
iwr https://install.spacetimedb.com -useb | iexWindows CMD:
rem Visit https://spacetimedb.com/install for the installerspacetime startList available modules:
Bash/CMD:
spacetime listDeploy your module:
Bash/CMD:
spacetime publish your-module-name --project-path ./path/to/moduleTo use this MCP server effectively, you'll need SpacetimeDB modules. Here's a quick example:
use spacetimedb::{table, reducer, SpacetimeType};
#[table(name = users)]
pub struct User {
#[primarykey]
pub identity: Identity,
pub name: String,
pub online: bool,
}
#[reducer]
pub fn set_name(ctx: &ReducerContext, name: String) -> Result<(), String> {
let user = User {
identity: ctx.sender,
name,
online: true,
};
ctx.db.users().insert(user)?;
Ok(())
}Compile and publish:
Bash/CMD:
spacetime publish my-module --project-path ./my-moduleexecute_sqlContributions welcome! This MCP server can be enhanced with:
MIT
Built with ❤️ for the SpacetimeDB and MCP communities
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.