Skip to main content
Glama

db-mcp

読み取り専用の MCP サーバーです。AI エージェントに、小規模な SQLite ショップデータベース(shop.db)への安全なアクセスを提供します。スキーマ探索、自由形式の読み取り専用 SQL、あらかじめ用意された分析レポートを備えています。

インストール

npm install

Related MCP server: SQLite Read-Only MCP Server

設定

サーバーは、プロセス環境変数 SHOP_DB_PATH を読み取ってデータベースファイルの場所を特定します。この変数は省略可能です。未設定の場合は、サーバーはプロジェクトルートの shop.db を使用します。.env ファイルは自動的に読み込まれません(dotenv への依存はなく、package.json のスクリプトにも --env-file フラグはありません)。.env.example は、変数名を思い出すためのリマインダーとしてのみ提供されています。SHOP_DB_PATH は、サーバーが実際に実行される環境に設定してください。stdio MCP クライアントの場合は、そのクライアント設定内の env キーに指定します(下記の「クライアントを接続する」を参照)。

ビルド

npm run build

実行

npm start
# or directly:
node dist/index.js

サーバーは stdio 上で MCP 通信を行います。つまり、対話的に実行されるのではなく、MCP クライアント/ホストの子プロセスとして起動されることを想定しています。

クライアントを接続する

一般的な stdio MCP クライアント設定:

{
  "mcpServers": {
    "db-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/db-mcp/dist/index.js"],
      "env": { "SHOP_DB_PATH": "/absolute/path/to/shop.db" }
    }
  }
}

Claude Desktop: claude_desktop_config.jsonmcpServers に同じブロックを追加し(OS ごとの設定ファイルの場所は MCP.md を参照)、その後 Claude Desktop を再起動します。

ツール

ツール

説明

list_tables

すべてのテーブルを、短い説明と行数付きで一覧表示します。最初に呼び出してください。

describe_table

1つのテーブル(customersproductsordersorder_items)のカラム定義、キー、行数、サンプル行を表示します。

query

limit/offset ページングを使用して、単一の読み取り専用 SELECT(または WITH ... SELECT)を実行します。

get_top_customers

総支出額または注文数に基づく上位顧客を表示します。キャンセル済みの注文は除外されます。

get_top_products

販売数量に基づくベストセラー商品と売上高を表示します。キャンセル済みの注文は除外されます。

get_revenue_report

カテゴリ、年、月ごとにグループ化した売上を表示します。オプションで1年に限定できます。キャンセル済みの注文は除外されます。

セキュリティに関する注意

  • データベース接続は { readonly: true, fileMustExist: true } で開かれます。SQLite エンジン自体が、送信される SQL の内容に関係なく、物理的にすべての書き込みを拒否します。

  • query ツールは、入力がデータベースに到達する前に、それが単一の SELECT(または WITH ... SELECT)ステートメントであることをさらに検証し、INSERT/UPDATE/DELETE/DROP/ALTER/CREATE/PRAGMA/ATTACH/DETACH/REPLACE/VACUUM/REINDEX/TRIGGER およびマルチステートメントの入力を、わかりやすいエラーメッセージとともに拒否します。

  • エラーは各ツールの境界で捕捉され、isError: true と短いメッセージを持つ MCP ツールの結果として返されます。スタックトレースやファイルシステムのパスがクライアントに送信されることは一切ありません。

  • すべてのログは stderrconsole.error)に送信されます。stdout は JSON-RPC プロトコルストリーム専用に予約されています。

テスト

npm test

node --testtsx 経由)をすべての *.test.ts ファイルで実行します。実物の shop.db に対する SQL ガード、DB 接続、各ツールのクエリロジックのユニットテストに加え、コンパイル済みサーバーを起動して stdio 上の実際の MCP クライアントで操作するエンドツーエンドテストが含まれます。

Docker

docker build -t db-mcp .
docker run -i db-mcp

サーバーをローカルで実行するために必須ではありません(上記のクライアント設定はローカルの node プロセスを想定しています)が、検証や実行のための代替手段として提供されています。

Install Server
A
license - permissive license
A
quality
B
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
    B
    quality
    C
    maintenance
    Exposes Shopify store data from SLAM Gadget SQLite databases to AI tools through 60 specialized tools for products, orders, inventory, customers, and reporting. Provides read-only access with automatic schema validation and security protections.
    60
    41
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to query Shopify analytics with ShopifyQL via the Admin GraphQL endpoint, executing queries and interpreting results like 'show me the products with the highest margins'.
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants like Claude to query, analyze, and summarize local SQLite e-commerce databases using natural language through 11 tools, schema resources, and pre-built analytical prompts.

View all related MCP servers

Related MCP Connectors

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

  • Manage your NanoCart store from any AI agent: products, orders, coupons, subscribers, reports.

  • Manage your Savanto store from your AI: catalog, content, prompts, and analytics, by chat.

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/denezhkinia/shop-db-mcp'

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