Bakery Data MCP Server
Provides access to bakery POS (Point of Sale) data stored in SQLite, enabling queries of transaction data, product information, sales analytics, and custom SQL execution against the database.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bakery Data MCP Server show me the top 5 selling products from last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-2024Product Master (
商品マスタ.csv): Product catalog with pricing and cost dataProduct Master Extended (
商品マスタ_タグ拡張版.csv): Product catalog with category tagsDepartment Master (
部門マスタ.csv): Department/category definitions
Related MCP server: sales-agent-mcp
Setup
1. Install Dependencies
pip install mcpOr 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.pyThis will:
Create
bakery_data.dbSQLite databaseImport all CSV files from the
DatadirectoryCreate 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)
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.mdRunning the Server
For testing, you can run the server directly:
python -m bakery_data_mcp.serverThe server communicates via stdio and expects MCP protocol messages.
License
MIT License
Available Tools
7 toolsexecute_sqlA
Execute a custom SQL query on the database. Use with caution. Read-only queries recommended.
Inputs: query (required), params.
get_schemaB
Get the database schema information including table structures and column definitions.
Inputs: no named parameters.
query_departmentsB
Query department master data. Returns all departments or filter by ID/name.
Inputs: department_id, department_name.
query_productsB
Query product master data. Search by product code, name, department, price range, or tags.
Inputs: plu_code, product_name, department_id, min_price, +4 more.
query_transactionsC
Query POS transaction data. Supports filtering by date range, product code/name, payment method, and amount range. Returns transaction details.
Inputs: start_date, end_date, product_code, product_name, +4 more.
sales_summaryC
Get sales summary statistics. Aggregate sales data by date range, product, department, or payment method.
Inputs: start_date, end_date, group_by, department_id, +1 more.
top_productsC
Get top selling products by quantity or revenue. Supports filtering by date range and department.
Inputs: start_date, end_date, department_id, metric, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes, with execute_sql for custom queries, get_schema for metadata, and specific query tools for different data types (departments, products, transactions). However, sales_summary and top_products could potentially overlap in functionality, as both provide aggregated sales insights, which might cause minor confusion in tool selection.
The naming follows a consistent verb_noun pattern throughout, such as execute_sql, get_schema, query_departments, query_products, query_transactions, sales_summary, and top_products. There is a minor deviation with sales_summary and top_products using a noun-based naming style instead of a verb prefix, but overall the pattern is predictable and readable.
With 7 tools, the count is well-scoped for a bakery data server, covering essential operations like custom queries, schema inspection, data querying, and analytics. Each tool earns its place without feeling excessive or insufficient, aligning well with the server's purpose of data management and analysis.
The tool set provides comprehensive coverage for querying and analyzing bakery data, including schema access, master data queries, transaction details, and sales analytics. A minor gap exists in the lack of data modification tools (e.g., update or insert operations), but this is reasonable given the read-only nature implied by descriptions, and agents can work around this for most analytical workflows.
Maintenance
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Ask questions in plain language, get answers from your business database. No SQL required.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Ask plain-English questions of your database: answers, the SQL that ran, and the rows.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with SQLite databases through natural language, supporting SQL queries, CSV imports, and schema exploration.-
- FlicenseNot gradedqualityDmaintenanceEnables natural language sales analysis by connecting to a SQLite database, generating charts, and exporting results to CSV/Excel.-
- 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-
- AlicenseAqualityDmaintenanceEnables natural-language querying and analysis of an e-commerce SQLite database via MCP, with read-only SQL execution, table inspection, and AI-generated answers.4MIT