shop-db MCP Server
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., "@shop-db MCP Server What are the top 5 products by 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.
shop-db MCP Server
A read-only Model Context Protocol server
that gives AI agents analytical access to an e-commerce SQLite database
(customers, orders, order_items, products) — without any ability to
modify data.
Built for Node.js v24.19+, running TypeScript source files directly
(no build step) using native node:sqlite and node:test.
Setup
npm installThe repository already includes a populated ./shop.db at the project
root — no seeding step is needed. Nothing in npm start or npm test
writes to it: the server opens it read-only, and the test suite builds its
own throwaway databases under tests/ from tests/fixtures/seed.sql.
Related MCP server: Read-Only SQLite Shop Database MCP Server
Run the server
npm startThe server communicates over stdio (StdioServerTransport) — it's meant to
be launched by an MCP client (Claude Code, Claude Desktop, etc.), not run
interactively.
Tests
npm testRuns node --test against tests/, covering SQL validation edge cases
(mutation keywords, comment-evasion, multi-statement injection, CTEs,
EXPLAIN) and the three MCP tools end-to-end against isolated test
databases built from tests/fixtures/seed.sql. The committed ./shop.db
is never read or written by the test suite.
Configuring the database path
By default the server reads ./shop.db (relative to the working
directory it's launched from). Override with the DB_PATH environment
variable:
DB_PATH=/absolute/path/to/shop.db npm startTools
list_tables— lists the 4 tables with a short description of each.describe_table— column definitions, types, primary keys, and up to 3 sample rows, for one table (tableName) or all tables (omit it).read_query— executes a read-onlySELECT/WITH/EXPLAIN/PRAGMAquery (query, required) and returns up tolimitrows (optional, default 100, max 1000). Any mutation attempt (INSERT,UPDATE,DELETE,DROP, ...) is rejected with a clear error, even if disguised with SQL comments or wrapped in a CTE.
AI agent config
{
"mcpServers": {
"shop-db": {
"command": "node",
"args": ["/absolute/path/to/src/index.ts"],
"env": {
"DB_PATH": "/absolute/path/to/shop.db"
}
}
}
}Project docs
AGENTS.md— instructions for AI coding agents working on this repo (also loaded asCLAUDE.mdvia symlink).CONTEXT.md— domain model and safety architecture.
Available Tools
3 toolsdescribe_tableA
Get column definitions, data types, primary keys, and sample rows for one or all tables in the database.
Inputs: tableName.
list_tablesA
List all available tables in the e-commerce database.
Inputs: no named parameters.
read_queryA
Execute a read-only SQL query against the database. Use this tool for analytical aggregations, joins, filtering, CTEs, and reporting.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: listing tables, describing schema, and running queries. There is no overlap or ambiguity, so an agent can easily select the right tool for each operation.
All tool names follow a consistent snake_case verb_noun pattern (list_tables, describe_table, read_query). The naming is predictable and adheres to a single convention throughout.
With only 3 tools, the set is slightly minimal but well-scoped for a read-only database introspection server. Each tool serves a necessary function, and the count is reasonable for the apparent purpose.
The tool surface fully covers the core operations needed for read-only database access: enumerating tables, inspecting schemas, and executing arbitrary queries. No critical gaps are evident for the intended domain.
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to safely interact with a SQLite shop database through schema discovery, read-only SQL queries, and pre-built analytics reports like top customers, top products, and revenue summaries.6236 npmMIT
- FlicenseAqualityCmaintenanceEnables AI agents to safely inspect and query an SQLite e-commerce database with tools for listing tables, describing schemas, and running read-only SQL queries while blocking destructive operations.4-
- FlicenseAqualityCmaintenanceEnables AI agents to read-only query an online store's SQLite database, listing tables, inspecting schemas, and running SELECT queries over customers, products, orders, and order items.3-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to read-only analyze a SQLite e-commerce database, exploring schema and running analytical SQL queries over stdio.-