Chinook MCP Server
Provides read-only exploration and querying of SQLite databases, including listing tables, describing schemas, sampling rows, and running SQL queries with safety limits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Chinook MCP Server Which five artists earned the most revenue?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Chinook MCP Server
A Model Context Protocol server, written in Python, that lets AI assistants such as Cursor and Claude Desktop explore and query a SQLite database in plain English. The database is read-only, so the assistant can't change your data.
It ships with the Chinook sample database, a digital music store with artists, albums, tracks, customers, employees and invoices. Point it at any other SQLite file with one environment variable.
Ask things like:
"Which five artists earned the most revenue, and in which countries do their customers live?"
"Which sales agent had the highest sales in 2013?"
"Show me the schema and explain how invoices link to tracks."
The assistant reads the schema, writes the SQL, runs it through this server and explains the result.
Tools
Tool | What it does |
| Lists every table with its row count. |
| Shows columns, types, primary key, foreign keys and row count. |
| Returns the first few rows of a table. |
| Runs one read-only SQL query and returns columns and rows (up to 1,000). |
The chinook://schema resource holds the full CREATE statements. All tools return structured JSON output and are marked read-only for MCP clients.
Related MCP server: MCP Database Bridge
How it stays read-only
Safety is enforced by SQLite itself, not by matching keywords in the SQL:
The file is opened in read-only mode (
mode=ro) withPRAGMA query_only.Every query runs under a SQLite authorizer that allows reads only.
INSERT,UPDATE,DELETE, DDL,PRAGMAandATTACHare refused, even when hidden inside aWITHclause.Only one statement is allowed per call.
Results are capped by a row limit, and a time limit (5 seconds by default) stops runaway queries.
Table names passed to
describe_tableandsample_rowsare checked against the real table list.
Setup
Requires Python 3.10 or newer.
git clone https://github.com/arslanmunawar0/chinook-mcp-server.git
cd chinook-mcp-server
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytestConnect it to an assistant
Use the absolute path to the chinook-mcp-server command inside your virtual environment.
Cursor: add this to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json to use it everywhere.
{
"mcpServers": {
"chinook": {
"command": "/absolute/path/to/chinook-mcp-server/.venv/bin/chinook-mcp-server"
}
}
}Claude Desktop: add the same mcpServers block to claude_desktop_config.json and restart the app.
MCP Inspector: to try the tools in a browser:
npx @modelcontextprotocol/inspector .venv/bin/chinook-mcp-serverUsing your own database
Set CHINOOK_DB_PATH to any SQLite file:
{
"mcpServers": {
"my-data": {
"command": "/absolute/path/to/chinook-mcp-server/.venv/bin/chinook-mcp-server",
"env": { "CHINOOK_DB_PATH": "/absolute/path/to/your.db" }
}
}
}Project layout
src/chinook_mcp/database.py read-only SQLite access (authorizer, limits, schema)
src/chinook_mcp/server.py MCP tools and resource
tests/ database tests, plus end-to-end tests over the MCP protocol and stdio
chinook.db Chinook sample database, v1.4.5Built with the official MCP Python SDK (v2).
Credits and licence
chinook.db is the Chinook Database by Luis Rocha, file Chinook_Sqlite.sqlite from release v1.4.5. It is used under the MIT licence, included unchanged in LICENSE-CHINOOK.md.
The server code is MIT-licensed; see LICENSE.
Available Tools
4 toolsdescribe_tableBRead-onlyIdempotent
Show a table's columns, primary key, foreign keys and row count.
Inputs: table (required). Returns: name, columns, row_count, foreign_keys
list_tablesARead-onlyIdempotent
List every table in the database with its row count.
Inputs: no named parameters. Returns: result
run_queryARead-onlyIdempotent
Run one read-only SQL query (SQLite dialect) and return the rows.
Only SELECT and WITH ... SELECT statements are accepted. At most limit
rows are returned (1 to 1000); truncated is true when more rows
matched, in which case narrow the query or aggregate instead.
Inputs: sql (required), limit. Returns: rows, columns, row_count, truncated
sample_rowsBRead-onlyIdempotent
Return the first few rows of a table to show what its data looks like.
Inputs: table (required), limit. Returns: rows, columns, row_count, truncated
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
list_tables (inventory), describe_table (schema detail), and sample_rows (data preview) are clearly distinct discovery tools. run_query overlaps somewhat with sample_rows since a preview could be achieved via a limited SELECT, but the read-only arbitrary-query purpose is still recognizable.
All four names follow a consistent verb_noun snake_case pattern (run_query, list_tables, describe_table, sample_rows). The convention is uniform and immediately readable.
Four tools is a tight, well-scoped set for a read-only database explorer, and each tool serves a distinct discovery or query step. It is on the lean side, but nothing feels redundant or missing for the stated scope.
For a read-only exploration surface, discovery (list, describe, sample) plus arbitrary querying covers the main lifecycle. Writes are intentionally excluded, though there is no way to search for a table/column by name or inspect indexes, which would be minor conveniences.
Maintenance
Related MCP Connectors
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.3MIT
- FlicenseNot gradedqualityCmaintenanceA secure, read-only MCP server that empowers Claude Desktop and AI agents to safely query and inspect local SQLite databases.-
- FlicenseNot gradedqualityCmaintenanceQuery SQLite databases via AI — safe read-only mode-
- FlicenseNot gradedqualityDmaintenanceQuery databases in plain English using Claude. Supports SQLite, CSV, PostgreSQL, and MySQL.1-