by spences10
Provides integration with Turso databases for LLMs, supporting organization‑level and database‑level operations through a two‑level authentication system.
Mcp Turso Cloud enables large language models to list, create, delete, and query Turso databases directly via the Model Context Protocol. It separates organization‑wide management from per‑database access, applying distinct authentication tokens for each level.
npx).TURSO_API_TOKEN, TURSO_ORGANIZATION, optional TURSO_DEFAULT_DATABASE).command, args, and env settings.list_databases, create_database, execute_query, or vector_search from your LLM prompt or workflow.execute_read_only_query) and destructive (execute_query) operations.Q: Do I need to install anything locally?
A: Only the MCP server package; it runs as a Node.js process and can be started via npx.
Q: Which environment variables are mandatory?
A: TURSO_API_TOKEN and TURSO_ORGANIZATION are required. TURSO_DEFAULT_DATABASE is optional.
Q: How are database tokens managed?
A: The server generates them automatically using the organization token, caches them, and rotates according to the TOKEN_EXPIRATION setting.
Q: Can I run destructive SQL without approval?
A: Destructive queries use execute_query and should be gated by your workflow; the server does not auto‑approve them.
Q: What if I encounter authentication errors? A: Verify the API token’s validity, organization name spelling, and token expiration.
Q: Is there any support for vector similarity search?
A: Yes, the vector_search tool uses SQLite’s vector extensions to compare query vectors against stored embeddings.
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.
This server implements a security-focused separation between read-only and destructive database operations:
execute_read_only_query for SELECT and PRAGMA queries (safe,
read-only operations)execute_query for INSERT, UPDATE, DELETE, CREATE, DROP, and
other operations that modify dataThis separation allows for different permission levels and approval requirements:
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.
The server implements a sophisticated authentication system:
Organization-Level Authentication
Database-Level Authentication
This server requires configuration through your MCP client. Here are examples for different environments:
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"
}
}
}
}
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"
]
}
}
}
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')The server implements MCP Tools organized by category:
Lists all databases in your Turso organization.
Parameters: None
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"
}
]
}
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 toExample:
{
"name": "analytics_db",
"group": "production",
"regions": ["us-east", "eu-west"]
}
Deletes a database from your organization.
Parameters:
name (string, required): Name of the database to deleteExample:
{
"name": "test_db"
}
Generates a new token for a specific database.
Parameters:
database (string, required): Database nameexpiration (string, optional): Token expiration timepermission (string, optional): Permission level ('full-access' or
'read-only')Example:
{
"database": "customer_db",
"expiration": "30d",
"permission": "read-only"
}
Lists all tables in a database.
Parameters:
database (string, optional): Database name (uses context if not
provided)Example:
{
"database": "customer_db"
}
Executes a read-only SQL query (SELECT, PRAGMA) against a database.
Parameters:
query (string, required): SQL query to execute (must be SELECT or
PRAGMA)params (object, optional): Query parametersdatabase (string, optional): Database name (uses context if not
provided)Example:
{
"query": "SELECT * FROM users WHERE age > ?",
"params": { "1": 21 },
"database": "customer_db"
}
Executes a potentially destructive SQL query (INSERT, UPDATE, DELETE, CREATE, etc.) against a database.
Parameters:
query (string, required): SQL query to execute (cannot be SELECT
or PRAGMA)params (object, optional): Query parametersdatabase (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"
}
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"
}
Performs vector similarity search using SQLite vector extensions.
Parameters:
table (string, required): Table namevector_column (string, required): Column containing vectorsquery_vector (number[], required): Query vector for similarity
searchlimit (number, optional): Maximum number of results (default: 10)database (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"
}
npm install
npm run build
npm run dev
npm run build
npm publish
If you encounter authentication errors:
If you have trouble connecting to databases:
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see the LICENSE file for details.
Built on:
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by neo4j-contrib
Enables natural‑language interaction with Neo4j databases, allowing large language models to query, modify, and manage graph data through multiple transport modes.
by mongodb-js
Provides a Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas clusters through a unified API.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by neondatabase
Interact with Neon Postgres databases using natural language commands through the Model Context Protocol, enabling conversational database creation, migration, and query execution.
by domdomegg
Provides read and write access to Airtable bases for AI systems, enabling inspection of schemas and manipulation of records.
{
"mcpServers": {
"mcp-turso-cloud": {
"command": "npx",
"args": [
"-y",
"mcp-turso-cloud"
],
"env": {
"TURSO_API_TOKEN": "<YOUR_TURSO_API_TOKEN>",
"TURSO_ORGANIZATION": "<YOUR_TURSO_ORGANIZATION>",
"TURSO_DEFAULT_DATABASE": "<OPTIONAL_DEFAULT_DATABASE>"
}
}
}
}claude mcp add mcp-turso-cloud npx -y mcp-turso-cloud