open-context open-context
November 15, 2026 · 6 min read

REST API vs. MCP Server: Which Interface Should You Use

Use the REST API when you're scripting, automating, or building your own UI against open-context — it's a normal HTTP interface you call from curl, a CI job, or a frontend. Use the MCP server when you want Claude itself to save and recall context mid-conversation, with no integration code at all. Both sit in front of the exact same context store, so the choice is about who's doing the calling, not what data you can reach.

Key takeaways

  • open-context ships two interfaces to one context store: an Express REST API on port 3000, and a stdio-based MCP server.
  • The REST API is for anything that isn't an MCP-capable AI host: scripts, CI pipelines, your own dashboard, or curl.
  • The MCP server is for giving Claude Code or Claude Desktop persistent memory it reads and writes on its own, through typed tool calls instead of raw HTTP requests.
  • Both read and write the same backing database — switching the store's connection string changes storage for both interfaces identically.
  • You can run both at once from the same Docker image; only the startup command differs.

Two doors into the same context store

open-context's context store — contexts, bubbles, and preferences — doesn't belong to either interface. The REST API defined in src/server.ts and the MCP server defined in src/mcp/server.ts are both thin layers over the same BYODB store adapter. Neither one owns the data; they're just two different doors into it, built for two different callers.

That matters because the question isn't really "which interface is better" — it's "who, or what, is going to be making the call." A shell script doesn't speak MCP. Claude, inside an MCP-capable host, doesn't make arbitrary HTTP requests. Once you know which side you're building for, the choice mostly makes itself.

What the REST API is for

The REST API is a standard Express app that listens on port 3000. It's what open-context's own web UI calls under the hood for every screen — the Dashboard, the Preferences editor, the Conversion pipeline — but nothing stops you from calling it yourself. Typical endpoints:

If your use case is "run this on a schedule," "wire it into a build pipeline," or "render it in a dashboard I'm writing myself," the REST API is the right tool. It's stateless HTTP — no MCP host, no tool-calling model, just requests and JSON responses you can hit from anything that can make an HTTP call.

What the MCP server is for

The Model Context Protocol is an open protocol, originally introduced by Anthropic, for connecting AI applications to external tools and data through a typed contract the model can call directly. open-context's MCP server runs over stdio and exposes tools like save_context, recall_context, and search_contexts — plus tools for managing bubbles and v2 canonical context nodes — to whatever MCP host you point at it, typically Claude Code or Claude Desktop.

The difference that matters day to day: nobody writes integration code. Claude decides, from the conversation itself, when to call save_context or recall_context — there's no script polling an endpoint, no webhook, no cron job. You say "remember this," and the MCP host turns that into a tool call the model issues on its own. That's a fundamentally different shape of interaction than a REST client deciding when to fire a request.

A decision guide

If you want to…Use
Give Claude persistent memory across chats with zero integration codeMCP server
Automate a ChatGPT export conversion from a script or CI jobREST API (/api/convert)
Build your own dashboard or admin tool over saved contextsREST API
Let Claude Code remember project decisions as it worksMCP server
Switch or inspect the database backend from a scriptREST API (/api/db/*)
Query context from a tool that isn't an MCP host at allREST API

A useful shortcut: if the caller is a human-written program with explicit control flow, reach for the REST API. If the caller is Claude itself, deciding in the moment whether a piece of conversation is worth keeping, that's what the MCP server exists for.

Can you run both at once?

Yes, and this is normal. open-context ships as a single Docker image that can run as the HTTP server, the MCP stdio server, or a one-off CLI converter — the only thing that changes is the CMD override. Most setups run the HTTP server continuously (for the web UI) and launch the MCP server separately, on demand, from a Claude Code or Claude Desktop MCP config entry. Because both point at the same OPENCONTEXT_DB_URL, a context Claude saves through MCP shows up immediately in the web UI's Dashboard, and vice versa.

What neither interface handles for you

Neither ships built-in network authentication. The REST API has no API keys or sessions — it assumes you're running it on localhost or behind infrastructure you already secure, same as any local dev server. The MCP server avoids the problem differently: stdio has no network listener at all, so there's nothing to authenticate against unless you deliberately bridge it over HTTP. If you expose the REST API beyond your own machine, put a reverse proxy with real auth in front of it — the API itself won't stop an unauthenticated request.

Same context store, your choice of interface.

Get started with open-context →

FAQ

Can I run the REST API and the MCP server at the same time?

Yes. They're two separate processes started from the same Docker image with a different CMD override, and both read and write the same context store, so data saved through one shows up in the other immediately.

Does the open-context REST API require authentication?

No. There's no built-in auth layer — it's designed to run on localhost or behind a reverse proxy you control. Put it behind your own auth if you expose it beyond your own machine.

Can Claude call the REST API directly instead of using the MCP server?

Not out of the box. Claude discovers and calls tools through the typed schemas an MCP host exposes; a raw HTTP endpoint has no such schema, so Claude can't invoke /api/contexts mid-conversation without an MCP wrapper around it.

Which interface should I use to automate ChatGPT conversions in a script?

The REST API. POST a ZIP export to /api/convert from a script or CI job and you get normalized conversations, preferences, and memory back as JSON — no Claude host or MCP client required.

Do the REST API and MCP server share the same database backend?

Yes. Both resolve the same OPENCONTEXT_DB_URL (or saved config) through open-context's BYODB layer, so pointing the store at Postgres, SQLite, or any other supported backend changes storage for both interfaces identically.