Embedded mode (zero config)
Embedded mode runs everything in a single binary with no external dependencies. Data is stored locally using SQLite, an in-memory cache, and filesystem-based blob storage.- SQLite database at
./data/mrp.db(WAL mode) - In-memory cache for agent status, ACL lookups, and discovery results
- Filesystem blobs at
./data/blobs/ - In-memory rate limiter, replay guard, and webhook queue
How mode is selected
The relay auto-detects which mode to use:| Condition | Mode |
|---|---|
MRP_MODE=embedded set | Embedded |
MRP_MODE=external set | External |
DATABASE_URL is set | External |
| Nothing set | Embedded (default) |
Configuration
Embedded mode accepts these environment variables:| Variable | Default | Description |
|---|---|---|
MRP_MODE | auto-detect | Force embedded or external |
DATA_DIR | ./data | Directory for SQLite database and blob files |
PORT | 8080 | HTTP server port |
LOG_LEVEL | info | Log level (debug, info, warn, error) |
TIMESTAMP_TOLERANCE | 5m | Max age for request timestamps |
Data directory structure
When to use embedded mode
- Development and testing — spin up a relay instantly without Docker or infrastructure
- Single-machine deployments — personal relays, home labs, CI/CD test fixtures
- Edge deployments — IoT gateways, embedded systems, air-gapped networks
- Evaluation — try MRP without provisioning any services
Limitations
- Single-process — no horizontal scaling (one relay instance per data directory)
- In-memory state — rate limiter, replay guard, and webhook retry queue are lost on restart
- SQLite concurrency — handles moderate concurrent writes; high-throughput production use should use external mode
- No blob replication — blobs are stored on the local filesystem only
External mode (production)
For production deployments, use external mode with PostgreSQL, Redis, and S3-compatible storage:Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | — | PostgreSQL connection string |
REDIS_URL | Yes | — | Redis connection string |
PORT | No | 8080 | HTTP server port |
S3_ENDPOINT | No | — | S3-compatible endpoint URL |
S3_BUCKET | No | — | S3 bucket name |
S3_ACCESS_KEY | No | — | S3 access key |
S3_SECRET_KEY | No | — | S3 secret key |
S3_REGION | No | us-east-1 | S3 region |
TIMESTAMP_TOLERANCE | No | 5m | Max age for request timestamps |
LOG_LEVEL | No | info | Log level |
WEBHOOK_ENCRYPTION_KEY | No | — | Encryption key for stored webhook secrets |
Docker Compose
The quickest way to get external mode running locally:Pointing SDKs to your relay
All MRP SDKs accept a relay URL. Replacehttps://relay.mrphub.io with your self-hosted relay: