databasedmcp gives your AI assistant databases it keeps between conversations, so everything in this article works from the day you connect it. Free to start, no card.
Get started freeTwo clients, two memories
Maybe you use Claude Code for most of the work and Codex for a second opinion, or opencode with another model. Each one keeps its own history. Neither knows what the other did yesterday, so you paste summaries from one terminal into the other.
databasedmcp is a remote MCP server, and your databases belong to your account, not to a client. Every client you connect sees the same ones. A task Claude Code claims is claimed for Codex too, and a decision Codex records is in Claude Code's next briefing.
Connect Claude Code
Claude Code signs in with OAuth, so there's no key to keep:
claude mcp add --transport http databased https://databasedmcp.com/mcp
Then run /mcp in Claude Code, pick databased and choose Authenticate. Your browser opens a databasedmcp page: sign in and select Allow.
Connect Codex and opencode
These use an API key. Create one on the API keys page and keep it in an environment variable, in your shell profile:
export DATABASED_API_KEY=…
Then tell each client where databasedmcp is:
[mcp_servers.databased] url = "https://databasedmcp.com/mcp" bearer_token_env_var = "DATABASED_API_KEY"
{
"mcp": {
"databased": {
"type": "remote",
"url": "https://databasedmcp.com/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:DATABASED_API_KEY}"
}
}
}
}
The config names the variable, never the key, so it's safe to commit. The clients can share a key or have one each. Either way they reach the same databases.
One line in each instructions file
Claude Code reads CLAUDE.md. Codex and opencode read AGENTS.md. Put the same lines in both, so whichever client you start, it starts from the board:
Shared memory: databasedmcp database `acme-api` (project template). Run get_database on it at the start of every session and follow its guide: claim tasks before working on them, park anything off-task instead of doing it. Sessions: register in databasedmcp database `sessions` at the start of every session, checkpoint as you go and end before you stop, following its guide. Use your s<id> as owner and author in `acme-api`.
In Claude Code, /mcp__databased__project and /mcp__databased__session set up each database and offer to add its line. The prompt at the end of this article does the same in any client.
The client column: who did what
The sessions template keeps one row per agent session, across repos and clients. Each session registers when it starts:
INSERT INTO sessions (scope, topic, job, goal, client, model, machine, branch, commit_start, continues) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, (SELECT group_concat(i.id || ' [' || i.priority || '] ' || i.sender || ': ' || i.body, char(10)) FROM (SELECT * FROM inbox WHERE session = sessions.id ORDER BY CASE priority WHEN 'stop' THEN 0 WHEN 'steer' THEN 1 ELSE 2 END, id) i) AS inbox
client is one of claude-code, codex, opencode, cursor, chatgpt, claude-app or other. The id that comes back is the session's handle, s42, and the lines above have each agent use it as its owner and author on the project board. A task owned by s42 leads back to a row that says which client and model did it, on which branch, what it got done and what's left. One session in full:
SELECT * FROM session_status WHERE id = ?
Catch up before claiming, committing or stopping
Two agents on one repo don't need to talk all the time. They need to look at the right moments. The project guide's catch-up query returns everything that changed on the board since you last looked, tasks and memory, oldest first:
SELECT 'task' AS what, id, status AS kind, title, owner AS who, updated_at AS at FROM tasks WHERE updated_at >= ?1
UNION ALL SELECT 'memory', id, kind, title, author, created_at FROM memory WHERE created_at >= ?1
UNION ALL SELECT 'now', NULL, NULL, NULL, NULL, datetime('now') ORDER BY at
Each agent runs it before claiming, before committing and before stopping, never on a timer. The last row, now, is the server time to pass as ?1 next time. Before committing matters most: if Codex recorded 5 minutes ago that the API stays on v1, Claude Code sees it before its commit goes in, not after.
Copy this prompt to set it up
Connect both clients first, then paste this into either one.
Set up databasedmcp as shared memory for every agent I use on this repo, whatever the client. 1. Project board: if list_databases shows no database named after this repo, create one with the project template. Read its guide with get_database and follow it from now on. 2. Sessions: if there's no "sessions" database, create it from the sessions template. Read its guide, run its Start read for this repo's scope, and register this session, with client set to the client you're running in. 3. Add these lines to both CLAUDE.md and AGENTS.md, creating whichever is missing, with the project database's name in place of <name>: "Shared memory: databasedmcp database `<name>` (project template). Run get_database on it at the start of every session and follow its guide: claim tasks before working on them, park anything off-task instead of doing it." "Sessions: register in databasedmcp database `sessions` at the start of every session, checkpoint as you go and end before you stop, following its guide. Use your s<id> as owner and author in `<name>`." 4. Tell me your s<id> and what's open: tasks in progress and by whom, and questions waiting for me.
You run it once. The next session in the other client picks the lines up from its own file.
What it doesn't do
databasedmcp doesn't push anything to a running agent. Each agent sees the other's work when it reads: at the start, at the catch-up points, when it checkpoints. Messages sent through the sessions database wait in the inbox until then. The client column is what the agent says it is; nothing checks it. Claims, expect_changes conflicts and land conflicts hold whichever client writes, because the database enforces them. Following the rest of the guide is up to each agent, and a client that doesn't read CLAUDE.md or AGENTS.md never sees the lines. The agents share a database, not a working tree, so give each one its own checkout or worktree.