nishantrajpoot719/MCP_Server_1_ite
If you are the rightful owner of MCP_Server_1_ite and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This is a Python Model Context Protocol (MCP) server designed to interact with a grocery simulation database.
MCP Server: Grocery Simulation
This is a Python Model Context Protocol (MCP) server exposing tools to interact with the grocery simulation database in Database/grocery_simulation.db.
Tools
list_products(query?, limit?, offset?, confirmation_token?): Lists available products with price/weight/unit. Confirmation required.get_user_info(user_id? | phone? | email?, confirmation_token?): Returns user profile and wallet balance. Confirmation required.get_order_history(user_id? | phone? | email?, start_date?, end_date?, limit?, offset?, confirmation_token?): Lists past orders with items. Confirmation required.place_order(items_json, user_id? | phone? | email?, confirmation_token?): Places an order with items like [{"name": "Milk", "quantity": 2}]. Confirmation required.cancel_order(user_id? | phone? | email?, order_id? | order_date? | products_json?, confirmation_token?): Cancels a not-delivered order. Confirmation required.confirm(token, proceed=true): Second step to approve or cancel a pending action.
Confirmation Flow
All tools (including reads) are protected by a confirmation layer. First call returns a Token and a human-readable Summary. To proceed, call confirm with the token (or cancel). Upon confirmation, the server executes the stored action.
Setup
- Ensure the SQLite DB exists at
Database/grocery_simulation.db. You can regenerate it by runningDatabase/databaseCreation.py. - Use Python 3.11+.
- Install dependencies:
- Activate your virtualenv if desired.
pip install -r server/requirements.txt
Run (stdio)
python server/mcp_server.py
Connect from ChatGPT (MCP)
- In ChatGPT, add a Model Context Protocol (MCP) server pointing to the command:
pythonwith argsserver/mcp_server.py(or the absolute path). The app will use stdio to communicate.
Notes
- Product names must match entries in
Productstable exactly for ordering/cancellation by product name. - Cancellation is allowed only for orders where
Status != 'Delivered'. Refund is recorded inWalletas a positiveRECHARGElinked to the order. - Wallet balance is computed as the sum of all wallet transactions for the user.