Shop Analytics MCP
Shop MCP Server
SQLite 데이터베이스의 안전한 분석을 위한 TypeScript 기반 MCP 서버입니다. stdio로만 작동하며, 6개의 전용 도구를 제공합니다. 임의 SQL은 허용되지 않습니다.
요구 사항
Node.js 24.10 이상;
npm;
sqlite3CLI는 마이그레이션 재적용에만 사용됩니다.
Related MCP server: Shop SQLite MCP
설치 및 실행
npm ci
npm run build
SHOP_DB_PATH=./shop.db npm startSHOP_DB_PATH가 우선합니다. 변수가 설정되지 않으면 서버는 현재 작업 디렉토리에서 shop.db를 찾습니다. 데이터베이스 경로는 소스 코드에 하드코딩되어 있지 않습니다.
데이터
리포지토리에는 마이그레이션이 완료된 shop.db가 포함되어 있습니다. 여기에는 고객 국가 및 2025년 데이터가 포함됩니다. 금액 값은 EUR로 해석되며 변환되지 않습니다.
마이그레이션을 원본 데이터베이스에 한 번 적용하려면:
npm run migrate원본 스키마는 database/schema.sql에 있고, 결정적 마이그레이션은 database/001-add-analytics-data.sql에 있습니다.
클라이언트 연결
완성된 구성 템플릿은 config/에 있습니다:
claude-code.mcp.json;codex.mcp.json;cursor.mcp.json.
선택한 템플릿의 /absolute/path/to/mcp-server를 이 프로젝트 경로로 바꾸세요. 모든 구성은 stdio를 통해 dist/src/index.js를 실행하고 SHOP_DB_PATH를 통해 shop.db 경로를 전달합니다.
도구
도구 | 설명 |
| 테이블, 컬럼, 키 및 관계. |
| 국가별 고객 수 또는 최다 고객 국가. |
| 판매 수량 및 매출 기준 상품 순위. |
| 카테고리별 매출 순위. |
| UTC 기간 |
| 최다 지출 또는 최다 주문 고객. |
재무 및 상품 지표와 주문 수는 cancelled를 제외합니다. 금액은 Eur 접미사가 있는 필드로 반환됩니다. 순위는 limit을 1에서 100까지 허용하며, 기간은 YYYY-MM-DD 날짜를 사용합니다.
사용 예시
아래는 MCP 클라이언트가 get_database_schema를 호출하여 테이블을 설명한 다음, get_customer_metrics를 호출하여 독일 고객 수를 집계하는 방법을 보여줍니다.

보안
SQLite는
readOnly: true및PRAGMA query_only = ON으로 열립니다.authorizer는 쓰기, DDL,
ATTACH,DETACH및 트랜잭션을 금지합니다.모든 값은 SQL 매개변수로 바인딩됩니다.
도구는 SQL을 허용하지 않으므로 에이전트가 파괴적인 명령문을 전달할 수 없습니다.
검증 오류는 SQL, 절대 경로 또는 스택 추적을 노출하지 않습니다.
테스트
npm test테스트는 8가지 승인 질문에 대한 참조 응답, 국가 매개변수의 SQL 주입, DELETE 금지, 임시 데이터베이스 사본의 SHA-256 불변성 및 stdio를 통한 MCP 상호 작용을 다룹니다.
승인 질문
사용 가능한 모든 테이블을 보여주고 각 테이블에 포함된 정보를 설명하세요.
독일에서 온 고객은 몇 명인가요?
고객이 가장 많은 국가는 어디인가요?
가장 많은 돈을 지출한 고객은 누구인가요?
베스트셀러 상품 상위 5개는 무엇인가요?
매출 기준 상위 3개 상품 카테고리는 무엇인가요?
2025년에 발생한 매출은 얼마인가요?
가장 많은 주문을 한 고객은 누구인가요?
Available Tools
6 toolsget_category_revenueA
Rank non-cancelled categories by EUR revenue. Optional YYYY-MM-DD from/to and integer limit 1-100.
Inputs: no named parameters.
get_customer_metricsB
Count customers in a country or find the top country. Parameters: mode=count_by_country with country, or mode=top_country without country.
Inputs: no named parameters.
get_database_schemaA
Inspect tables, columns, keys, and relationships. Parameters: none.
Inputs: no named parameters.
get_order_leadersA
Find a customer with highest spend or most non-cancelled orders. mode=highest_spend accepts optional YYYY-MM-DD from/to; mode=most_orders accepts no dates.
Inputs: no named parameters.
get_product_salesA
Rank non-cancelled products by units sold and EUR revenue. Optional YYYY-MM-DD from/to and integer limit 1-100.
Inputs: no named parameters.
get_revenue_by_periodA
Calculate non-cancelled EUR revenue. Optional YYYY-MM-DD from/to define [from, to).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct entity or aggregation level: database schema, customer counts, product sales rankings, category revenue, total revenue, and customer leaders. Even though get_customer_metrics and get_order_leaders both involve customers, their purposes (country-level counts vs. individual customer extremes) are clearly separated. No two tools are likely to cause misselection.
All tool names follow the consistent pattern 'get_' followed by a descriptive noun phrase, using snake_case throughout. Examples: get_database_schema, get_product_sales, get_revenue_by_period. This uniform phrasing makes the set predictable and easy to navigate.
With 6 tools, the server is well-scoped for a shop analytics use case. It covers the essential query types without unnecessary proliferation, and each tool earns its place by addressing a distinct analytical question. The count is within the ideal range for a focused server.
The tool set covers key analytics workflows: schema inspection, customer metrics, product and category performance, total revenue, and top customer identification. Minor gaps include lack of time-series revenue breakdown (e.g., by day/month) and no list of customers beyond the leader, but the core analytical needs are met. These omissions are workable around.
Related MCP Connectors
Read-only analytics for all your apps: users, AI traffic, revenue, with the SQL behind every number.
Text-to-SQL for Claude & ChatGPT: OAuth sign-in, read-only Postgres/MySQL/SQL Server, free demo_shop
Cookieless web analytics an agent creates and queries: goals, funnels, revenue, SQL. Open source.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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.-
- FlicenseNot gradedqualityDmaintenanceEnables safe, read-only analysis of an online store's SQLite database, providing schema introspection, restricted SELECT queries, and specialized analytics tools through MCP.-
- FlicenseAqualityDmaintenanceEnables AI agents to safely interact with a SQLite shop database through schema discovery, read-only SQL queries, and pre-built analytics reports like top customers, top products, and revenue summaries.6-
- FlicenseAqualityDmaintenanceEnables AI agents to answer analytical questions about an online store's SQLite database through specialized read-only tools, without any risk of modifying the underlying data.8-