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.
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 databasecurrent_database
— Describe the current databaselist_tables
— List all tables in the databasedescribe_table
— Get the structure of a specific tableexecute_query
— Execute read-only SELECT queriesinsert_data
— Insert new data into tablesupdate_data
— Update existing data in tablesdelete_data
— Delete data from tablesschema_change
— Execute schema modification statements (CREATE TABLE, ALTER TABLE, DROP TABLE)To use Turso with Claude Desktop, add it to your MCP configuration:
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:
If you're using Claude Code, you can easily connect to your Turso MCP server using the built-in MCP management commands:
Add the MCP server to Claude Code:
claude mcp add my-database -- tursodb ./path/to/your/database.db --mcp
Restart Claude Code to activate the connection
Start querying your database through natural language!
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 commandtursodb
- The Turso database CLI./path/to/your/database.db
- Path to your SQLite database file--mcp
- Enables MCP server mode# 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
# 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:
Big thanks to Braden Wong for his contributions to the MCP documentation.
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:
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.
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.