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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.