An MCP (Model Context Protocol) server that exposes a SQLite database as tools — letting any MCP client (Claude Desktop, Claude Code, etc.) inspect the schema and run read-only SQL queries. The client's own model generates the SQL.
Ships with the Chinook sample database (a fictional digital music store with 11 tables: artists, albums, tracks, customers, invoices, etc.) so you can demo it immediately.
Tools
list_tables()— returns all table namesdescribe_table(table_name)— returns column names and types for a given tableread_query(sql)— executes aSELECTstatement and returns columns + rows
Resources
db://schema— fullCREATE TABLEDDL for every table
Security: only SELECT is allowed; other statement types return an error.
Requires Python 3.10+.
git clone https://github.com/simpsonxavier937-code/database-mcp-server.git
cd database-mcp-server
pip install -r requirements.txtpython mcp_server.pyBy default it serves the bundled chinook.db. Point it at any SQLite file with the DB_PATH env var:
DB_PATH=/path/to/your.db python mcp_server.pyAdd to claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"database": {
"command": "python",
"args": ["C:/path/to/database-mcp-server/mcp_server.py"],
"env": {
"DB_PATH": "C:/path/to/database-mcp-server/chinook.db"
}
}
}
}Restart Claude Desktop. Then try:
- "What tables are in the database?"
- "Show me the top 10 customers by total spend."
- "Which genre has the most tracks?"
Claude will call list_tables / describe_table to learn the schema, then generate and run SELECT queries via read_query.
python -m pytest tests/ -vmcp_server.py # the MCP server
db.py # SQLite helpers (connection, schema, query execution)
chinook.db # bundled sample database
requirements.txt
tests/
test_mcp_server.py