openport
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openportresume my last session and load memory for the desk project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenPort
Portable agent memory over MCP.
OpenPort is a small server your LLM clients can share. It stores standing preferences, task skills, and session handoffs. You control the server, so Cursor, Claude, Codex, or anything else that speaks MCP can pick up the same state.
Agents load only the scopes they need for the current task. Asking for a full dump of every project fails on purpose.
Layer | Purpose |
Memory | What is true: scoped prefs and project notes |
Skill | How to work: a procedure bound for this session |
Session | Handoffs so the next client can continue |
License: MIT. Hosts: local Node + SQLite, or Cloudflare Workers + D1. Security: SECURITY.md. Contributing: CONTRIBUTING.md.
Why this exists
Most setups do one of two things:
Stuff everything into the prompt every turn (slow, noisy, expensive)
Keep memory inside one client (fine until you switch tools)
OpenPort is the boring middle path. Durable truth lives as markdown scopes in SQLite. Clients call MCP tools to load a small slice, do the work, then write back what changed.
Related MCP server: mindmap-mcp-server
What you get
Scoped load contract.
get_contextneeds explicit scopes. Must-load rules always apply. At most one project ("local") scope per call.One-shot start.
start_sessionloads memory, bindsbootstrap(seed) orresume-work, and returnsnext_action.Skills. Bind a procedure with
learn_workflow(or viastart_session). Unchanged skills can skip the body via hash.Session handoffs.
session_notefor the next client. Old notes prune after a retention window (default 14 days).Write guards. Optional strict checks that keep live dumps out of durable memory.
Two hosts. Run locally with no cloud account, or deploy the Cloudflare adapter.
Markdown backup. Export/import a zip of scopes, skills, and docs on the local host.
Host-agnostic core.
/srctalks to aSqlDatabaseinterface. New platforms go underplatforms/.
Requirements
Node.js 22+
For Cloudflare: a Cloudflare account. Wrangler comes in via
npm.
Quick start (one-liner)
No clone required. The local stdio host seeds a starter desk + example _session handoff on first run. DB persists at ~/.openport/openport.sqlite.
npx -y github:theodorexli/openportCursor
~/.cursor/mcp.json:
{
"mcpServers": {
"openport": {
"command": "npx",
"args": ["-y", "github:theodorexli/openport"]
}
}
}Claude Code
claude mcp add openport -- npx -y github:theodorexli/openportCodex
[mcp_servers.openport]
command = "npx"
args = ["-y", "github:theodorexli/openport"]Behavior is not automatic. Connecting MCP only exposes tools. Paste seed/docs/client-instructions.md into Cursor User Rules / Claude project instructions / AGENTS.md, or use MCP prompts resume / handoff when your client surfaces them.
When the package is on the npm registry you can swap the args for ["-y", "openport"].
Quick start (clone)
git clone https://github.com/theodorexli/openport.git
cd openport
npm install
npm run local:stdio # good default for Cursor / Claude / Codex
# or
npm run local # HTTP MCP at http://127.0.0.1:8787/mcp
# or
npx openport # same stdio entry via package binA fresh DB seeds an example desk project scope (usable defaults + <!-- openport:seed -->), a starter _session handoff, and skills bootstrap / resume-work.
Cursor (clone path)
Put this in ~/.cursor/mcp.json (use your real clone path):
{
"mcpServers": {
"openport": {
"command": "npx",
"args": ["tsx", "platforms/local/stdio.ts"],
"cwd": "/ABSOLUTE/PATH/TO/openport"
}
}
}HTTP works too. Run npm run local first, then point mcp-remote at it:
{
"mcpServers": {
"openport": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://127.0.0.1:8787/mcp"]
}
}
}Claude Desktop
Same stdio block in claude_desktop_config.json (one-liner or clone path).
Claude Code (clone)
# from the repo root
claude mcp add openport -- npx tsx platforms/local/stdio.ts
# or HTTP after `npm run local`
claude mcp add --transport http openport http://127.0.0.1:8787/mcpCodex (clone)
Codex reads TOML from ~/.codex/config.toml (or a trusted project's .codex/config.toml):
[mcp_servers.openport]
command = "npx"
args = ["tsx", "platforms/local/stdio.ts"]
cwd = "/ABSOLUTE/PATH/TO/openport"HTTP after npm run local:
[mcp_servers.openport]
url = "http://127.0.0.1:8787/mcp"Or from the repo root:
codex mcp add openport -- npx tsx platforms/local/stdio.ts
# or
codex mcp add openport --url http://127.0.0.1:8787/mcpEnv vars, reseed, and backup live in platforms/local/README.md.
First session
Once the MCP server is connected — paste standing rules from seed/docs/client-instructions.md (strongest lever; MCP instructions alone are easy to ignore):
1. start_session({ local: "desk" })
2. If mode is "bootstrap": answer the short interview so desk becomes yours
If mode is "resume": continue from prefs / open threads / _session
3. … do the work …
4. update_context({
scope: "desk",
context: "",
mode: "append",
session_note: "new: finished triage; left VIP thread open"
})start_session is the one-shot path (load + bind skill + next_action). Empty context + session_note is handoff-only. Swap desk for your project id when you have one.
How memory works
Scopes
Kind | Id | Role |
Important |
| Must-load callouts (always included) |
Protected |
| Must-load hard limits (always included) |
Global |
| Shared across projects (opt-in) |
Local | any other id | One project or instruction set |
Session |
| Work-session handoffs; retention prunes old notes |
Workflow |
| Tracks the active skill binding |
Load contract (server-enforced)
get_contextrequiresscopes=orscope=. A bare call errors. No full dump._importantand_protectedalways get merged in.At most one local scope per call. Zero locals is fine if you only need standing rules.
Pull
_session/_globalwith flags or by listing them. Don't reload every project "just in case."Persist durable truth with
update_context. Usesession_notefor handoffs, not live system state.
MCP tools
Tool | Role |
| Load by scope. Prefer |
| Preferred start. Load + bind bootstrap/resume-work + |
| Bind a skill. Usually done by |
| Write memory. Optional |
| Prune session retention / archived noise |
| Read or author skills |
| Read or author docs |
| Health check |
Starter docs also live under seed/docs/.
Deploy on Cloudflare
Reference host is Workers + D1. Longer guide: platforms/cloudflare/README.md.
Agent-assisted install: point a client at seed/skills/install.md. It asks about auth, retention, and write guards, waits for your confirm, then runs the Wrangler steps.
Manual:
npm install
npx wrangler login
npm run db:create
# Paste database_id into platforms/cloudflare/wrangler.toml
npm run db:migrate
npm run db:seed
npm run deployPoint your client at https://YOUR_WORKER.workers.dev/mcp (or /mcp/{token} for personal auth).
Local Worker preview: npm run dev (port 8788).
Auth modes
Mode | When | Behavior |
none | Local / low sensitivity | Bare |
personal | Solo operator, shareable link | Rotating |
full | Team / IdP in front | Same bare |
none and full share the same OpenPort install path. Request audit (mcp_requests) is always on.
Configuration
Set these in platforms/cloudflare/wrangler.toml under [vars]:
Variable | Default | Meaning |
|
| How long to keep |
|
|
|
Secret | Used for |
| personal mode: mint connect URLs |
| Optional legacy static path key |
Backup (local host)
npm run local:export # → platforms/local/data/openport-backup.zip
npm run local:import -- ./backup.zipThe zip is markdown for scopes, skills, and docs. Handy when you move machines.
Repository layout
src/ # Portable memory core (SqlDatabase, host-agnostic)
platforms/cloudflare/ # Workers + D1 adapter
platforms/local/ # Node HTTP + stdio + SQLite + export/import
seed/ # Starter scopes, skills, docs, install skill
migrations/ + schema.sql # SQLite / D1 schemaThe core does not depend on Cloudflare types. Each host implements SqlDatabase and serves MCP. Storage is markdown bodies in SQLite rows: portable and readable, not a ranked document DB.
Develop
npm test # unit + MCP + local SQLite/backup tests
npm run typecheck
npm run local # HTTP host on :8787
npm run local:stdio
npm run local:export
npm run dev # Cloudflare local Worker on :8788Area | Covered by tests |
Auth / access | Path tokens, static key, none/personal gate |
Session | Work-session merge, |
Write guards |
|
Store | Scoped load, append, skills/docs |
MCP tools | Load-contract enforcement, guards, |
Local host | File SQLite seed, scoped read, backup zip round-trip |
D1/Wrangler integration is manual via npm run dev / deploy.
Non-goals
Out of scope on purpose. Open an issue only if you have a design that still respects the load contract.
Non-goal | Why |
Full-text / semantic search over memory | Load by known scope id |
Multi-user / multi-tenant ACL inside OpenPort | One operator (or your gateway) owns the URL |
Cross-device sync / CRDT | One database per deploy is the source of truth |
Vector store / RAG platform | Skills + scoped markdown, not embeddings-as-memory |
Bundled domain tools (email, broker, etc.) | Integrations belong outside this memory core |
Contributing
See CONTRIBUTING.md. Issues and PRs welcome.
Keep
/srcfree of vendor lock-in (useSqlDatabase).Cloudflare changes go under
platforms/cloudflare/.Local Node host changes go under
platforms/local/.New hosts: add
platforms/<name>and docs. Don't break the MCP tool surface without talking about it first.Respect Non-goals and the load contract.
Add or extend tests under
src/*.test.tswhen you change store or tool behavior.
Links
License
MIT © TXL
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP memory server. One memory your agents share — across models, devices and apps.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Cross-tool persistent memory and context for AI assistants over MCP.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP-native, local-first memory server that gives AI agents persistent, structured memory across sessions and tools, enabling them to maintain identity and context without reconfiguration.3MIT
- AlicenseAqualityAmaintenanceA local-first MCP server for shared memory across AI tools, enabling context capture and resume across sessions.2627 npm4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA portable MCP server providing a shared intelligent memory system for any MCP-compatible AI tool, enabling storage, retrieval, extraction, and governance of memories across sessions.18 npmMIT
- AlicenseNot gradedqualityDmaintenanceA portable self-hosted memory layer for AI tools, storing context, memories, and handoffs for access from any MCP-compatible client.17 npmMIT