shop-analytics-mcp
Provides read-only analytics over SQLite databases, allowing agents to inspect database schemas, view table summaries, and execute read-only SQL queries with pagination.
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., "@shop-analytics-mcpWhat are the top 5 customers by total spend?"
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 Analytics MCP Server
A read-only Model Context Protocol (MCP) server that exposes a SQLite database (shop.db) to AI agents via two tools.
Features
Tool | Description |
| Returns DDL (CREATE TABLE statements) for all tables |
| Returns a summary of a specific table, including row count and the first 5 sample rows |
| Executes a SELECT query and returns results as JSON. Supports pagination via |
Security & Robustness
Mutation keyword blocking – queries containing
INSERT,UPDATE,DELETE,DROP,ALTER,CREATE,REPLACE, orTRUNCATEare rejected before reaching the database.Automatic Pagination –
execute_read_only_sqlautomatically caps results at 100 rows, but can be customized with explicitlimitandoffsetparameters.Read-only SQLite URI – the database is opened with
?mode=ro, preventing any writes at the OS level.Structured Errors – SQL errors are returned as a JSON structure to help agents easily understand and recover from mistakes.
Related MCP server: mcp-to-db
Requirements
Python 3.10+
Dependencies listed in
requirements.txt
1. Installation
# Clone / enter the project directory
cd shop-analytics-mcp
# Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt2. Configuration
Environment Variable | Default | Description |
|
| Absolute or relative path to the SQLite database |
3. Running the Server
The server communicates via stdio (standard input/output), which is the transport used by MCP hosts.
Running Locally
# Run with the default shop.db in the current directory
python server.py
# Run with a custom database path
SHOP_DB_PATH=/path/to/my.db python server.pyRunning with Docker
You can run the server in an isolated Docker container. Since MCP uses stdio, you must run the container in interactive mode (-i).
docker build -t shop-analytics-mcp .
# Run the container (reads and writes to stdio)
docker run -i --rm shop-analytics-mcp4. Connecting to Agent
Any MCP-compatible host can connect to this server via stdio.
Agent Configuration (mcp.json)
{
"mcpServers": {
"shop-analytics": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/shop-analytics-mcp/server.py"],
"env": {
"SHOP_DB_PATH": "/path/to/shop.db"
}
}
}
}Programmatic (Python MCP client SDK)
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
params = StdioServerParameters(
command="python",
args=["server.py"],
env={"SHOP_DB_PATH": "shop.db"},
)
async with stdio_client(params) as (r, w):
async with ClientSession(r, w) as session:
await session.initialize()
result = await session.call_tool("get_database_schema", {})
print(result.content[0].text)
asyncio.run(main())Running Tests
Unit Tests
pytest tests/test_server.py -vEvaluation Test Suite
Comprehensive evaluation suite covering all phases defined in EVALS_SPEC.md (Environment, Security, Functional Tasks, and Robustness).
pytest tests/test_evals.py -vContract Smoke Test
The smoke test launches the server as a subprocess and exercises both tools via the MCP client SDK — no LLM required.
python tests/smoke_test.pyProject Structure
shop-analytics-mcp/
├── server.py # FastMCP server (entry point)
├── create_shop_db.py # One-time script to create demo shop.db
├── Dockerfile # Docker image configuration
├── .dockerignore # Files to ignore in Docker context
├── requirements.txt
├── README.md
├── SPEC.md # Initial project specification
├── EVALS_SPEC.md # Evaluation implementation plan
└── tests/
├── test_server.py # pytest unit tests (in-memory SQLite)
├── test_evals.py # Comprehensive TDD evaluation suite
└── smoke_test.py # Contract smoke test (stdio subprocess)Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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 Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to explore MySQL database schemas and execute read-only queries through a safe, MCP interface.6-
- FlicenseNot gradedqualityCmaintenanceExposes any SQLite database as read-only MCP tools for AI assistants, enabling listing tables, describing schemas, and running SELECT queries with filtering, ordering, and pagination.-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to query a SQLite database using natural language through the Model Context Protocol (MCP). Includes security guardrails that block destructive SQL operations.-
- FlicenseNot gradedqualityBmaintenanceEnables read-only querying of a local SQLite database via MCP, with tools to list tables, retrieve schema, and execute SELECT/WITH/EXPLAIN queries.-
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/yuzislav/shop-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server