db-mcp
Provides safe, read-only access to a SQLite shop database, including schema discovery, table descriptions, free-form read-only SQL queries, and pre-built analytics reports such as top customers, top products, and revenue summaries.
Click on "Install 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., "@db-mcpWhat are the top 5 customers by total spending?"
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.
db-mcp
A read-only MCP server that gives an AI
agent safe access to a small SQLite shop database (shop.db): schema
discovery, free-form read-only SQL, and pre-built analytics reports.
Install
npm installRelated MCP server: SQLite Read-Only MCP Server
Configure
The server reads SHOP_DB_PATH from the process environment to locate the
database file. It is optional — if unset, the server uses shop.db in the
project root. .env files are not read automatically (there is no
dotenv dependency and no --env-file flag in package.json's scripts);
.env.example is provided only as a reminder of the variable name. Set
SHOP_DB_PATH in the actual environment the server runs in — for a stdio
MCP client, that means the env key of its config (see "Connect a client"
below).
Build
npm run buildRun
npm start
# or directly:
node dist/index.jsThe server speaks MCP over stdio — it expects to be launched as a child process by an MCP client/host, not run interactively.
Connect a client
Generic stdio MCP client config:
{
"mcpServers": {
"db-mcp": {
"command": "node",
"args": ["/absolute/path/to/db-mcp/dist/index.js"],
"env": { "SHOP_DB_PATH": "/absolute/path/to/shop.db" }
}
}
}Claude Desktop: add the same block under mcpServers in
claude_desktop_config.json (see MCP.md for the per-OS config file
location), then restart Claude Desktop.
Tools
Tool | Description |
| List all tables with a short description and row count. Call this first. |
| Column definitions, keys, row count, and sample rows for one table ( |
| Run a single read-only |
| Top customers by total spending or order count. Excludes cancelled orders. |
| Best-selling products by units sold, with revenue. Excludes cancelled orders. |
| Revenue grouped by category, year, or month, optionally filtered to one year. Excludes cancelled orders. |
Security notes
The database connection is opened with
{ readonly: true, fileMustExist: true }— the SQLite engine itself physically refuses any write, regardless of what SQL is sent.The
querytool additionally validates that the input is a singleSELECT(orWITH ... SELECT) statement before it ever reaches the database, rejectingINSERT/UPDATE/DELETE/DROP/ALTER/CREATE/PRAGMA/ATTACH/DETACH/REPLACE/VACUUM/REINDEX/TRIGGERand multi-statement input, with a friendly error message.Errors are caught at each tool's boundary and returned as an MCP tool result with
isError: trueand a short message — no stack traces or filesystem paths are ever sent to the client.All logs go to
stderr(console.error) —stdoutis reserved exclusively for the JSON-RPC protocol stream.
Tests
npm testRuns node --test (via tsx) across every *.test.ts file: unit tests for
the SQL guard, the DB connection, and each tool's query logic against the
real shop.db, plus an end-to-end test that spawns the compiled server and
drives it with a real MCP client over stdio.
Docker
docker build -t db-mcp .
docker run -i db-mcpNot required to run the server locally (the client config above expects a
local node process), but provided as an alternative way to verify/run it.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceExposes Shopify store data from SLAM Gadget SQLite databases to AI tools through 60 specialized tools for products, orders, inventory, customers, and reporting. Provides read-only access with automatic schema validation and security protections.6041MIT
- AlicenseAqualityCmaintenanceEnables safe, read-only SQL access to SQLite databases for AI agents, allowing schema exploration and SELECT queries with defense-in-depth protections.3MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to query Shopify analytics with ShopifyQL via the Admin GraphQL endpoint, executing queries and interpreting results like 'show me the products with the highest margins'.
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants like Claude to query, analyze, and summarize local SQLite e-commerce databases using natural language through 11 tools, schema resources, and pre-built analytical prompts.
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Manage your NanoCart store from any AI agent: products, orders, coupons, subscribers, reports.
Manage your Savanto store from your AI: catalog, content, prompts, and analytics, by chat.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/denezhkinia/shop-db-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server