Chopin85/mcp-server-monmarche
If you are the rightful owner of mcp-server-monmarche 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 project is a Model Context Protocol (MCP) server for interacting with the Mon Marché French grocery store website.
Mon Marché MCP Server
A Model Context Protocol (MCP) server that connects LLMs to the Mon Marché French grocery store. This server enables AI assistants to search for products, manage a shopping cart, and interact with the Mon Marché platform.
Features
- Product Search: Find products by name.
- Cart Management:
- Add items to cart.
- View current cart contents.
- Clear the entire cart.
- Session Handling: Automated login and session persistence via cookies.
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- A valid Mon Marché account
Installation
-
Clone the repository:
git clone https://github.com/Chopin85/mcp-server-monmarche cd mcp-server-monmarche -
Install dependencies:
npm install -
Configure Environment: Copy the example environment file and add your credentials:
cp .env.example .envEdit
.envand fill in your details:MON_MARCHE_EMAIL=your-email@example.com MON_MARCHE_PASSWORD=your-password -
Build the project:
npm run build
Configuration & Authentication
Before using the MCP server or tools, you must authenticate to generate a session.
Run the login script:
npm run login
This command logs in using credentials from .env and saves the session cookies to session-cookie.json.
[!IMPORTANT] You must re-run
npm run loginif your session expires or if you deletesession-cookie.json.
Usage
Running the MCP Server
To start the server for use with an MCP client (like Claude Desktop or an IDE extension):
node dist/index.js
Testing with MCP Inspector
You can test the tools interactively using the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
CLI Tools
The project includes helper scripts to run tools directly from the command line for testing or automation:
- Search:
npm run searchProducts "pomme" - Add to Cart:
npm run addProduct -- --id <PRODUCT_ID> --quantity <QTY> - View Cart:
npm run getCartList - Clear Cart:
npm run clearCart
Available Tools
The server exposes the following tools to MCP clients:
searchProduct
Searches for products on Mon Marché.
- Input:
{ "query": { "name": "string" } } - Returns: List of matching products with IDs and details.
addProduct
Adds a specific product to the cart.
- Input:
{ "product": { "id": "string", "quantity": number } } - Returns: Confirmation of addition.
getCartList
Retrieves the current contents of the shopping cart.
- Input:
{}(No input required) - Returns: List of items in the cart.
clearCart
Removes all items from the shopping cart.
- Input:
{}(No input required) - Returns: Confirmation message.
Troubleshooting
- Login Failed: Ensure your email and password in
.envare correct. - Session Errors: If tools return authentication errors, run
npm run loginto refresh your session cookies. - Build Errors: Make sure all dependencies are installed with
npm install.
License
This project is licensed under the ISC License.