Provides access to Turso-hosted LibSQL databases with table listing, schema retrieval, and SELECT query capabilities via MCP.
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.
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.
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.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.
- 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.
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.
Fetches a list of all table names present in the connected Turso database.
Retrieves the schema definitions for all tables in the connected database as SQL creation statements.
Returns the column definitions (names and types) for a specified table.
Executes a SELECT SQL query against the database and returns results including columns, rows, and rowCount.