Skip to main content
Glama

Read-only MCP server for a store

Python MCP server over stdio for an existing SQLite database of an online store (data/shop.db). The database file is opened read-only; modifying SQL is rejected and not executed.

Installation

Python 3.11+:

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Related MCP server: sqlite-mcp-local

Running

From the project root (default database path is ./data/shop.db):

python -m shop_mcp
# или
shop-mcp

Another database path:

SHOP_DB_PATH=~/my/test-mcp-db/data/shop.db python -m shop_mcp

The process communicates via MCP through stdin/stdout. Don't enter commands into this terminal until an MCP client is connected to it.

MCP config in Cursor

Add an mcpServers entry (Cursor Settings → MCP, or .cursor/mcp.json in the project). The transport is stdio.

In the examples, the path ~/my/test-mcp-db is this repository. The server expands SHOP_DB_PATH itself (~ → home directory). If Cursor doesn't expand ~ in command / cwd, specify /Users/<you>/my/test-mcp-db/... there.

Locally (venv)

{
  "mcpServers": {
    "shop": {
      "command": "~/my/test-mcp-db/.venv/bin/python",
      "args": ["-m", "shop_mcp"],
      "cwd": "~/my/test-mcp-db",
      "env": {
        "SHOP_DB_PATH": "~/my/test-mcp-db/data/shop.db"
      }
    }
  }
}

If a console script is more convenient after pip install -e .:

{
  "mcpServers": {
    "shop": {
      "command": "~/my/test-mcp-db/.venv/bin/shop-mcp",
      "cwd": "~/my/test-mcp-db",
      "env": {
        "SHOP_DB_PATH": "~/my/test-mcp-db/data/shop.db"
      }
    }
  }
}

Docker

Build the image once:

docker build -t shop-mcp .
{
  "mcpServers": {
    "shop": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "~/my/test-mcp-db/data/shop.db:/data/shop.db:ro",
        "-e",
        "SHOP_DB_PATH=/data/shop.db",
        "shop-mcp"
      ]
    }
  }
}

The -i flag is required to keep stdio connected. Mount only shop.db; the container must not overwrite the file on the host.

Tools

Tool

Purpose

list_tables

User tables and a brief description of their role (sqlite_sequence is not shown)

describe_table

Actual columns, types, PK/FK

execute_readonly_sql

A single SELECT / WITH / EXPLAIN; limit (default 100, maximum 1000) and offset

shop_analytics

Ratings and revenue for a year without manual SQL

Amounts, quantities, and revenue are calculated as order_items.quantity * order_items.unit_price; orders with the cancelled status are excluded. The calendar year is taken from strftime('%Y', orders.order_date).

Security

  • SQLite URI file:<abs>?mode=ro

  • Comments are stripped; query chains (SELECT 1; DELETE ...) are rejected

  • INSERT / UPDATE / DELETE / DROP / ALTER / CREATE / ATTACH / PRAGMA / … → explicit "not allowed" error

  • SQLite syntax errors and unknown columns are returned in a structured way; the process doesn't terminate

Notes on evaluation

  • The customers table has no country column. That is visible through describe_table; don't invent geography. SELECT country FROM customers will return an SQLite error.

  • Order dates in the current dump are from 2026. Revenue for 2025 may be 0. That's a correct result, not a broken filter.

Tests

pytest

The tests copy data/shop.db to a temporary file and verify that the copy's hash doesn't change after rejected writes.

Example of a processed query

screenshot.png

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    C
    maintenance
    A read-only MCP server that enables LLMs to safely explore and query any SQLite database via natural language. It exposes tools for listing tables, describing schemas, and executing SELECT/WITH queries with built-in safety guards like write prevention and row limits.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables read-only querying of a local SQLite database via MCP, with tools to list tables, retrieve schema, and execute SELECT/WITH/EXPLAIN queries.
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides read-only access to a sales database, letting LLMs answer analytics questions like revenue by region or top customers via MCP tools.
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables natural-language sales queries against a SQLite database, generating and executing read-only SQL through a secure MCP server with table listing, schema description, and query execution.

View all related MCP servers

Related MCP Connectors

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

  • Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.

  • Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…

View all MCP Connectors

Latest Blog Posts

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/DrZeD-13/test-mcp-db'

If you have feedback or need assistance with the MCP directory API, please join our Discord server