Skip to main content

Manual Setup

Prerequisites

  • Docker (for shadow containers — required for all engines except SQLite and DuckDB)

Install

Steps

1

Initialize a connection

Point Mori at your production database. The interactive setup walks you through engine, provider, and credentials.
For a non-interactive setup, you can pass a connection string directly:
This saves the connection config to mori.yaml. No containers or connections are created yet.
2

Start the proxy

On first run, Mori:
  1. Connects to your production database
  2. Discovers schema and structure (SQL engines dump tables/types/sequences; Firestore discovers collections; Redis scans key prefixes)
  3. Spins up a shadow database (Docker container, local file copy, or emulator)
  4. Replicates structure to shadow (SQL engines replay schema; Firestore seeds documents; Redis starts empty)
  5. Detects and replicates extensions to shadow (PostgreSQL — auto-installs via apt-get if needed; use --image on mori init for custom images)
  6. Offsets auto-increment sequences to prevent PK collisions (SQL engines only)
  7. Starts the proxy and listens on a local port
Use --port to pick a specific port, or let Mori auto-assign. Subsequent starts are faster since the shadow already exists.If complex queries over large tables are slow, you can limit how many rows Mori hydrates from prod per query:
3

Point your app at Mori

Swap your application’s connection string to point at 127.0.0.1 on the proxy port. Same driver, same protocol — your app won’t know the difference.
4

Stop Mori

Closes the connection to prod and spins down the shadow container. State is persisted for future runs.
5

Soft reset between runs

Wipe all local state to quickly start fresh on the next run.
6

Hard reset when schema changes

Wipes all local state and deletes the shadow container. Use this when the production schema has changed since the last init. This takes longer than a soft reset.

Enabling the MCP Server

Start Mori with the MCP server for AI agent integration:
AI agents connect to http://127.0.0.1:9000/mcp and get engine-specific tools (SQL queries, Redis commands, or Firestore operations) — all safely routed through the proxy.

Lifecycle

For AI Agents

If you’re setting up Mori with an AI coding agent, download the skill.md file and add it to your project root. Point your agent at it — it contains everything needed to install, initialize, and start Mori.
Your agent can read skill.md and handle the rest autonomously.