Skip to main content
Glama
arslanmunawar0

Chinook MCP Server

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

list_tables

Lists every table with its row count.

describe_table

Shows columns, types, primary key, foreign keys and row count.

sample_rows

Returns the first few rows of a table.

run_query

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) with PRAGMA query_only.

  • Every query runs under a SQLite authorizer that allows reads only. INSERT, UPDATE, DELETE, DDL, PRAGMA and ATTACH are refused, even when hidden inside a WITH clause.

  • 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_table and sample_rows are 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]"
pytest

Connect 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-server

Using 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.5

Built 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 tools
describe_tableB
Read-onlyIdempotent

Show a table's columns, primary key, foreign keys and row count.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
nameYes
columnsYes
row_countYes
foreign_keysYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true and openWorldHint=false, so the safety profile is covered. The description adds what information is surfaced (keys and row count), but says nothing about cost, latency, or behavior on a missing table, so credit is limited.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, front-loaded with the verb and resource, listing only substantive output fields. Every word earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be re-explained, and the annotations cover the safety profile. For a single-parameter read tool the description is nearly sufficient, with only parameter format and error behavior left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single 'table' parameter is documented nowhere in the schema. The description refers only to 'a table' and provides no format guidance (qualified name, quoting, case sensitivity), so it fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb ('Show') and resource ('a table') and enumerates the exact output it produces (columns, primary key, foreign keys, row count), which cleanly distinguishes it from siblings like list_tables and sample_rows. It stops short of explicitly naming those alternatives, so it is clear but not sibling-differentiating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to use this tool versus run_query, list_tables, or sample_rows, and no prerequisites or exclusions. The purpose is implied by the content list, but no routing guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesA
Read-onlyIdempotent

List every table in the database with its row count.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety and determinism profile is covered. The description adds only that row counts are included in the listing, which is modest additional context; with an output schema present, return details need not be repeated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the resource and the returned attribute are both stated immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter discovery tool with a full output schema and annotations covering safety, the description supplies everything needed to invoke it correctly. It could go further by noting scope caveats (e.g., only accessible tables), but nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is nothing to document and the baseline of 4 applies. The description correctly implies no input is needed, though it never explicitly says the listing is unfiltered/unpaginated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (list) and resource (every table in the database) and adds the returned detail (row count), so an agent knows this is a discovery/inventory tool. It does not explicitly differentiate itself from siblings like describe_table or sample_rows, but the resource is distinct enough to distinguish them in practice.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: a zero-parameter listing tool that obviously serves as an entry point for schema exploration. It never states when to prefer this over run_query or describe_table, nor any prerequisite such as connection/permission requirements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_queryA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYes
columnsYes
row_countYes
truncatedYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is free. The description adds genuinely new behavior: statement-type enforcement, the 1–1000 limit bound, and the truncation contract with `truncated`. It does not state what happens to a rejected non-SELECT statement (error vs. empty result).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with zero filler, front-loading what the tool is before the constraints and the truncation fallback. Nothing repeats structured fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter read-only tool with an output schema and full annotation coverage, this covers everything an agent needs: input contract, dialect, limit bounds, and truncation semantics. Return shape is delegated correctly to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry both parameters — and it largely does, specifying the SQLite dialect, the accepted statement forms for `sql`, and the 1–1000 range for `limit`. The default of 100 exists only in the schema and is never restated in prose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run one read-only SQL query (SQLite dialect) and return the rows') with scope qualifiers that make it immediately distinguishable from the schema-inspection siblings. An agent knows exactly what this tool does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operating context (read-only, only SELECT/WITH...SELECT accepted) and a recovery path when output is truncated ('narrow the query or aggregate instead'). It never names the sibling tools, however, so the choice between run_query, sample_rows, or list_tables is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sample_rowsB
Read-onlyIdempotent

Return the first few rows of a table to show what its data looks like.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
tableYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYes
columnsYes
row_countYes
truncatedYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is covered structurally. The description adds that output is a small sample ('first few rows') rather than full data, which is useful, but says nothing about the size cap, failure modes, or behavior on empty tables.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight sentence with the return value front-loaded and no filler. It is efficient, though arguably too sparse to carry the parameter burden.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-shape explanation is unnecessary, and the tool is simple with one required parameter. The description is adequate for a preview tool, with the only real gap being the undocumented limit semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for two parameters. The description only implicitly references 'table' and gestures at 'first few rows' for 'limit', without clarifying that limit controls row count, its default of 5, or valid ranges.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Return') and resource ('first few rows of a table') with the intent ('show what its data looks like'), so the operation is unambiguous. It does not, however, distinguish itself from siblings like run_query or describe_table, which could also produce row data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'to show what its data looks like' implies a preview/inspection use case, which is a reasonable usage hint. But it names no alternatives and gives no when-not guidance versus run_query or describe_table, leaving routing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observeddescribe_table
    • First observedlist_tables
    • First observedrun_query
    • First observedsample_rows

TDQS

A3.7/5.0

Scored across 4 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.
    3
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Query databases in plain English using Claude. Supports SQLite, CSV, PostgreSQL, and MySQL.
    1
    -