Shop Database MCP Server
Provides read-only tools for inspecting and querying a SQLite database, including schema inspection and parameterized SELECT queries with pagination.
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 Database MCP ServerShow me the top 5 products by total 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 Database MCP Server
This local stdio MCP server lets an AI agent inspect and analyze shop.db. It is read-only: SQLite is opened read-only, query_only is enabled, and the server rejects anything except one SELECT or WITH ... SELECT query.
Prerequisites
Node.js 20 or newer and the supplied SQLite database.
Related MCP server: shop-database-mcp
Install
npm installConfigure
SHOP_DB_PATH is optional. If set, a relative value is resolved from the process working directory; an absolute value is used directly. Otherwise the server finds shop.db relative to its compiled module, including when launched outside the project directory. See .env.example; it is not loaded automatically.
Build
npm run buildRun manually
npm startA stdio server normally appears idle because it waits for MCP messages.
Connect to Codex IDE extension and CLI
In the IDE extension: Gear menu → MCP servers → Add server → STDIO. Set command, arguments, and environment from config/codex.config.toml.example, save, and restart the extension.
For a project-scoped setup, copy that example to .codex/config.toml and replace every /ABSOLUTE/PATH/TO/PROJECT placeholder. Codex CLI and the IDE extension share Codex MCP configuration. Do not commit the active configuration file.
Available tools
inspect_database takes no parameters. Use it before querying or when uncertain; it returns tables, columns, primary/foreign keys, relationships, and row counts.
query_database accepts sql (required), params (positional string, finite number, boolean, or null values), limit (1–200; default 100), and offset (default 0). Use ? placeholders; joins and aggregates work. It accepts exactly one read-only SELECT or WITH ... SELECT. Inspect schema before assuming columns, date formats, prices, or statuses. Results contain columns, rows, rowCount, limit, offset, and hasMore; request another page with a new offset.
{"sql":"SELECT country, COUNT(*) AS customer_count FROM customers GROUP BY country ORDER BY customer_count DESC","params":[],"limit":100,"offset":0}Test
npm testTests create temporary fixture databases and never modify shop.db.
Safety design and troubleshooting
Safety layers are read-only file access, SQLite query_only, conservative token-aware validation that ignores comments/strings/quoted identifiers, a single-statement rule, and server-side pagination. Tool errors are concise and do not expose stack traces or local paths.
If startup fails, verify SHOP_DB_PATH names an existing regular SQLite file. If a query fails, call inspect_database, use ? parameters, and verify names and relationships.
Available Tools
2 toolsinspect_databaseARead-only
Use before your first query or whenever the schema is uncertain. Returns tables, columns, keys, relationships, and row counts.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| tables | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the description doesn't need to restate safety. It adds behavioral context by describing what is returned (tables, columns, keys, relationships, row counts), and its 'returns...' phrasing makes clear this is a read/inspection operation. There is room for more detail about potential performance cost or staleness, but the description is adequate given the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the usage trigger, and every clause earns its place. The list of returned schema elements is efficient and informative without padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter inspection tool with readOnly annotations and an output schema, the description is complete. It tells the agent when to use it and what to expect in return, and no additional information is needed to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so there is nothing for the description to clarify about inputs. A baseline of 4 is appropriate for a no-parameter tool since parameter-semantics burden is eliminated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('inspect') and resource ('database'), and its purpose is unmistakable: return schema metadata. It also positions itself as a pre-query reconnaissance step, which distinguishes it from the sibling query_database.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use before your first query or whenever the schema is uncertain,' giving clear conditions for use. This implicitly excludes using it for data retrieval, which is handled by query_database. The guidance is concrete and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_databaseARead-only
Execute one parameterized read-only SELECT or WITH ... SELECT statement. Use ? placeholders and params for dynamic values. Joins and aggregate queries are supported; schema and data changes are forbidden. Results are paginated: use offset for the next page when hasMore is true. Inspect the schema instead of guessing column names, date formats, price fields, or order status semantics.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | ||
| offset | No | ||
| params | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| rows | Yes | |
| limit | Yes | |
| offset | Yes | |
| columns | Yes | |
| hasMore | Yes | |
| rowCount | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces these by stating schema and data changes are forbidden. It adds behavioral detail beyond annotations by explaining pagination (use offset when hasMore is true) and requiring ? placeholders with params. This exceeds the baseline given annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exceptionally concise and well-structured, front-loading the core purpose, then covering parameter usage, pagination, and schema-inspection advice in just a few sentences. Every sentence adds value with no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema handles return values and annotations cover safety, the description is largely complete for a query tool. It covers read-only behavior, parameterization, pagination, and best-practice schema inspection. The main gap is the lack of explicit linkage to the sibling inspect_database tool, which would strengthen the workflow guidance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description needs to explain parameters, but it only partially does so. It covers sql implicitly, explains params with ? placeholders, and clarifies offset for pagination, but does not describe the limit parameter or its constraints. This partial compensation earns a mid-range score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool executes a read-only SELECT or WITH ... SELECT statement, specifying a precise verb and resource. It distinguishes itself as a query tool but does not explicitly differentiate from the sibling inspect_database, so it misses the top score for sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by instructing to inspect the schema before guessing column names or semantics, which suggests a workflow involving schema inspection. However, it does not explicitly state when to use this tool versus alternatives, nor does it name inspect_database as the schema-inspection tool. The guidance is implied rather than explicit.
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.
2 tool updates
v1.0.0- First observed
inspect_database - First observed
query_database
TDQS
Scored across 2 tools
inspect_database handles schema metadata while query_database executes read-only SQL queries. There is no functional overlap or ambiguity between the two tools.
Both tools follow the same lower_snake_case verb_noun pattern: inspect_database and query_database. The naming is consistent, predictable, and clearly reflects each tool's purpose.
Two tools is lean but well-suited to the server's read-only database purpose: inspect the schema, then query the data. Each tool is essential, and the narrow scope justifies the small count.
For a read-only database server, inspect_database plus query_database covers the complete workflow of schema discovery and arbitrary SELECT queries with pagination. Write operations are explicitly out of scope, so their absence is not a gap.
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Open, verified shop database for AI agents: products, offers, price comparison, trust and coupons.
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.
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.647 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables read-only exploration and analysis of an included SQLite shop database through tools for listing tables, describing schemas, and running SQL queries.-
- 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-
- FlicenseAqualityBmaintenanceGives AI agents read-only analytical access to an e-commerce SQLite database (customers, orders, order_items, products) via SQL queries, table listing, and schema inspection.3-