mcpField
S
spacetimedb-http

spacetimedb-http

github.com/danmossaDevelopment2164 installsUpdated 19w ago
Repository

About spacetimedb-http

A skill for constructing requests to SpacetimeDB HTTP routes and understanding their behavior. It covers identity, database, SQL, logs, authorization, and WebSocket subscription endpoints.

Key features

  1. 01Authorization and bearer tokens
  2. 02Identity and database endpoints
  3. 03Reducer and SQL requests
  4. 04Schema and logs retrieval
  5. 05WebSocket subscription routes

Use cases

  1. 01Calling SpacetimeDB reducers over HTTP
  2. 02Running SQL and reading database schema
  3. 03Building custom subscription tooling

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/danmossa/spacetimedb-skills --skill spacetimedb-http

After installing, type/spacetimedb-httpin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
http-authorization.md
http-database.md
http-identity.md

Details

From the project README

Use this skill for SpacetimeDB HTTP route behavior and request construction.

Core HTTP patterns

  • Most HTTP endpoints accept Authorization: Bearer <token>. Without it, database endpoints usually allocate or use an anonymous identity with public-table access only.
  • POST /v1/identity returns { "identity": string, "token": string }.
  • POST /v1/database/:name_or_identity/call/:reducer invokes a reducer or procedure. The request body is a JSON array of arguments.
  • POST /v1/database/:name_or_identity/sql runs one or more SQL statements separated by ; and returns JSON statement results with schema and rows.
  • GET /v1/database/:name_or_identity/schema?version=... returns RawModuleDef JSON and maps to spacetime describe.
  • GET /v1/database/:name_or_identity/logs requires database ownership and maps to spacetime logs.
  • WebSocket subscriptions use /v1/database/:name_or_identity/subscribe with the v1.bsatn.spacetimedb or v1.json.spacetimedb subprotocol; prefer SDKs unless building custom tooling.

Request cautions

  • Management endpoints are primarily for tooling, debugging, and administration; use SDK WebSocket clients for normal app traffic.
  • Anonymous HTTP reducer calls pass an anonymous identity to ReducerContext; module auth logic may reject them.
  • HTTP SQL sees only public rows for anonymous callers and is subject to RLS.
  • Route SQL syntax to spacetimedb-sql before writing non-trivial query strings.

Reference map

NeedOpen
Authorization headers and pingreferences/http-authorization.md
Database endpointsreferences/http-database.md
Identity endpointsreferences/http-identity.md

Guidance

  • Include the required bearer token behavior when giving endpoint examples.
  • Route SQL syntax questions to spacetimedb-sql.
  • Route SDK connection questions to spacetimedb-clients.

Comments

Markdown supported