The MCP-Turso-Cloud server provides seamless integration between LLMs and Turso databases through the Model Context Protocol, implementing a two-level authentication system that handles both organization-level and database-level operations for secure and efficient database management.
Add this configuration 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 Windows Subsystem for Linux environments:
{
"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"
]
}
}
}
TURSO_API_TOKEN
: Your Turso Platform API token (required)TURSO_ORGANIZATION
: Your Turso organization name (required)TURSO_DEFAULT_DATABASE
: Default database 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')Use this to view all databases in your Turso organization:
{
"databases": []
}
Response example:
{
"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"
}
]
}
To create a new database:
{
"name": "analytics_db",
"group": "production",
"regions": ["us-east", "eu-west"]
}
To remove a database:
{
"name": "test_db"
}
Create authentication tokens for specific databases:
{
"database": "customer_db",
"expiration": "30d",
"permission": "read-only"
}
To view all tables in a database:
{
"database": "customer_db"
}
For safe, read-only operations (SELECT and PRAGMA):
{
"query": "SELECT * FROM users WHERE age > ?",
"params": { "1": 21 },
"database": "customer_db"
}
For operations that modify data (INSERT, UPDATE, DELETE, etc.):
{
"query": "INSERT INTO users (name, age) VALUES (?, ?)",
"params": { "1": "Alice", "2": 30 },
"database": "customer_db"
}
Get detailed information about a table's structure:
{
"table": "users",
"database": "customer_db"
}
Perform similarity searches using vector data:
{
"table": "embeddings",
"vector_column": "embedding",
"query_vector": [0.1, 0.2, 0.3, 0.4],
"limit": 5,
"database": "vector_db"
}
If you encounter authentication problems:
If you have trouble connecting to databases:
The server implements a security-focused separation between read-only and destructive database operations:
execute_read_only_query
is for SELECT and PRAGMA queries (safe operations)execute_query
is for INSERT, UPDATE, DELETE, CREATE, DROP, and other operations that modify dataAlways carefully review SQL queries before approving them, especially for destructive operations that can modify or delete data.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.