Bakery Data MCP Server
Provides access to bakery POS transaction data, product catalogs, and sales analytics from SQLite database through natural language queries and custom SQL execution.
README
Bakery Data MCP Server
An MCP (Model Context Protocol) server that provides access to bakery POS (Point of Sale) data stored in SQLite. This server enables Claude and other MCP clients to query transaction data, product information, and generate sales analytics.
Overview
This project imports bakery sales data from CSV files into a SQLite database and exposes it through an MCP server with powerful querying capabilities.
Data Sources
- POS Transaction Journal (
pos_journal_2023_2024.csv): Sales transactions from 2023-2024 - Product Master (
商品マスタ.csv): Product catalog with pricing and cost data - Product Master Extended (
商品マスタ_タグ拡張版.csv): Product catalog with category tags - Department Master (
部門マスタ.csv): Department/category definitions
Setup
1. Install Dependencies
pip install mcp
Or install in development mode:
pip install -e .
2. Import Data into SQLite
Run the import script to create the database and load CSV data:
python import_data.py
This will:
- Create
bakery_data.dbSQLite database - Import all CSV files from the
Datadirectory - Create indexes for better query performance
- Display database statistics
3. Configure MCP Server
Add the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bakery-data": {
"command": "python",
"args": [
"-m",
"bakery_data_mcp.server"
],
"cwd": "/absolute/path/to/bakery_data_mcp"
}
}
}
Replace /absolute/path/to/bakery_data_mcp with the actual path to this project directory.
4. Restart Claude Desktop
Restart Claude Desktop to load the new MCP server configuration.
Available Tools
The MCP server provides the following tools:
1. query_transactions
Query POS transaction data with various filters.
Parameters:
start_date(optional): Start date (YYYY-MM-DD)end_date(optional): End date (YYYY-MM-DD)product_code(optional): Filter by product codeproduct_name(optional): Search product name (partial match)payment_method(optional): Filter by payment methodmin_amount/max_amount(optional): Amount range filterlimit(optional): Max results (default: 100)
2. query_products
Query product master data.
Parameters:
plu_code(optional): Product PLU codeproduct_name(optional): Search product name (partial match)department_id(optional): Filter by departmentmin_price/max_price(optional): Price range filtertag(optional): Filter by product taginclude_tags(optional): Include tag data in resultslimit(optional): Max results (default: 100)
3. query_departments
Query department master data.
Parameters:
department_id(optional): Department IDdepartment_name(optional): Search department name (partial match)
4. sales_summary
Get aggregated sales statistics.
Parameters:
start_date/end_date(optional): Date rangegroup_by(optional): Group byproduct,department,payment_method,date, ormonthdepartment_id(optional): Filter by departmentlimit(optional): Max results (default: 100)
5. top_products
Get top selling products.
Parameters:
start_date/end_date(optional): Date rangedepartment_id(optional): Filter by departmentmetric(optional): Rank byquantityorrevenue(default: revenue)limit(optional): Number of top products (default: 10)
6. execute_sql
Execute custom SQL queries on the database.
Parameters:
query: SQL query to executeparams(optional): Query parameters for parameterized queries
⚠️ Use with caution: This allows arbitrary SQL execution. Use read-only queries when possible.
7. get_schema
Get database schema information including table structures and row counts.
Example Usage
Once configured, you can ask Claude questions like:
- "What were the top 10 selling products in January 2024?"
- "Show me all transactions paid with credit card over ¥1000"
- "What's the total revenue by department for 2023?"
- "Find all products tagged with '朝食向け' (breakfast)"
- "What are the sales trends by month?"
Database Schema
Tables
-
departments: Department master data
department_id(PRIMARY KEY)department_name
-
products: Product master data
plu_code(PRIMARY KEY)department_id(FOREIGN KEY)product_namepricecostcost_rate
-
products_extended: Product master with tags
- Same as
productsplus: tags(JSON array as text)
- Same as
-
transactions: POS transaction journal
id(PRIMARY KEY, auto-increment)transaction_numberdatetimeproduct_codeproduct_nameunit_pricequantityamountpayment_method
Development
Project Structure
bakery_data_mcp/
├── Data/ # CSV data files
├── src/
│ └── bakery_data_mcp/
│ ├── __init__.py
│ └── server.py # MCP server implementation
├── schema.sql # Database schema
├── import_data.py # Data import script
├── pyproject.toml # Project configuration
├── bakery_data.db # SQLite database (generated)
└── README.md
Running the Server
For testing, you can run the server directly:
python -m bakery_data_mcp.server
The server communicates via stdio and expects MCP protocol messages.
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。