@prama13/turso-mcp
v0.1.1
Published
MCP server for readonly Turso/libSQL database queries
Maintainers
Readme
@prama13/turso-mcp
A Model Context Protocol (MCP) server for readonly querying of Turso/libSQL databases. This server enables AI assistants like Claude, Roo, and Cline to safely query your Turso database without any risk of data modification.
Features
- 🔒 Read-only operations - Only SELECT queries are allowed
- 📊 Table browsing - List all tables and view their schemas
- 🚫 Security-focused - Blocks all write operations (INSERT, UPDATE, DELETE, DROP, CREATE, ALTER, etc.)
- 🔌 MCP Protocol - Compatible with any MCP client
- 📦 Easy setup - Works with
npx- no installation required
Installation
No installation needed! Use directly with npx:
npx @prama13/turso-mcpConfiguration
For Roo/Cline
Add to your MCP settings:
{
"mcpServers": {
"turso": {
"command": "npx",
"args": ["-y", "@prama13/turso-mcp"],
"env": {
"TURSO_DATABASE_URL": "libsql://your-database.turso.io",
"TURSO_AUTH_TOKEN": "your-auth-token"
}
}
}
}For Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"turso": {
"command": "npx",
"args": ["-y", "@prama13/turso-mcp"],
"env": {
"TURSO_DATABASE_URL": "libsql://your-database.turso.io",
"TURSO_AUTH_TOKEN": "your-auth-token"
}
}
}
}Getting Your Turso Credentials
- Install Turso CLI:
curl -sSfL https://get.tur.so/install.sh | bash- Sign up/login:
turso auth signup
# or
turso auth login- Create a database:
turso db create my-database- Get your database URL:
turso db show my-database --url- Create an auth token:
turso db tokens create my-databaseAvailable Tools
query
Run read-only SQL queries against your Turso database.
Parameters:
sql(string, required) - The SQL query to execute (SELECT only)
Example:
SELECT * FROM users WHERE id = 1;Available Resources
The server exposes all database tables as resources:
- List tables - Automatically discovers all tables in your database
- Table schemas - View column definitions for each table
Security
This server implements multiple layers of security to ensure read-only access:
Keyword filtering - Blocks SQL statements containing write keywords:
- INSERT, UPDATE, DELETE, DROP, CREATE, ALTER
- REPLACE, TRUNCATE, ATTACH, DETACH
- PRAGMA, REINDEX, VACUUM, ANALYZE
Environment-based credentials - Database credentials are passed via environment variables, never in code
Development
# Clone the repository
git clone https://github.com/PramaAditya/turso-mcp.git
cd turso-mcp
# Install dependencies
npm install
# Build
npm run build
# Test locally
TURSO_DATABASE_URL="libsql://..." TURSO_AUTH_TOKEN="..." node dist/index.jsLicense
MIT
Author
prama13
Related
- Turso - Edge SQLite database
- Model Context Protocol - Open protocol for AI-application integration
- libSQL - Open source fork of SQLite
