Skip to main content

Getting Started

OPRELAY is a self-hosted MCP server with built-in SQLite storage — no database setup required. It gives your AI agents persistent memory and coordinated task handoff.

Quick start

git clone git@github.com:oprelay/oprelay.git && cd oprelay
cd server
cp .env.example .env
npm install
npm run build
npm run dev # http://localhost:3100

That's it. SQLite is the default — the server creates a local database file automatically. Dashboard is at http://localhost:3100.

Connect your agent

Add this to your MCP client configuration (.mcp.json, .cursor/mcp.json, etc.):

Try it now (hosted)

Skip setup entirely — connect to the hosted OPRELAY instance:

{
"mcpServers": {
"oprelay": {
"type": "streamable-http",
"url": "https://connect.oprelay.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_AUTH_TOKEN"
}
}
}
}

Works with any client that supports streamable-http transport (Claude Code, Cursor, etc.).

Local (stdio)

For self-hosted instances, use stdio transport:

{
"mcpServers": {
"oprelay": {
"command": "node",
"args": ["/path/to/oprelay/server/dist/src/index.js"],
"env": {
"MCP_AUTH_TOKEN": "your-token",
"DATABASE_TYPE": "sqlite"
}
}
}
}

Use case 1: Persistent memory (single agent)

The problem: your agent forgets everything between sessions. You repeat the same context every time — what database you use, what conventions you follow, what you already tried.

Session 1 — agent learns about your project:

// Store what it discovers
→ upsert_fact("infra.db.type", { "engine": "MariaDB 10.11", "version": "10.11.6" })
→ upsert_fact("deploy.target", { "os": "Ubuntu 22.04", "host": "prod-1" })
→ upsert_decision("Use JWT auth — stateless API, no server-side sessions")
→ record_run("Audited infrastructure stack, documented 12 facts")

Session 2 — agent picks up where it left off:

// One call loads everything
→ get_context("my-project")
12 facts loaded — knows your stack without asking
3 decisions loaded — knows your conventions
✓ Run history — knows what was already done

No re-explaining. No "remind me what database we use." Your agent has total recall.

Use case 2: Multi-agent coordination

The problem: you have two agents working the same repo. They both grab the same ticket, both edit the same file. Merge conflicts, duplicated work, wasted tokens.

Agent A breaks work into tasks:

→ core_create_task("Implement OAuth2 flow", priority: "high")
→ core_create_task("Add rate limiting middleware")
→ core_create_task("Write integration tests")

Agent B claims work — no conflicts:

→ core_claim_task(task_id)  // advisory lock prevents double-claiming
→ upsert_fact("api.auth", { "pattern": "PKCE", "token_ttl": "1h" })

Agent A sees what B discovered:

→ get_context("my-project")
✓ Sees B's OAuth discovery — builds on it, doesn't redo it
→ core_claim_task(next_task_id) // picks up rate limiting instead

You see everything in the dashboard — who claimed what, what's in progress, what failed, full audit trail.

What's next