shop-db MCP Server
shop-db MCP 서버
AI 에이전트에게 전자상거래 SQLite 데이터베이스(customers, orders, order_items, products)에 대한 분석적 접근 권한을 제공하는 읽기 전용 Model Context Protocol 서버입니다. 데이터를 수정할 수 있는 기능은 전혀 없습니다.
**Node.js v24.19+**용으로 제작되었으며, 네이티브 node:sqlite와 node:test를 사용하여 TypeScript 소스 파일을 직접 실행합니다(빌드 단계 없음).
설정
npm install저장소에는 이미 채워진 ./shop.db가 프로젝트 루트에 포함되어 있어 시딩(seeding) 단계가 필요 없습니다. npm start나 npm test에서 이 파일에 쓰는 작업은 없습니다. 서버는 읽기 전용으로 열며, 테스트 스위트는 tests/fixtures/seed.sql에서 자체 임시 데이터베이스를 tests/ 아래에 생성합니다.
Related MCP server: Read-Only SQLite Shop Database MCP Server
서버 실행
npm start서버는 stdio(StdioServerTransport)를 통해 통신합니다. 즉, MCP 클라이언트(Claude Code, Claude Desktop 등)에 의해 실행되도록 설계되었으며, 대화형으로 실행되는 것이 아닙니다.
테스트
npm testtests/에 대해 node --test를 실행하며, SQL 검증 엣지 케이스(변형 키워드, 주석 우회, 다중 문장 주입, CTE, EXPLAIN)와 세 가지 MCP 도구를 tests/fixtures/seed.sql에서 생성된 격리된 테스트 데이터베이스에 대해 엔드투엔드로 테스트합니다. 커밋된 ./shop.db는 테스트 스위트에서 읽거나 쓰지 않습니다.
데이터베이스 경로 구성
기본적으로 서버는 (실행된 작업 디렉터리를 기준으로) ./shop.db를 읽습니다. DB_PATH 환경 변수로 재정의할 수 있습니다:
DB_PATH=/absolute/path/to/shop.db npm start도구
list_tables— 4개의 테이블을 각각의 간단한 설명과 함께 나열합니다.describe_table— 하나의 테이블(tableName) 또는 모든 테이블(생략 시)에 대해 열 정의, 유형, 기본 키, 최대 3개의 샘플 행을 제공합니다.read_query— 읽기 전용SELECT/WITH/EXPLAIN/PRAGMA쿼리(query, 필수)를 실행하고 최대limit개의 행(선택 사항, 기본값 100, 최대 1000)을 반환합니다. 모든 변형 시도(INSERT,UPDATE,DELETE,DROP, ...)는 SQL 주석으로 위장하거나 CTE로 감싸더라도 명확한 오류와 함께 거부됩니다.
AI 에이전트 구성
{
"mcpServers": {
"shop-db": {
"command": "node",
"args": ["/absolute/path/to/src/index.ts"],
"env": {
"DB_PATH": "/absolute/path/to/shop.db"
}
}
}
}프로젝트 문서
AGENTS.md— 이 저장소에서 작업하는 AI 코딩 에이전트를 위한 지침(심볼릭 링크를 통해CLAUDE.md로도 로드됨).CONTEXT.md— 도메인 모델 및 안전 아키텍처.
Available Tools
3 toolsdescribe_tableA
Get column definitions, data types, primary keys, and sample rows for one or all tables in the database.
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | No | Table name to inspect. Omit to describe all tables. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does reveal what the tool returns (columns, types, PKs, sample rows) and the 'all tables' option, but it does not state read-only semantics, potential performance implications of sample rows, or any limitations. This is adequate but not rich in behavioral detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, tightly worded sentence that leads with the action and resource, then lists the specific details returned. No filler or redundancy — every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one optional parameter, no output schema, and clear siblings, the description covers the essential information: what it does, what it returns, and the 'one or all' scope. It could mention read-only nature or output format, but given the simplicity, it is nearly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the schema already documents tableName with the exact 'Omit to describe all tables' guidance. The tool description adds no new parameter insight beyond restating this behavior, so it meets the baseline for full schema coverage without adding value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Get') and lists concrete resources: column definitions, data types, primary keys, and sample rows. It clearly distinguishes from siblings: list_tables (just table names) and read_query (arbitrary SQL). An agent immediately understands this is for schema introspection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states when to use the tool (when you need table structure and sample data) and covers both single and all-table cases via the 'one or all tables' phrasing. It does not explicitly say 'use list_tables for just names' or 'read_query for custom queries', but the purpose is clear enough that an agent can infer the right context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tablesA
List all available tables in the e-commerce database.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action (listing tables) without mentioning side effects, permissions, read-only guarantees, or any operational constraints. The read-only nature is implicit in 'list' but not explicitly disclosed, and no additional context (e.g., authentication, response format) is given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no extraneous words. It efficiently conveys the tool's purpose without redundancy, earning the highest score for conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with no parameters and no output schema, the description is mostly complete. It states the scope ('e-commerce database') and the action. However, it does not explicitly describe the return format (e.g., a list of table names, metadata, or schema), which an agent might need to know. Since no output schema exists, the description could have mentioned this, but it is a minor gap for such a straightforward operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and schema coverage is 100% (vacuously). Per the rubric, the baseline is 4 for zero-parameter tools. The description adds no parameter semantics, which is acceptable because there are no parameters to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and resource ('all available tables in the e-commerce database'), clearly distinguishing the tool's purpose from siblings like describe_table (schema details) and read_query (data queries). It states exactly what the tool does with no ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies that the tool is for discovering available tables but provides no explicit guidance on when to use it versus the sibling tools. No exclusions or alternatives are mentioned, leaving the agent to infer from the action verb. This is adequate but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_queryA
Execute a read-only SQL query against the database. Use this tool for analytical aggregations, joins, filtering, CTEs, and reporting.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows to return (default 100, max 1000). | |
| query | Yes | The SQL SELECT or WITH query to execute. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states 'read-only', which is a key behavioral trait indicating the tool will not modify data. This is a strong statement about side effects. It does not mention error handling, transaction behavior, or performance, but for a read-only query tool, the core behavior is well covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no fluff. The primary purpose is stated first, followed by specific use cases. Every word contributes to clarifying the tool's role. It is appropriately sized for the tool's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (2 params, no output schema, no nested objects) and no annotations, the description provides the essential information: what it does and when to use it. The schema covers parameter details. While it could mention output format or restrictions, these are either implicit (SQL query returns rows) or already in the schema (SELECT/WITH). It is complete enough for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, as both parameters (query and limit) have descriptive text in the schema. The tool description adds no additional parameter-level meaning beyond reinforcing the 'read-only' nature and usage cases. Since the schema already documents the parameters, a baseline of 3 is appropriate; the description does not need to compensate further.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb-resource pair ('Execute a read-only SQL query against the database') and explicitly lists use cases (analytical aggregations, joins, filtering, CTEs, reporting). It distinguishes itself from siblings list_tables and describe_table, which are clearly metadata-focused, so an agent can readily differentiate it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage context by stating 'Use this tool for analytical aggregations, joins, filtering, CTEs, and reporting.' This tells the agent when to apply it. However, it does not explicitly mention alternatives or state 'when not to use' it, though the sibling tool names imply the distinction. This is clear but lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
describe_table - First observed
list_tables - First observed
read_query
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: listing tables, describing schema, and running queries. There is no overlap or ambiguity, so an agent can easily select the right tool for each operation.
All tool names follow a consistent snake_case verb_noun pattern (list_tables, describe_table, read_query). The naming is predictable and adheres to a single convention throughout.
With only 3 tools, the set is slightly minimal but well-scoped for a read-only database introspection server. Each tool serves a necessary function, and the count is reasonable for the apparent purpose.
The tool surface fully covers the core operations needed for read-only database access: enumerating tables, inspecting schemas, and executing arbitrary queries. No critical gaps are evident for the intended domain.
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables 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.6145 npmMIT
- FlicenseAqualityCmaintenanceEnables AI agents to safely inspect and query an SQLite e-commerce database with tools for listing tables, describing schemas, and running read-only SQL queries while blocking destructive operations.4-
- FlicenseAqualityCmaintenanceEnables AI agents to read-only query an online store's SQLite database, listing tables, inspecting schemas, and running SELECT queries over customers, products, orders, and order items.3-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to read-only analyze a SQLite e-commerce database, exploring schema and running analytical SQL queries over stdio.-