sayanmohsin/thingd

By sayanmohsin

Updated about 1 hour ago

A fast object-first data engine for applications and AI agents.

Image
Message queues
Developer tools
Databases & storage
0

5.8K

sayanmohsin/thingd repository overview

thingd

A fast object-first data engine for applications and AI agents.

thingd is a high-performance object-first data engine that combines persistent storage, durable queues, event streams, full-text search, and MCP-native access into a single system that can run embedded, standalone, or in the cloud.

Quick start

docker run -p 8757:8757 sayanmohsin/thingd

This starts an HTTP MCP server at http://localhost:8757/mcp.

Persist data

docker run -p 8757:8757 \
  -v ./data:/data \
  sayanmohsin/thingd

Data is stored at /data/thingd.db inside the container.

Securing the server

docker run -p 8757:8757 \
  -e THINGD_AUTH_TOKEN=your-secret \
  sayanmohsin/thingd

Without an auth token, the server only binds to loopback (127.0.0.1). Setting THINGD_AUTH_TOKEN enables non-loopback binding.

Environment variables

VariableDefaultDescription
THINGD_PATH/data/thingd.dbPath to the SQLite database file
THINGD_DRIVERnativeStorage driver (native or memory)
THINGD_HOST0.0.0.0Bind address
THINGD_PORT8757HTTP server port
THINGD_AUTH_TOKENBearer token for /mcp endpoint. Required for non-loopback binding
THINGD_ALLOW_UNAUTHENTICATEDfalseSet to true to allow non-loopback binding without auth (local experiments only)
THINGD_MCP_AUDITtrueEnable audit events for MCP write tools
THINGD_MCP_ACTORDefault actor name for MCP audit events
THINGD_MCP_SOURCEDefault source name for MCP audit events
THINGD_MCP_COLLECTIONSComma-separated allowlist of collection names
THINGD_MCP_READ_ONLYfalseSet to true to disable all write tools
THINGD_MCP_MAX_PAYLOAD_BYTES524288Maximum MCP request payload size in bytes

Cluster mode

thingd supports leader/follower cluster deployments.

# Leader
docker run -p 8757:8757 \
  -e THINGD_CLUSTER_MODE=leader \
  sayanmohsin/thingd

# Follower
docker run -p 8757:8757 \
  -e THINGD_CLUSTER_MODE=follower \
  -e THINGD_CLUSTER_LEADER_URL=http://leader:8757 \
  sayanmohsin/thingd
Cluster environment variables
VariableDefaultDescription
THINGD_CLUSTER_MODEsinglesingle, leader, or follower
THINGD_CLUSTER_LEADER_URLLeader URL (required for followers)
THINGD_CLUSTER_LEADER_FALLBACK_URLFallback leader URL for basic failover
THINGD_CLUSTER_FORWARD_AUTH_TOKENBearer token for cross-pod forwarding. Falls back to THINGD_AUTH_TOKEN
THINGD_CLUSTER_PEERSComma-separated peer URLs for discovery
THINGD_CLUSTER_DISCOVERYnone, static, or kubernetes
THINGD_CLUSTER_SERVICEKubernetes service name for DNS discovery
THINGD_CLUSTER_NAMESPACEdefaultKubernetes namespace
THINGD_CLUSTER_PORT8757Port for Kubernetes service discovery
THINGD_ADVERTISE_URLSelf-advertised URL reported in cluster status

Docker Compose

services:
  thingd:
    image: sayanmohsin/thingd
    ports:
      - "8757:8757"
    volumes:
      - ./data:/data
    environment:
      - THINGD_AUTH_TOKEN=change-me

See the deploy/docker-compose.yml for a full leader/follower example.

Kubernetes

Kubernetes deployment manifests (sidecar and leader/follower) are available in the deploy/kubernetes directory.

Connecting with the SDK

import { ThingD } from "thingd";

const db = await ThingD.open({
  url: "http://localhost:8757/mcp",
  authToken: "change-me",
  driver: "remote",
});

Health check

GET /healthz

Cluster status

GET /cluster/status

Tag summary

Content type

Image

Digest

sha256:030145398

Size

5.6 MB

Last updated

about 1 hour ago

docker pull sayanmohsin/thingd