Introducing the Turso Database MCP

Glauber CostaGlauber Costa
Jamie BartonJamie Barton
Cover image for Introducing the Turso Database MCP

Today we're announcing built-in Model Context Protocol (MCP) support for Turso Database, making it easier than ever for AI assistants to work with your embedded databases.

Model Context Protocol is an open standard that enables AI assistants to interact with external tools and data sources. Think of it as a universal adapter that lets AI models connect to databases, APIs, and other systems in a standardised way.

With a simple --mcp flag, your Turso database becomes a tool that AI assistants like Claude can use to query data, modify schemas, and perform database operations - all through natural language conversations.

By adding MCP support to Turso, we're making SQLite databases first-class citizens in the AI ecosystem.

#Getting Started

Start the MCP server by adding the --mcp flag to your Turso command:

# With an existing database
tursodb your_database.db --mcp

# Or create an in-memory database
tursodb --mcp

The MCP server provides nine powerful tools that AI assistants can use:

  • open_database — Open a new database
  • current_database — Describe the current database
  • list_tables — List all tables in the database
  • describe_table — Get the structure of a specific table
  • execute_query — Execute read-only SELECT queries
  • insert_data — Insert new data into tables
  • update_data — Update existing data in tables
  • delete_data — Delete data from tables
  • schema_change — Execute schema modification statements (CREATE TABLE, ALTER TABLE, DROP TABLE)

#Using with Claude Desktop

To use Turso with Claude Desktop, add it to your MCP configuration:

  1. Open your Claude Desktop settings
  2. Navigate to the Developer section
  3. Add the Turso MCP server to your claude_desktop_config.json:
{
  "mcpServers": {
    "turso": {
      "command": "tursodb",
      "args": ["path/to/your/database.db", "--mcp"]
    }
  }
}

Now you can ask Claude to interact with your database naturally:

  • "List tables in my database"
  • "Show me all users who signed up this month"
  • "Add a new product to the inventory table"
  • "Create a table to track customer orders"

#Using with Claude Code

If you're using Claude Code, you can easily connect to your Turso MCP server using the built-in MCP management commands:

#Quick Setup

  1. Add the MCP server to Claude Code:

    claude mcp add my-database -- tursodb ./path/to/your/database.db --mcp
    
  2. Restart Claude Code to activate the connection

  3. Start querying your database through natural language!

#Command Breakdown

claude mcp add my-database -- tursodb ./path/to/your/database.db --mcp
#              ↑            ↑       ↑                           ↑
#              |            |       |                           |
#              Name         |       Database path               MCP flag
#                          Separator
  • my-database - Choose any name for your MCP server
  • -- - Required separator between Claude options and your command
  • tursodb - The Turso database CLI
  • ./path/to/your/database.db - Path to your SQLite database file
  • --mcp - Enables MCP server mode

#Example Usage

# For a local project database
cd /your/project
claude mcp add my-project-db -- tursodb ./data/app.db --mcp

# For an absolute path
claude mcp add analytics-db -- tursodb /Users/you/databases/analytics.db --mcp

# For a specific project (local scope)
claude mcp add project-db --local -- tursodb ./database.db --mcp

#Managing MCP Servers

# List all configured MCP servers
claude mcp list

# Get details about a specific server
claude mcp get my-database

# Remove an MCP server
claude mcp remove my-database

Once configured, you can ask Claude Code to:

  • "Show me all tables in the database"
  • "What's the schema for the users table?"
  • "Find all posts with more than 100 upvotes"
  • "Insert a new user with name 'Alice' and email 'alice@example.com'"

Big thanks to Braden Wong for his contributions to the MCP documentation.

#Why MCP Changes Everything

Imagine you're starting a new project. You know you need a database, but you're not sure about the schema yet. Maybe you're building an eCommerce platform, but the requirements keep evolving.

Without MCP, you'd:

  • Switch between your code editor and database tool
  • Write CREATE TABLE statements from scratch
  • Test them, find issues, drop tables, try again
  • Google "SQLite foreign key syntax" for the hundredth time
  • Manually insert test data to verify your design

With Turso's MCP server, your AI assistant becomes your database design partner:

# Start the MCP server
tursodb commerce.db --mcp

Now you can think out loud: "I need to track products with variants like size and color, customers who might have multiple addresses, and orders that can be partially fulfilled."

Your AI assistant doesn't just generate SQL. It understands your intent, suggests normalization strategies, warns about potential issues, and even helps you visualize relationships. When requirements change ("Oh, we also need to track inventory by warehouse location"), your assistant helps refactor the schema while preserving your data.

Instead of context-switching between documentation, SQL clients, and your code, you stay in your flow, iterating rapidly with an assistant that understands both your business logic and database design principles.

#Try It Today

MCP support is available in the latest Turso CLI:

curl -sSL tur.so/install | sh

We're excited to see how you'll use AI assistants with your Turso databases. Whether you're prototyping new applications, analyzing data, or teaching others about databases, MCP makes it more accessible than ever.

Make sure you join us on Discord to share your experiences with MCP, and get involved rewriting SQLite.