Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Cursor Database

FreeNot checked

Cursor database MCP — give Cursor a free cloud database it can query while it writes your code

GitHubEmbed

About

Cursor database MCP — give Cursor a free cloud database it can query while it writes your code

README

MCP Client Transport License

Config, verification script and a worked dataset for pointing Cursor at a live cloud database over MCP, so the agent can run real queries against real rows while it edits your code.

The file

This is the whole integration. One object, one key.

{
  "mcpServers": {
    "crag": {
      "url": "https://freebase.cloud/api/mcp/YOUR_TOKEN"
    }
  }
}

There is deliberately no "type" field here. Cursor infers the transport from the shape of the entry: a url means a remote server, a command means a local stdio process. Adding "type": "http" — which is what Claude Code requires, and what most blog posts copy from — is the single most common reason a Cursor entry silently fails to load. If you are moving a config between the two tools, strip the key on the way in.

crag is just a label. It becomes the prefix on every tool name Cursor sees, so pick something short and descriptive of the data rather than the engine.

Where the file goes

Scope Path Use it when
Global ~/.cursor/mcp.json The database is yours, across every project you open
Project <repo>/.cursor/mcp.json The database belongs to this codebase and you want teammates to inherit it

Both files use the identical schema above. If both exist, project entries sit alongside global ones — they do not replace them, so two servers with the same name will collide. Name them differently.

A project-scoped file is committable, but the token is in the URL, so treat .cursor/mcp.json exactly like you would treat a .env: either gitignore it, or commit a placeholder and have each developer paste their own token. Cursor does not have VS Code's prompt-for-input mechanism, so there is no way to keep the secret out of the file itself.

After saving, open Cursor Settings → MCP (or Tools & Integrations in recent builds). The server should appear with a green dot and an expandable list of four tools. If the dot is grey, skip to the checklist near the bottom.

Getting a URL

You need a database and a token. On freebase.cloud, sign up (no card), create a session, pick an engine, then go to Settings → MCP → New Token, select the connection you just made and copy the URL it gives you.

The token lives in the path segment of the URL. Nothing else authenticates — no header, no OAuth dance, no env block in the config. That is why the Cursor entry is a single line. It also means the URL is the credential; rotate it from the same screen if it leaks.

What Cursor gets

Four tools per connection, named after the connection:

Tool Behaviour
crag_list_tables Enumerates tables, collections, keyspaces, indices or measurements, depending on the engine
crag_query Runs a read query in the engine's own language and returns rows or documents
crag_store Writes — inserts and upserts
crag_annotate_table Attaches a plain-English description to a table so later queries are better informed

annotate_table is the one people skip and then miss. Cursor's agent reads tool descriptions before it plans; a one-line note like "sessions.grade uses the French scale, not YDS" is the difference between a correct aggregate and a confidently wrong one.

PostgreSQL connections additionally expose pg_dump, pg_restore and pg_tables helpers. SQLite connections expose sqlite_master and sqlite_version.

Engines

All fifteen are reachable through the same MCP endpoint shape; only the query language inside crag_query changes.

Engine Version Language you write inside _query
PostgreSQL 16.2 SQL
MySQL 8.0.36 SQL
MariaDB 11.3.2 SQL
SQLite 3.45.1 SQL
CockroachDB 23.2.4 SQL (Postgres-compatible)
TimescaleDB 2.14.2 SQL + hypertable functions
MongoDB 7.0.4 Document queries / aggregation pipeline
Redis 7.2.3 Redis commands
Cassandra 4.1.4 CQL
DynamoDB 2024.1 Key/document operations
ClickHouse 24.1.5 OLAP SQL
Elasticsearch 8.12.0 Query DSL
Neo4j 5.17.0 Cypher
InfluxDB 2.7.4 Flux / InfluxQL
Prometheus 2.50.1 PromQL

Three of them — PostgreSQL, Redis and MongoDB — also accept ordinary drivers over their real TCP wire protocol, so your app and the agent can hit the same data. The rest are HTTP and MCP only.

A worked exchange

The examples in this repo populate a collection of climbing routes at a fictional gym, on the MongoDB engine. Once it is seeded, a request in Cursor's Composer like:

Which walls have routes that nobody has sent in the last 60 days? Then add a stale boolean to the wall summary component.

produces roughly this sequence: crag_list_tables to find the collections, crag_annotate_table lookup for what sessions.sent means, one crag_query aggregation grouping sends by wall and date, and then the edit — written against the field names it actually observed rather than the ones it guessed. The point is not that the model is smarter; it is that a schema lookup is now cheaper for it than a guess.

If it doesn't connect

Work down this list. It is ordered by how often each one is the answer.

  1. Remove "type". Covered above, but it is genuinely the most common cause.
  2. Restart the MCP server from Settings, not the whole editor. Cursor caches the tool list per server; the small refresh icon next to the entry re-handshakes without losing your chat.
  3. Check the JSON parses. python3 -m json.tool ~/.cursor/mcp.json. A trailing comma produces no error message in the UI — the server just never appears.
  4. Run examples/verify-connection.mjs. If it prints four tools, the endpoint and token are fine and the problem is entirely on Cursor's side. If it fails, the token is wrong or revoked — issue a fresh one and paste it back in.
  5. Confirm the tools are enabled in the conversation. A server can be connected and still have its tools toggled off for the current chat; agent mode also has to be on, since Ask mode does not call tools.
  6. Check the tool count. Cursor caps how many tools it will surface at once. If you have a dozen MCP servers registered, disable the ones you are not using and the database tools will reappear.

Limits worth knowing before you build on it

The free tier is aimed at development, prototyping and small production workloads — that is the honest framing, and it is where it fits well. There is no published SLA and no managed backup product, so anything you would be upset to lose should be dumped somewhere else on a schedule (pg_dump and mongodump both work against the wire-protocol engines). MCP is a request/response channel, not a replacement for a driver: use it for the agent, and use a real client library in your application code.

Files here

examples/
  mcp.json                    drop-in config, both scopes
  verify-connection.mjs       Node 18+, no dependencies — handshakes and lists tools
  crag-routes.mongodb.js      mongosh script: seeds and queries the route dataset
  README.md                   how to run the two scripts

See also


freebase.cloud is an independent service and is not affiliated with Anysphere (Cursor), MongoDB, Inc. or the PostgreSQL Global Development Group.

from github.com/freebase-cloud/cursor-database-mcp

Installing Cursor Database

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/freebase-cloud/cursor-database-mcp

FAQ

Is Cursor Database MCP free?

Yes, Cursor Database MCP is free — one-click install via Unyly at no cost.

Does Cursor Database need an API key?

No, Cursor Database runs without API keys or environment variables.

Is Cursor Database hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Cursor Database in Claude Desktop, Claude Code or Cursor?

Open Cursor Database on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Cursor Database with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All data MCPs