Skip to main content
← Back to Articles
mcptursosqlitelibsqldatabasecursoridesetup2026

Turso MCP Server Cursor IDE Setup 2026: Read-Only SQLite/libSQL Queries from Chat

Connect a Turso database to Cursor IDE via the community mcp-turso server: get your database URL and auth token from the Turso CLI, configure mcp.json, and run read-only SELECT queries from chat.

By Web MCP GuideAugust 13, 20268 min read


Turso MCP Server Cursor IDE Setup 2026

How do you connect Turso to Cursor IDE via MCP? Get your database's URL and an auth token from the Turso CLI, add a turso block to ~/.cursor/mcp.json with those two values, and restart Cursor. Once connected, Cursor can list tables, inspect schemas, and run read-only SELECT queries against your libSQL/Turso database directly from chat.

Set expectations correctly up front: this isn't an officially Turso-maintained server — it's a community project (the most common one is mcp-turso, also published as mcp-turso-cloud for a variant with org-level operations). And it's read-only. If you're expecting to run migrations or write data through this connection the way you might with a Postgres or MySQL MCP server, that's not what this tool does — it's built for querying and inspecting a database you're already developing against, not administering it.

What the Turso MCP Server Actually Does

Four tools, all read-only:

  • list_tables — lists tables in the connected database

  • get_db_schema — returns the full schema

  • describe_table — column-level detail for a specific table

  • query_database — runs a SELECT query and returns results
  • There's no insert, update, delete, or migration tool in the standard package. That's a real constraint, not a missing feature to work around — if you need Cursor to modify data, you're either running SQL through your own application code, using the Turso CLI directly, or (for org/database-management operations like creating new databases) reaching for the mcp-turso-cloud variant, which adds a second layer of organization-level tools on top of the same read-only data access.

    Why Read-Only Is Actually Fine for Most Uses

    The obvious use case for a database MCP server during development is inspection, not administration: "what does this table actually look like," "show me a real row so I can write the type definition correctly," "why is this query returning fewer rows than I expect." All of that is read-only by nature. Turso's edge-replicated architecture (it's built on libSQL, a SQLite fork designed to run close to your users) makes this especially useful for debugging replication-lag-shaped bugs — you can query the same logical database Cursor is helping you write code against, and see the current state without switching to the Turso dashboard or CLI.

    If you do need write access from an AI-driven workflow, that's a deliberate absence in this specific server, not an oversight — a read-only MCP connection is a meaningfully safer default for something an LLM can call autonomously.

    Prerequisites


  • A Turso account and at least one existing database (turso db create <name> if you haven't made one)

  • The Turso CLI installed and authenticated (turso auth login)

  • Cursor IDE with MCP support

  • Node.js 18+ (for the npx-based server)
  • Step 1: Get Your Database URL

    turso db show --url <database-name>
    

    This returns your database's connection URL, something like libsql://your-db-name-yourorg.turso.io.

    Step 2: Generate an Auth Token

    turso db tokens create <database-name>
    

    Copy the token this outputs — treat it like any other database credential.

    Step 3: Configure mcp.json

    {
      "mcpServers": {
        "turso": {
          "command": "npx",
          "args": ["-y", "mcp-turso"],
          "env": {
            "TURSO_DATABASE_URL": "libsql://your-db-name-yourorg.turso.io",
            "TURSO_AUTH_TOKEN": "your-auth-token-here"
          }
        }
      }
    }
    

    Step 4: Restart and Verify

    Restart Cursor fully, then in chat:

    List the tables in my Turso database
    

    Or:

    Show me the schema for the users table
    

    If real table and column names come back, the connection is live.

    Practical Workflows

    Understanding a schema before writing a migration

    Show me the full schema for this Turso database. I need to see the exact 
    column types and any foreign keys before I write a migration that adds 
    a new indexed column.
    

    Debugging a query that returns unexpected results

    Run this query against the actual database and show me the raw output: 
    SELECT * FROM orders WHERE status = 'pending' AND created_at > date('now', '-7 days')
    

    Verifying data shape before writing a type definition

    Pull 5 real rows from the events table so I can write an accurate 
    TypeScript type instead of guessing from the schema alone
    

    Gotchas

    This is a community package, not an official Turso product. Behavior, maintenance cadence, and available tools can change without the same release-note discipline you'd expect from a vendor-maintained server. Check the package's GitHub repo for recent activity before relying on it for anything beyond local development convenience.

    Read-only means read-only — there's no write path. Don't build a workflow that assumes Cursor can insert test data or run a migration through this connection; it can't, by design. Use the Turso CLI or your application's own database client for writes.

    One database per config entry. If you work across multiple Turso databases, you need a separate mcpServers entry (with its own TURSO_DATABASE_URL and TURSO_AUTH_TOKEN) for each one, rather than one connection that can switch between them.

    Auth tokens created via turso db tokens create don't expire by default unless you set an expiration. Treat them like any long-lived credential — avoid committing mcp.json with a real token to a shared repo.

    Troubleshooting

    "Unauthorized" or connection refused errors
    Regenerate the token with turso db tokens create <database-name> and confirm the TURSO_DATABASE_URL matches exactly what turso db show --url outputs, including the libsql:// scheme.

    Queries time out or fail against a large table
    Turso's edge replication means query latency can vary depending on which replica you're hitting. Scope queries with a LIMIT and specific WHERE clauses rather than pulling a full large table.

    Server not appearing in Cursor's MCP panel
    Confirm Node.js is in your PATH and try running npx -y mcp-turso manually in a terminal — if it errors immediately, the problem is environmental (missing Node, bad env vars), not Cursor-specific.

    A write-shaped request (like "insert a test row") silently does nothing or errors
    Expected — this server has no write tools. Use the Turso CLI (turso db shell <database-name>) or your application code for any operation beyond SELECT.

    Frequently Asked Questions

    Q: Is this an official Turso-maintained MCP server?
    A: No — it's community-maintained. There isn't currently a first-party Turso MCP server with the same official status as, say, Stripe's or Sentry's hosted servers. Check the package's GitHub activity if you're relying on it for anything beyond local dev convenience.

    Q: Can Cursor write data or run migrations through this connection?
    A: No. The standard mcp-turso package exposes only read tools — list_tables, get_db_schema, describe_table, and query_database (SELECT only). Writes and migrations need the Turso CLI or your application's own database access.

    Q: What's the difference between mcp-turso and mcp-turso-cloud?
    A: mcp-turso focuses on querying a single connected database. mcp-turso-cloud variants add organization-level operations (like listing or creating databases across your Turso org) on top of similar read-only data access — check which one matches what you actually need before installing.

    Q: Does this work with any SQLite database, or specifically Turso?
    A: Specifically Turso/libSQL — it connects via a libsql:// URL and Turso auth token, not a local .sqlite file. For a plain local SQLite file, you'd want a different, file-based MCP server instead.

    Q: Can I connect to multiple Turso databases at once?
    A: Not from a single server entry — configure one mcpServers block per database, each with its own URL and token, if you need Cursor to query more than one database in the same session.

    Related Guides


  • MCP Server for Postgres: Setup Guide

  • MySQL MCP Server: Cursor IDE Setup (2026)

  • MCP Server for Supabase: Setup Guide

  • MongoDB MCP Server: Cursor IDE Setup (2026)

  • PlanetScale MCP Server: Cursor IDE Setup (2026)

  • Prisma MCP Server: Cursor IDE Setup (2026)

  • Upstash MCP Server: Cursor IDE Setup (2026)

  • Best MCP Servers for Developers (2026)

  • MCP Security Best Practices (2026)
  • ---


    Related guides