Skip to main content
Glama

상점의 읽기 전용 MCP 서버

기존 온라인 쇼핑몰 SQLite 데이터베이스(data/shop.db)를 위한 stdio 기반 Python MCP 서버입니다. 파일은 읽기 전용으로만 열리며, 데이터를 변경하는 SQL은 거부되어 실행되지 않습니다.

설치

Python 3.11+:

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

Related MCP server: sqlite-mcp-local

실행

프로젝트 루트에서 실행합니다 (기본 DB 경로는 ./data/shop.db):

python -m shop_mcp
# или
shop-mcp

다른 DB 경로:

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 플래그는 stdio 연결을 유지하는 데 필수입니다. shop.db만 마운트하고, 컨테이너가 호스트의 파일을 덮어쓰면 안 됩니다.

도구

도구

용도

list_tables

사용자 테이블과 역할에 대한 간단한 설명 (sqlite_sequence는 표시되지 않음)

describe_table

실제 컬럼, 타입, PK/FK

execute_readonly_sql

단일 SELECT / WITH / EXPLAIN; limit(기본값 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