Skip to main content
Glama

読み取り専用 MCP ストアサーバー

Python MCP サーバー(stdio 経由)で、既存のオンラインストア SQLite データベース(data/shop.db)を読み取ります。ファイルは読み取り専用で開かれ、変更を伴う SQL は拒否され、実行されません。

インストール

Python 3.11 以上:

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

Related MCP server: sqlite-mcp-local

起動

プロジェクトのルートから(データベースへのパスはデフォルトで ./data/shop.db):

python -m shop_mcp
# или
shop-mcp

別のデータベースパス:

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

このプロセスは MCP 経由で stdin/stdout を介して通信します。MCP クライアントが接続されるまで、このターミナルにコマンドを入力しないでください。

Cursor での MCP 設定

mcpServers エントリを追加します(Cursor Settings → MCP、またはプロジェクト内の .cursor/mcp.json)。トランスポートは stdio です。

例の中のパス ~/my/test-mcp-db は、このリポジトリを指しています。サーバーは SHOP_DB_PATH を自身で展開します(~ → ホームディレクトリ)。Cursor が command / cwd~ を展開しない場合は、そこに /Users/<вы>/my/test-mcp-db/... を指定してください。

ローカル (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"
      }
    }
  }
}

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

イメージを一度ビルドします:

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"
      ]
    }
  }
}

-i フラグは stdin io を接続したままにするために必須です。shop.db のみをマウントしてください。コンテナがホスト上のファイルを上書きしないようにしてください。

ツール

Tool

説明

list_tables

ユーザーテーブルとその役割の簡単な説明(sqlite_sequence は表示されません)

describe_table

実際のカラム、型、PK/FK

execute_readonly_sql

単一の SELECT / WITH / EXPLAINlimit(デフォルト 100、最大 1000)と offset

shop_analytics

手動 SQL なしで年間ランキングと売上を取得

合計、数量、売上は order_items.quantity * order_items.unit_price として計算され、ステータスが cancelled の注文は除外されます。暦年は strftime('%Y',orders.order_date) から取得されます。

セキュリティ

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

  • コメントは除去され、クエリチェーン(SELECT 1; DELETE ...)は拒否されます

  • INSERT / UPDATE / DELETE / DROP / ALTER / CREATE / ATTACH / PRAGMA / … → 明示的な「許可されていません」エラー

  • SQLite の構文エラーと不明なカラムは、構造化して返されます。プロセスは終了しません

評価に関する注記

  • customers には country カラムがありません。 これは describe_table で確認できます。地理情報を勝手に推定してはいけません。SELECT country FROM customers は SQLite エラーを返します。

  • 現在のダンプの注文日は 2026 年です。 2025 年の売上は 0 になることがあります。これはフィルターの故障ではなく、正しい結果です。

テスト

pytest

テストは、data/shop.db を一時ファイルにコピーし、拒否された書き込み後もコピーのハッシュが変更されないことを検証します。

実行済みクエリの例

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