Shop MCP Server
Provides analytics on a SQLite database for an online store, enabling queries on customers, orders, and products, with read-only safe SQL execution.
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 MCP Server Show me 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 MCP Server
Local MCP server for analytics of an online store's SQLite database. The AI agent calls an MCP tool, the server converts the request into a safe SQL SELECT, directly reads shop.db, and returns a structured result.
Host-приложение
├── AI-агент / LLM
└── MCP-клиент
│ JSON-RPC / stdio
▼
Shop MCP Server
│ read-only SQLite
▼
data/shop.dbFeatures
direct SQLite connection without HTTP or a separate DB server;
MCP
stdiotransport;query_shopandinspect_databasediscovery viatools/list;eight example tasks in the description and JSON Schema of the tool;
plain text, JSON intent, or a ready-made safe
SELECT;exclusion of
cancelledorders from all analytics;pagination and result limiting;
multi-level read-only protection.
Related MCP server: Read-Only SQLite Shop Database MCP Server
Installation
Requires Python 3.11 or newer.
python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'The prepared database is already located in data/shop.db. It contains 150 customers, the customers.country field is filled in for all customers, and 45 customers belong to Germany.
Re-preparing the database
The source database is not modified. The command creates a new working copy and adds country TEXT NOT NULL with reproducible synthetic values:
.venv/bin/shop-prepare-db /path/to/original/shop.db ./data/shop.dbThe distribution depends only on customers.id, so re-preparation yields the same values. The countries are test data and do not describe the actual location of customers.
Path configuration
The path is determined in the following order:
SHOP_DB_PATH;JSON file from
SHOP_MCP_CONFIGorconfig/shop_mcp.json;data/shop.dbrelative to the working directory.
An example environment variable is in .env.example, and the MCP client configuration is in config/mcp.example.json. Replace /absolute/path/to/MCPDeveloper with the absolute path to the project.
Running
Usually the MCP client starts the server from its own configuration. To run the process manually:
SHOP_DB_PATH=./data/shop.db .venv/bin/python -m shop_mcp.serverstdout is reserved for MCP JSON-RPC. Diagnostics are not output to the protocol stream.
Tools
inspect_database
Arguments:
{"action": "list_tables"}or:
{"action": "describe_table", "table": "customers"}query_shop
Arguments:
{
"request": "Сколько клиентов из Германии?",
"limit": 100,
"offset": 0
}Examples declared via tools/list:
What tables are in the database and what fields do they have?
How many customers are from Germany?
Which country has the most customers?
Which customer spent the most? Return the name, email, and total amount.
Show the top 5 products by quantity sold and revenue.
Show the top 3 categories by revenue.
What was the revenue in 2025?
Which customer placed the most orders?
You can pass a structured intent:
{
"request": "{\"intent\": \"revenue_by_year\", \"year\": 2025}"
}Or a ready-made query:
{
"request": "SELECT name, category FROM products ORDER BY name"
}Business rules
orders.status = 'cancelled'does not participate in metrics.Customer spending and annual revenue are calculated from
orders.total_amount.Product and category revenue is calculated as
quantity * unit_price.The year interval is half-open: from January 1 inclusive to January 1 of the next year exclusive.
In the provided database, all orders belong to 2026, so revenue for 2025 is
0.
Security
The server opens SQLite via mode=ro, enables query_only, sets up a SQLite authorizer, forbids multiple statements, DML, DDL, ATTACH, modifying PRAGMA, extension loading, and limits execution time.
Any attempt to perform an operation other than SELECT returns a precise answer:
Не доступный вариант запросаInternal SQLite errors, stack traces, and local paths are not returned to the client.
Testing
.venv/bin/pytest
.venv/bin/ruff check .
.venv/bin/ruff format --check .The tests include a real MCP server launch as a subprocess, a ClientSession connection via stdio, tools/list, calls to both tools, analytical scenarios, and attempts to modify the database.
The full approved specification is in docs/specification.md.
Available Tools
2 toolsinspect_databaseПросмотр структуры базы интернет-магазинаB
Возвращает список таблиц или поля выбранной таблицы. Используйте action=list_tables либо action=describe_table.
Inputs: action (required), table. Returns: result
query_shopЗапрос к базе интернет-магазинаA
Выполняет аналитический запрос к базе интернет-магазина только для чтения. MCP преобразует запрос в безопасный SQL SELECT. Отменённые заказы не учитываются. Примеры: 1) Какие таблицы есть в базе и какие в них поля? 2) Сколько клиентов из Германии? 3) В какой стране больше всего клиентов? 4) Какой клиент потратил больше всего? Верни имя, email и общую сумму. 5) Покажи топ-5 товаров по проданному количеству и выручке. 6) Покажи топ-3 категории по выручке. 7) Какая выручка была в 2025 году? 8) Какой клиент сделал больше всего заказов?
Inputs: request (required), limit, offset. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one handles database schema inspection (list tables/describe fields), the other executes analytical queries. There is no overlap in their functional boundaries, making selection unambiguous for an agent.
Both tools follow a consistent verb_noun snake_case pattern ('inspect_database', 'query_shop'), using clear, descriptive verbs. Naming style is uniform and predictable.
With only 2 tools, the server feels minimal for a shop analytics domain. While the query tool is versatile, a more granular set (e.g., get_customers, get_orders) might be expected. The count is borderline, not excessive but thin.
The tool surface fully covers the stated purpose: schema discovery via inspect_database and arbitrary read-only analytical queries via query_shop. There are no obvious gaps for a read-only analytics server, as the query tool can address any data retrieval need.
Maintenance
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Read-only analytics for all your apps: users, AI traffic, revenue, with the SQL behind every number.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to answer analytical questions about an online store's SQLite database through specialized read-only tools, without any risk of modifying the underlying data.8-
- FlicenseAqualityDmaintenanceEnables 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-
- FlicenseAqualityDmaintenanceEnables 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 gradedqualityDmaintenanceEnables AI agents to read-only analyze a SQLite e-commerce database, exploring schema and running analytical SQL queries over stdio.-