1. MooseStack
  2. The Moose Runtime

On this page

Execution ModesThe Infrastructure MapFinding DependenciesNext Steps

The Moose Runtime

The Moose Runtime is the execution engine for your MooseStack application. It connects your code to your infrastructure by:

  • Managing Data Schemas: It automatically applies changes to ClickHouse and Redpanda based on your code.
  • Running Your Application: It provides the server that runs your APIs, streaming consumers, data synchronization (e.g. Kafka to ClickHouse) workflows, and other server-side processes defined in your code.

This integrated approach provides the best experience for most applications. However, if you only need schema management for ClickHouse (the olap feature), you can use Moose as a library without the full runtime server.

Execution Modes

Moose runs in two ways: moose dev and moose prod.

Local Development (moose dev)

Production (moose prod)

Auto-Provisioned Infrastructure

Automatically starts/stops Docker containers for ClickHouse, Redpanda, Temporal, and Redis when you start/stop the local development server.

Bring Your Own Infrastructure

You bring your own infrastructure. Moose Runtime won't start databases for you in production. It expects services to be running and connects via environment variables.

Hot Reloaded Migrations

Includes a file watcher that instantly hot-reloads migrations to your local infrastructure when you save your code changes.

Single Migration

Migrations run once at startup using a `plan` file, rather than watching for code changes.

Built-in MCP Server

Includes a Model Context Protocol server so AI assistants can query your data and logs.

Learn more

No AI Helper

The Model Context Protocol server is disabled in production (remote MCP server coming soon).

Local Prototyping

Even if you are not using the Moose Runtime in production, it is a useful tool for quickly prototyping OLAP models locally. You do not need to have a production environment set up to use the local development server.

The Infrastructure Map

The core of the Moose Runtime is the infrastructure map. This is a representation of your infrastructure as it exists in your code. The runtime uses this map to determine exactly what needs to be provisioned, migrated, or destroyed to make your live infrastructure match your code.

Finding Dependencies

Moose Runtime looks at your Root Entrypoint (index.ts for TypeScript or main.py for Python) to figure out what resources to include in the infrastructure map. For MooseStack to manage a resource (like a Table, Stream, or API), it must be declared in or reachable from your root file.

This "strict declaration" rule ensures that your running infrastructure always matches the active code path of your application, preventing "zombie" tables or endpoints from lingering in your environment.

Next Steps

  • Configure Development: Learn how to add your own Docker containers and scripts.
  • Networking Reference: See the default ports and URLs Moose uses.
  • Project Configuration: Learn about moose.config.toml and feature flags.
  • Deployment: Learn how to package and run Moose in production.
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506