Home / MCP / Turso MCP Server

Turso MCP Server

Provides access to Turso-hosted LibSQL databases with table listing, schema retrieval, and SELECT query capabilities via MCP.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "turso": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-turso"
            ],
            "env": {
                "TURSO_DATABASE_URL": "your_url",
                "TURSO_AUTH_TOKEN": "your_token"
            }
        }
    }
}

You can connect to Turso-hosted LibSQL databases through this MCP server to list tables, view schemas, and run SELECT queries. This enables you to interact with your Turso data sources directly from your MCP client without writing boilerplate code.

How to use

You use an MCP client to connect to the Turso MCP server. Once connected, you can perform the following actions: list all tables in a database, retrieve the database schema, inspect the schema of a specific table, and execute SELECT queries to read data. Use these capabilities to build data-driven tooling, dashboards, or ad‑hoc data exploration workflows.

How to install

Prerequisites: make sure you have Node.js and npm installed on your machine.

Install and run the Turso MCP server using NPX. You will provide your Turso database URL and authentication token as environment variables.

# Start the Turso MCP server using NPX
TURSO_DATABASE_URL=your_url TURSO_AUTH_TOKEN=your_token npx -y mcp-turso
```

# If you prefer to customize logs, you can specify a logs path as shown in configuration options.

Configuration and usage notes

Configure the Turso MCP server by setting two environment variables: TURSO_DATABASE_URL for your Turso database URL and TURSO_AUTH_TOKEN for your authentication token. These values are required for the MCP server to connect to your Turso database.

Logging: By default, the server logs to a location relative to where the mcp-turso script runs. You can customize the log path by passing a --logs option with an absolute POSIX path when you launch the server. The log path is emitted to stderr when the server starts.

Examples of what you can do with the MCP server

- Retrieve a list of all tables in your Turso database.

- Retrieve the full database schema or the schema for an individual table.

- Execute SELECT queries to read data from tables and process results within your MCP client.

Troubleshooting tips

If you encounter connection errors, verify that your TURSO_DATABASE_URL is correct and that your TURSO_AUTH_TOKEN has the necessary permissions for the target database.

Check logs for detailed error messages. If you’re using a custom logs path, confirm the path is accessible by the process.

Available tools

list_tables

Fetches a list of all table names present in the connected Turso database.

get_db_schema

Retrieves the schema definitions for all tables in the connected database as SQL creation statements.

describe_table

Returns the column definitions (names and types) for a specified table.

query_database

Executes a SELECT SQL query against the database and returns results including columns, rows, and rowCount.