durable-objects-mcp logo

durable-objects-mcp

Organization
spawnbase

Query your 🟧 Cloudflare Durable Objects from Claude Code, Cursor, and other AI clients

Publisherspawnbase
Repositorydurable-objects-mcp
LanguageTypeScript
Forks
0
Stars
0
Available tools
3
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    durable-objects-mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    0 stars and 0 forks from the linked repository.

🟧 durable-objects-mcp

Rick Rubin knows

Unofficial MCP server for querying Cloudflare Durable Object SQLite storage from AI clients (Claude Code, Cursor, Windsurf, etc.). Gives AI clients structured, read-only access to your DO storage. Connect once, discover tables, run queries.

šŸ¤” Why

Durable Objects store state in private SQLite databases with no programmatic query access — just Data Studio in the dashboard. We built this while working on Spawnbase because manually clicking through thousands of DO instances isn't viable.

TODO: The best version of this tool is one that doesn't need to exist. We'd love Cloudflare to ship native secure query access for DO storage. Until then, this fills the gap.

āš™ļø What it enables

You (while sipping coffee): "What tables does the AIAgent DO have for user abc123?"

→ describe_schema({ class_name: "AIAgent", name: "abc123" })

  _cf_KV           — key TEXT, value BLOB
  cf_agents_state  — id TEXT, data BLOB
  cf_agents_messages — id TEXT, role TEXT, content TEXT, created_at INTEGER
  ...

You (after the second sip): "Show me the last 5 messages"

→ query({ class_name: "AIAgent", name: "abc123",
          sql: "SELECT role, content FROM cf_agents_messages ORDER BY created_at DESC LIMIT 5" })

  role       | content
  -----------|----------------------------------
  user       | Deploy the workflow to production
  assistant  | I'll deploy workflow wf_a8c3...
  ...

A standalone Cloudflare Worker that binds to your DO namespaces via script_name and calls a query() RPC method on each DO instance. Auth via Cloudflare Access (OAuth).

šŸ”’ Security

Warning: Durable Objects can store sensitive data — session tokens, PII, payment records, conversation history. Before deploying, review what your DOs contain, only bind the namespaces you need, and restrict your Cloudflare Access policy accordingly. If you serve end users, make sure your terms of service cover this kind of data access.

We took security seriously when building this. Here's what we put in place:

  • Cloudflare Access (OAuth) — all authentication happens at the edge before the request reaches the Worker. JWTs are verified against CF Access JWKS (signature, algorithm, expiry). PKCE (S256 only) is enforced on the MCP client side. Revoking a user in your identity provider cuts their MCP session on the next token refresh.
  • Read-only by design — a server-side SQL guard rejects anything that isn't SELECT, PRAGMA, EXPLAIN, or WITH before it reaches the DO. All write statements are blocked at the MCP server level.
  • No public DO access — the query() RPC call uses Cloudflare service bindings (script_name), which stay entirely within Cloudflare's internal network. There is no public HTTP endpoint to the DOs. The MCP server is the only way in.
  • Explicit namespace scoping — only DO classes with bindings in wrangler.jsonc are discoverable and queryable. Nothing is exposed by default.

šŸ› ļø Tools

ToolWhat it does
list_classesLists queryable DO classes configured in your deployment
describe_schemaReturns tables and columns for a DO instance
execute_read_queryExecutes read-only SQL against a DO instance

šŸš€ Setup

1. Add a query() method to your DO classes

Each DO class you want to query needs this method:

typescript
query(sql: string) {
  const cursor = this.ctx.storage.sql.exec(sql)
  return { columns: cursor.columnNames, rows: [...cursor.raw()] }
}

The MCP server's SQL guard blocks all non-SELECT statements before they reach the DO.

2. Clone and configure

bash
git clone https://github.com/spawnbase/durable-objects-mcp.git
cd durable-objects-mcp
pnpm install

Edit wrangler.jsonc — add DO bindings pointing at your Worker:

jsonc
"durable_objects": {
  "bindings": [
    { "name": "DO_MCP_AGENT", "class_name": "DOMcpAgent" },
    {
      "name": "AI_AGENT",
      "class_name": "AIAgent",
      "script_name": "your-worker-name"
    }
  ]
}

Any DO binding (except DO_MCP_AGENT) is automatically queryable — no additional config needed.

3. Set up auth (Cloudflare Access)

Follow the Secure MCP servers with Access for SaaS guide:

  1. Create a SaaS application in Cloudflare One → Access → Applications
  2. Select OIDC as the authentication protocol
  3. Set the redirect URL to https://your-worker.workers.dev/callback
  4. Under Policies, add an Access policy controlling who can connect (e.g., email list, IdP group)
  5. Under Login methods, select which identity providers are available (GitHub, Google, One-time PIN, etc.)
  6. Copy the Client ID and Client Secret from the app config

Then set secrets:

bash
wrangler secret put ACCESS_TEAM             # your Zero Trust team name
wrangler secret put ACCESS_CLIENT_ID        # from the SaaS app
wrangler secret put ACCESS_CLIENT_SECRET    # from the SaaS app
wrangler secret put COOKIE_ENCRYPTION_KEY   # openssl rand -hex 32

4. Deploy

bash
wrangler deploy

5. Connect your MCP client

On first connect, you'll authenticate via Cloudflare Access (browser popup). After that, the session persists.

Claude Code:

bash
claude mcp add --transport http do-explorer https://your-worker.workers.dev/mcp

Cursor (~/.cursor/mcp.json):

json
{
  "mcpServers": {
    "do-explorer": { "url": "https://your-worker.workers.dev/mcp" }
  }
}

Codex (~/.codex/config.toml):

toml
[mcp_servers.do-explorer]
url = "https://your-worker.workers.dev/mcp"

Then run codex mcp login do-explorer to authenticate.

OpenCode (opencode.json):

json
{
  "mcp": {
    "do-explorer": {
      "type": "remote",
      "url": "https://your-worker.workers.dev/mcp"
    }
  }
}

šŸ“‹ Requirements

  • 5 minutes
  • Cloudflare Workers Paid plan
  • SQLite-backed Durable Objects (compatibility date 2024-04-03+)
  • Cloudflare Zero Trust (for auth)

šŸ“„ License

MIT

Available Tools

  • list_classes

    Lists queryable DO classes configured in your deployment

  • describe_schema

    Returns tables and columns for a DO instance

  • execute_read_query

    Executes read-only SQL against a DO instance

Use durable-objects-mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once durable-objects-mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add durable-objects-mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the durable-objects-mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "durable-objects-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the durable-objects-mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the durable-objects-mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use durable-objects-mcp to help me with this task?
durable-objects-mcp
Sure. I read it.
Here is what I found using durable-objects-mcp.

Frequently asked questions

What is the durable-objects-mcp MCP server used for?

durable-objects-mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use durable-objects-mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use durable-objects-mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use durable-objects-mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With durable-objects-mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect durable-objects-mcp MCP to TypingMind?

durable-objects-mcp runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does durable-objects-mcp MCP provide in TypingMind?

durable-objects-mcp exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use durable-objects-mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If durable-objects-mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter šŸ‘‡