Skip to main content
Glama
by t2hnd
PROJECT_SUMMARY.md4.54 kB
# Bakery Data MCP Server - Project Summary ## What Was Built A complete MCP (Model Context Protocol) server that provides Claude and other MCP clients access to bakery POS data through a SQLite database. ## Project Structure ``` bakery_data_mcp/ ├── Data/ # Source CSV files │ ├── pos_journal_2023_2024.csv # 602,812 transactions │ ├── 商品マスタ.csv # 371 products │ ├── 商品マスタ_タグ拡張版.csv # 371 products with tags │ └── 部門マスタ.csv # 14 departments │ ├── src/bakery_data_mcp/ # MCP server package │ ├── __init__.py │ └── server.py # Main MCP server implementation │ ├── venv/ # Python virtual environment │ ├── bakery_data.db # SQLite database (46MB) ├── schema.sql # Database schema definition ├── import_data.py # CSV to SQLite import script ├── test_queries.py # Database test script ├── pyproject.toml # Python package configuration ├── README.md # Main documentation ├── SETUP_INSTRUCTIONS.md # Claude Desktop setup guide ├── mcp_config_example.json # Example MCP configuration └── .gitignore # Git ignore rules ``` ## Database Overview ### Statistics - **Total Transactions**: 602,812 - **Total Products**: 371 - **Departments**: 14 - **Date Range**: 2023-01-02 to 2024-12-31 - **Total Sales**: ¥112,907,632 ### Tables 1. **departments** - Department/category master data 2. **products** - Product catalog with pricing 3. **products_extended** - Products with category tags 4. **transactions** - Complete POS transaction history ## MCP Server Tools The server provides 7 powerful tools: 1. **query_transactions** - Filter and search transactions by date, product, payment method, amount 2. **query_products** - Search products by code, name, department, price, tags 3. **query_departments** - View department information 4. **sales_summary** - Aggregate sales by product, department, payment method, date, or month 5. **top_products** - Find best-selling products by quantity or revenue 6. **execute_sql** - Run custom SQL queries (advanced) 7. **get_schema** - View database structure and table information ## Key Features - **Full Japanese language support** - All text handled with UTF-8 encoding - **Tag-based filtering** - Search products by category tags (朝食向け, フルーツ系, etc.) - **Flexible date filtering** - Query by date ranges, months, or specific periods - **Performance optimized** - Database indexes on key columns - **Rich analytics** - Aggregation by multiple dimensions - **Safe SQL execution** - Parameterized queries to prevent injection ## Quick Start 1. **Import data**: `python import_data.py` (already done) 2. **Test database**: `python test_queries.py` 3. **Configure Claude Desktop**: See SETUP_INSTRUCTIONS.md 4. **Restart Claude Desktop** 5. **Start querying**: Ask Claude about your bakery data! ## Example Queries Once connected to Claude Desktop, you can ask: - "What were the top 5 products in August 2023?" - "Show monthly revenue trends for 2024" - "Which products are tagged as '朝食向け'?" - "What's the average transaction amount by payment method?" - "Compare sales between departments" - "Find all transactions for カットピザ in January 2024" ## Technologies Used - **Python 3.14** - Programming language - **SQLite3** - Database (built-in to Python) - **MCP SDK** - Model Context Protocol server framework - **Pydantic** - Data validation - **asyncio** - Asynchronous I/O ## What's Next To use this MCP server: 1. Follow the setup instructions in `SETUP_INSTRUCTIONS.md` 2. Add the configuration to Claude Desktop 3. Restart Claude Desktop 4. Start asking questions about your bakery data! The server will enable Claude to perform sophisticated data analysis, generate reports, identify trends, and answer complex questions about your bakery's sales performance. ## Notes - The database file (`bakery_data.db`) is excluded from git via `.gitignore` - Virtual environment (`venv/`) is also excluded - Original CSV data is preserved in the `Data/` directory - All queries are read-only by default for safety - The server uses stdio communication protocol for MCP

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/t2hnd/bakery_data_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server