How to Connect Claude Desktop & Cursor to Cloudflare D1 & Vectorize

Step-by-step tutorial on granting your AI coding assistant direct read and write access to Cloudflare edge databases and vector stores.

V
Vineet Goyal
2026-08-107 min read

Giving AI Assistants Direct Database Superpowers

Imagine asking **Claude Desktop** or **Cursor IDE**: > *"Query the last 10 error logs from my D1 database and find matching semantic vectors in Vectorize."*

With the **Model Context Protocol (MCP)**, your AI assistant can execute these queries safely without exposing database credentials or writing boilerplate scripts.

---

1. Setting Up the Cloudflare MCP Connector

1. Grab your Cloudflare API Token from your Cloudflare Dashboard. 2. Ensure your token has `D1:Edit` and `Vectorize:Edit` permissions. 3. Open your Cursor configuration (`~/.cursor/mcp.json`) or Claude Desktop config:


{
  "mcpServers": {
    "cloudflare-edge": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-cloudflare"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "YOUR_CLOUDFLARE_API_TOKEN",
        "CLOUDFLARE_ACCOUNT_ID": "YOUR_ACCOUNT_ID"
      }
    }
  }
}

---

2. Testing in Cursor IDE

Once configured, open Cursor Composer (`Ctrl+I` or `Cmd+I`) and prompt:


@cloudflare-edge show tables in my production D1 database

The AI assistant will invoke the MCP tool, query D1 at the edge, and summarize the schema in real time.

---

Discover More Connectors on UnofficialOS

Explore dozens of database and storage MCP connectors on **[UnofficialOS](/?category=MCP+Servers)**, including Redis on Workers, Cloudflare R2 object storage drivers, and AI search gateways.

Explore 470+ Verified Open-Source Tools

Find Ready-to-Deploy Cloudflare OS & MCP Repositories

UnofficialOS features 470+ verified tools with 1-click MCP configs for Cursor IDE & Claude Desktop, transparent security audit breakdowns, and instant Cloudflare edge deployment.