Cloudflare D1 is the SQLite database that sits next to your Workers, which means it often holds the production data for an edge-deployed app. Grok Bot is xAI's bot builder, an agent that keeps context and reaches your tools through plugins. Sequel's MCP server gives that bot read access to D1, so you can ask about your data without writing a one-off Worker to dump it.
TL;DR
| What you're connecting | One Cloudflare D1 database to Grok Bot |
| Setup time | About 5 minutes |
| Setup method | One chat message. Grok Bot has no MCP config file |
| Auth | Cloudflare OAuth to Sequel, no API token to create |
| Scopes requested | d1.read, memberships.read, account-settings.read, user-details.read |
| Access level | Read-only, enforced by Cloudflare |
| Scope of a connection | Exactly one D1 database |
What You'll Accomplish
Once this is wired up, you can ask your bot:
- "How many rows are in each table, and which grew fastest this month?"
- "Show the 20 most recently created users with their signup source."
- "What's the conversion rate from signup to first purchase, by month?"
Prerequisites
- A Sequel account: sign up free at sequel.sh
- A Cloudflare account with at least one D1 database
- Permission to authorize applications on that Cloudflare account
- A Grok account with a bot you can send messages to
Step 1: Connect Cloudflare D1 to Sequel
Sign in to sequel.sh and open Data Sources.
![]()
Click New Connection and choose Cloudflare D1.
![]()
| Step | What happens |
|---|---|
| Sign in with Cloudflare | Approve the grant on Cloudflare's consent screen. There is no token to paste or rotate |
| Pick a database | Sequel lists the D1 databases you authorized, grouped by account. Choose one |
| Test and save | Sequel reads sqlite_master and PRAGMA table_info, then stores a schema summary |
Sequel stores the account and database you picked, so every later query goes to that database and nowhere else.
Read-only is enforced upstream. Sequel requests
d1.readand nothing else, so Cloudflare rejects writes at the API. It asks for no Workers, DNS, or zone access at all.
Step 2: Add Sequel to Grok Bot
Grok Bot has no MCP config file and no settings form to fill in. You add a server by asking the bot.
Open a chat with your bot and send this:
Add a custom MCP server called sequel at https://api.sequel.sh/mcp
Say custom server explicitly. Leave those words out and the bot searches the plugin marketplace instead of registering your endpoint.
![]()
The bot reads the name and URL back to you. Check both, confirm, and it posts a connect card in the chat. Click Authorize, sign in to Sequel, and approve access. The OAuth token stays on the connector side, so there is no API key to copy and nothing to keep in sync.
To confirm it registered, open Settings → Plugins → Yours. Every server on your account is listed there, including the ones you added by chat.
![]()
Then attach it to a task: type @ in the chat and pick sequel.
Using Grok chat rather than a bot? The steps do not carry over. On grok.com, open Plugins → New Connector → Custom, set the name to
Sequeland the Server URL tohttps://api.sequel.sh/mcp, click Add Connector, and sign in.
Step 3: Ask Grok Bot About Your D1 Data
Attach @sequel and ask:
How many rows are in each table, and which table grew the most this month?
Show the 20 most recently created users with their signup source and plan.
What's the conversion rate from signup to first purchase, by signup month?
What You Can Do Now
- Inspect production without a Worker: no more writing a throwaway endpoint just to read a table.
- Scheduled health checks: the bot can run a row-count and integrity sweep every morning and report only on changes.
- Edge-app analytics: daily actives, retention, and funnel math straight from D1.
- Schema discovery: "What tables exist and how do they relate?" straight from
sqlite_master. - Cross-source joins: with Stripe connected, ask which D1 customers also hold an active subscription.
Troubleshooting
| Symptom | Likely fix |
|---|---|
| The bot searched the marketplace instead of adding the server | Resend the message with the words "custom server" in it. |
| The server is not listed under Settings → Plugins → Yours | The registration did not complete. Resend the message and confirm the name and URL when the bot reads them back. |
| The bot answers without touching your data | You did not attach it. Type @ in the chat and pick sequel before asking. |
| No databases appear in the picker | The authorized account has no D1 databases, or you approved a different account. Reconnect and pick the right one. |
| Cloudflare has revoked access for this connection | The grant was revoked or an admin disabled third-party OAuth. Reconnect from Sequel once access is restored. |
| "no such table" | The table was created after you connected. Refresh the schema from the connection settings. |

