Skip to main content

Overview

Mori includes an MCP (Model Context Protocol) server that lets AI coding agents interact with databases through Mori’s copy-on-write proxy. The server registers engine-specific tools and exposes them over HTTP using the Streamable HTTP transport. All queries from the MCP server go through the Mori proxy — reads hit prod, writes go to shadow. The AI agent gets real production data for context while mutations are safely isolated.

How It Works

1

Start Mori with MCP enabled

The MCP server starts alongside the proxy on a separate port.
2

Tools registered by engine

Mori registers the correct tools based on your database engine (SQL, Redis, or Firestore).
3

Agent connects via HTTP

AI agents connect to http://127.0.0.1:<mcp-port>/mcp using the MCP protocol.
4

Queries routed through proxy

The MCP server connects to the Mori proxy as a regular database client. From its perspective, Mori is just a database.

Tools by Engine

SQL Engines — db_query

All SQL engines share a single db_query tool. The underlying database driver varies by protocol: Tool: db_query

Redis — 4 Tools

The Redis MCP handler connects to the Mori proxy using the raw RESP protocol with AUTH support.

Firestore — 3 Tools

Supported operators for firestore_query: ==, !=, <, <=, >, >=, in, array-contains The Firestore MCP handler connects to the Mori proxy via gRPC as a Firestore emulator client.

Configuration

The MCP endpoint is available at http://127.0.0.1:9000/mcp.

Use Cases

Safe Production Queries

AI agents query real production data. All reads go through Mori’s read-only prod connection.

Risk-Free Mutations

Agents can INSERT, UPDATE, DELETE freely. All writes are captured in shadow — production is never touched.

Test-Verify Loops

Agents make changes, verify results, and iterate. Reset shadow to start fresh at any time.

Schema Exploration

Agents inspect table structures, run diagnostic queries, and understand the database safely.
The MCP server connects to Mori’s proxy using the standard database driver for your engine. It doesn’t need to know about the prod/shadow split — that’s handled transparently by the proxy.