mcp-turso-cloud
An MCP server that connects LLMs to Turso databases for organization management, SQL querying, and vector search.
Manage databases (organization-level): list all databases in your Turso organization, create new ones (with optional group and regions), and permanently delete them.
Generate database tokens: create auth tokens per database with
full-accessorread-onlypermission.Explore schemas: list all tables in a database and get column/schema details for a specific table.
Run read-only queries: execute SELECT, read-only PRAGMA, and EXPLAIN statements (automatically rejects writes, uses read-only credentials).
Run write queries: execute INSERT, UPDATE, DELETE, CREATE, DROP, ALTER and other mutating SQL (flagged destructive — confirm before approving).
Use parameterized queries: pass bound params to both query tools for safety, with optional target
databaseselection (falls back to context/default).Vector search: perform similarity search over a vector column in a table with a query vector (up to 4096 dimensions).
Operate on multiple databases: any database tool accepts an explicit database name; organization env vars configure access.
Enables vector similarity searches using SQLite vector extensions, allowing for querying vector data stored in Turso databases with customizable parameters.
Provides tools for managing Turso databases at both organization and database levels, including listing, creating, and deleting databases, generating authentication tokens, listing tables, executing SQL queries, describing table schemas, and performing vector similarity searches.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-turso-cloud list tables in my analytics database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-turso-cloud
A Model Context Protocol (MCP) server that provides integration with Turso databases for LLMs. This server implements a two-level authentication system to handle both organization-level and database-level operations, making it easy to manage and query Turso databases directly from LLMs.
Features
🏢 Organization-Level Operations
List Databases: View all databases in your Turso organization
Create Database: Create new databases with customizable options
Delete Database: Remove databases from your organization
Generate Database Token: Create authentication tokens for specific databases
💾 Database-Level Operations
List Tables: View all tables in a specific database
Execute Read-Only Query: Run SELECT and PRAGMA queries (read-only operations)
Execute Query: Run potentially destructive SQL queries (INSERT, UPDATE, DELETE, etc.)
Describe Table: Get schema information for database tables
Vector Search: Perform vector similarity search using SQLite vector extensions
Related MCP server: Supabase MCP Server
⚠️ IMPORTANT: Query Execution Security ⚠️
This server implements a security-focused separation between read-only and destructive database operations:
Use
execute_read_only_queryfor SELECT, read-only WITH/VALUES, EXPLAIN of reads, and allowlisted metadata PRAGMAs.Use
execute_queryfor INSERT, UPDATE, DELETE, CREATE, DROP, mutating PRAGMAs, and other operations that modify data.
Read tools always request read-only Turso credentials, including when
full-access clients are already cached. The token endpoint receives
authorization=read-only
as a query parameter. Read failures never fall back to full access.
Tokens and clients are cached separately by permission and refreshed
when tokens expire.
Local SQL validation rejects multiple statements, mutating PRAGMAs on the read path, and file/extension functions. It is a conservative routing check, not a complete SQL parser or a substitute for Turso's server-side authorization. Unknown or quoted PRAGMA names require the write tool. Compound statements containing internal semicolons (such as trigger definitions) are not supported. Identifiers in generated SQL are quoted; data values use bindings.
This separation allows for different permission levels and approval requirements:
Read-only operations can be auto-approved in many contexts
Destructive operations can require explicit approval for safety
ALWAYS CAREFULLY READ AND REVIEW SQL QUERIES BEFORE APPROVING THEM! This is especially critical for destructive operations that can modify or delete data. Take time to understand what each query does before allowing it to execute.
Two-Level Authentication System
The server implements a sophisticated authentication system:
Organization-Level Authentication
Uses a Turso Platform API token
Manages databases and organization-level operations
Obtained through the Turso dashboard
Database-Level Authentication
Uses database-specific tokens
Generated automatically using the organization token
Cached for performance and rotated as needed
Configuration
This server requires configuration through your MCP client. Here are examples for different environments:
Cline/Claude Desktop Configuration
Add this to your Cline/Claude Desktop MCP settings:
{
"mcpServers": {
"mcp-turso-cloud": {
"command": "npx",
"args": ["-y", "mcp-turso-cloud"],
"env": {
"TURSO_API_TOKEN": "your-turso-api-token",
"TURSO_ORGANIZATION": "your-organization-name",
"TURSO_DEFAULT_DATABASE": "optional-default-database"
}
}
}
}Claude Desktop with WSL Configuration
For WSL environments, add this to your Claude Desktop configuration:
{
"mcpServers": {
"mcp-turso-cloud": {
"command": "wsl.exe",
"args": [
"bash",
"-c",
"TURSO_API_TOKEN=your-token TURSO_ORGANIZATION=your-org node /path/to/mcp-turso-cloud/dist/index.js"
]
}
}
}Environment Variables
The server requires the following environment variables:
TURSO_API_TOKEN: Your Turso Platform API token (required)TURSO_ORGANIZATION: Your Turso organization name (required)TURSO_DEFAULT_DATABASE: Default database to use when none is specified (optional)TOKEN_EXPIRATION: Expiration time for generated database tokens (optional, default: '7d')TOKEN_PERMISSION: Permission level for generated tokens (optional, default: 'full-access')
API
The server implements MCP Tools organized by category:
Organization Tools
list_databases
Lists all databases in your Turso organization.
Parameters:
limit(integer, optional): Maximum results, default 1000, maximum 10000offset(integer, optional): Results to skip, default 0, maximum 1000000
Responses include pagination with returned_count, has_more, and
next_offset.
Example response:
{
"databases": [
{
"name": "customer_db",
"id": "abc123",
"region": "us-east",
"created_at": "2023-01-15T12:00:00Z"
},
{
"name": "product_db",
"id": "def456",
"region": "eu-west",
"created_at": "2023-02-20T15:30:00Z"
}
]
}create_database
Creates a new database in your organization.
Parameters:
name(string, required): Name for the new databasegroup(string, optional): Group to assign the database toregions(string[], optional): Regions to deploy the database to
Example:
{
"name": "analytics_db",
"group": "production",
"regions": ["us-east", "eu-west"]
}delete_database
Deletes a database from your organization.
Parameters:
name(string, required): Name of the database to delete
Example:
{
"name": "test_db"
}generate_database_token
Generates a new token for a specific database. Expiration is
configured through TOKEN_EXPIRATION; the returned JWT is a secret.
Parameters:
database(string, required): Database namepermission(string, optional): Permission level ('full-access' or 'read-only')
Example:
{
"database": "customer_db",
"permission": "read-only"
}Database Tools
Database names are limited to 1–64 letters, digits, underscores, or hyphens. Table/column identifiers accept 1–64 characters, excluding null bytes; punctuation and quotes are safely escaped. A supplied database becomes the current context only after its operation succeeds.
list_tables
Lists all tables in a database, with pagination metadata.
Parameters:
database(string, optional): Database name (uses context if not provided)limit(integer, optional): Maximum results, default 1000, maximum 10000offset(integer, optional): Results to skip, default 0, maximum 1000000
Example:
{
"database": "customer_db"
}execute_read_only_query
Executes one SELECT, read-only WITH/VALUES query, EXPLAIN of a read, or allowlisted metadata PRAGMA against a database.
Parameters:
query(string, required): One SQL statement, maximum 10000 charactersparams(object, optional): Named parameters or contiguous positional keys starting at"1"; values must be strings, finite numbers, booleans, or nulldatabase(string, optional): Database name (uses context if not provided)limit(integer, optional): Maximum rows, default 1000, maximum 10000offset(integer, optional): Rows to skip, default 0, maximum 1000000
SELECT-style queries are wrapped with an outer limit/offset,
preserving any limit already present in your SQL. Metadata PRAGMA and
EXPLAIN results are sliced after fetching. Use a stable ORDER BY
when paging. Responses retain result.rows and add pagination
metadata.
Query result rows and column names have a 512 KiB JSON budget. If a
row cannot fit, select fewer/smaller columns (for example, substr).
result.truncated and truncation_reason explain omitted results;
next_offset is null when no row fits. BigInts are decimal strings
and blobs are { "type": "blob", "base64": "..." }.
Example:
{
"query": "SELECT * FROM users WHERE age > ?",
"params": { "1": 21 },
"database": "customer_db"
}execute_query
Executes a potentially destructive SQL query (INSERT, UPDATE, DELETE, CREATE, etc.) against a database.
Parameters:
query(string, required): One write statement, maximum 10000 characters; includes mutating PRAGMAs and WITH-prefixed writesparams(object, optional): Same parameter types as the read tooldatabase(string, optional): Database name (uses context if not provided)
Example:
{
"query": "INSERT INTO users (name, age) VALUES (?, ?)",
"params": { "1": "Alice", "2": 30 },
"database": "customer_db"
}Write result rows (such as RETURNING) are capped at 1000 rows and
the same byte budget. rowsAffected remains intact. Truncation does
not undo the write: do not rerun a write to fetch omitted rows.
describe_table
Gets schema information for a table.
Parameters:
table(string, required): Table namedatabase(string, optional): Database name (uses context if not provided)
Example:
{
"table": "users",
"database": "customer_db"
}vector_search
Performs vector similarity search using SQLite vector extensions.
Parameters:
table(string, required): Table namevector_column(string, required): Column containing vectorsquery_vector(number[], required): 1–4096 finite numberslimit(integer, optional): Maximum results, default 10, maximum 1000database(string, optional): Database name (uses context if not provided)
Example:
{
"table": "embeddings",
"vector_column": "embedding",
"query_vector": [0.1, 0.2, 0.3, 0.4],
"limit": 5,
"database": "vector_db"
}Development
Setup
Use Node.js 24.15.0 or newer and pnpm 12.5.1 (pinned in
package.json). .node-version selects the development runtime.
pnpm install
pnpm check
pnpm testVite+ provides the build, formatting, linting, type checking, and test
runner through vite.config.ts:
pnpm build— bundle the executable and declarations intodist/pnpm start— run the built server with your Turso configurationpnpm dev— rebuild on source changespnpm inspect— open the MCP inspector against the built serverpnpm check— check formatting, lint, and typespnpm check:fix— apply formatting and safe lint fixespnpm format/pnpm format:check— format or check formattingpnpm test— build and run offline SQL, permission, token, MCP handler, and CLI tests; no Turso credentials or live database access needed. SQL execution tests use an isolated in-memory libSQL database.
Dependency versions live in the pnpm-workspace.yaml catalog. New
releases must be at least two days old before installation.
Editors
Install the Oxc extension in Zed or the Vite Plus Extension
Pack in VS Code. Checked-in .zed/settings.json and
.vscode/settings.json use Oxfmt with the shared vite.config.ts
formatting settings. Prettier configuration is no longer used.
Publishing
pnpm changeset
pnpm version
pnpm check
pnpm test
pnpm releasepnpm release builds and publishes through Changesets. pnpm pack
can verify the package locally without publishing.
Troubleshooting
API Token Issues
If you encounter authentication errors:
Verify your Turso API token is valid and has the necessary permissions
Check that your organization name is correct
Ensure your token hasn't expired
Database Connection Issues
If you have trouble connecting to databases:
Verify the database exists in your organization
Check that your API token has access to the database
Ensure the database name is spelled correctly
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see the LICENSE file for details.
Acknowledgments
Built on:
Available Tools
9 toolscreate_database✓ SAFE: Create a new database in your Turso organization. Database name must be unique.C
✓ SAFE: Create a new database in your Turso organization. Database name must be unique.
Inputs: name (required), group, regions.
delete_database⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.B
⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.
Inputs: name (required).
describe_tableGets schema information for a tableC
Gets schema information for a table
Inputs: table (required), database.
execute_query⚠️ DESTRUCTIVE: Execute SQL that can modify/delete data (INSERT, UPDATE, DELETE, DROP, ALTER). Always confirm with user before destructive operations.C
⚠️ DESTRUCTIVE: Execute SQL that can modify/delete data (INSERT, UPDATE, DELETE, DROP, ALTER). Always confirm with user before destructive operations.
Inputs: query (required), params, database.
execute_read_only_query✓ SAFE: Execute read-only SQL queries (SELECT, PRAGMA, EXPLAIN). Automatically rejects write operations.B
✓ SAFE: Execute read-only SQL queries (SELECT, PRAGMA, EXPLAIN). Automatically rejects write operations.
Inputs: query (required), params, database.
generate_database_tokenGenerate a new token for a specific databaseC
Generate a new token for a specific database
Inputs: database (required), permission.
list_databasesList all databases in your Turso organizationA
List all databases in your Turso organization
Inputs: no named parameters.
list_tablesLists all tables in a databaseC
Lists all tables in a database
Inputs: database.
vector_searchPerforms vector similarity searchD
Performs vector similarity search
Inputs: table (required), vector_column (required), query_vector (required), limit, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: database CRUD, querying (read-only vs. destructive), schema inspection, token generation, listing resources, and vector search. No overlap or ambiguity.
All tools follow a consistent verb_noun pattern in snake_case (e.g., create_database, execute_query, list_tables), making the set predictable and easy to navigate.
9 tools is well-scoped for a cloud database service covering management, querying, schema, tokens, and vector search. No unnecessary tools and no deficit.
Core operations are covered (CRUD for databases, query execution, schema inspection, token generation). Minor gaps like listing or revoking tokens exist, but the surface is mostly complete for typical workflows.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
MCP server for interacting with the Supabase platform
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides Claude access to Turso-hosted LibSQL databases, enabling database table listing, schema retrieval, and SELECT query execution.430 npm6MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude and other LLMs to perform database operations and invoke Edge Functions within Supabase through natural language.1,421 npm4MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for PostgreSQL, MySQL, and SQLite that gives AI assistants secure database access via the Model Context Protocol.47 npm5MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that integrates Turso databases with LLMs, supporting organization and database-level operations with two-level authentication.MIT