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 henry@mcphub.com.
This project is a Model Context Protocol (MCP) server for interacting with the Mon Marché French grocery store website.
My MCP Server
This project is a Model Context Protocol (MCP) server for interacting with the Mon Marché french grocery store website. It provides tools to search for products and add them to a cart using a command-line interface.
Features
- Search Products: Search for products by name on the Mon Marché website.
- Add Products to Cart: Add products to your cart by specifying their name.
- Check Cart: Check the products on your cart.
- Clear Cart: Remove all products from your cart.
- Session Management: Automatically logs in and manages session cookies for interacting with the website.
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- A Mon Marché account with valid credentials
Installation
-
Clone the repository:
git clone https://github.com/Chopin85/mcp-server-monmarche cd mcp-server-monmarche -
Install dependencies:
npm install -
Create a
.envfile based on the.env.examplefile:cp .env.example .envFill in your Mon Marché credentials:
MON_MARCHE_EMAIL=your-email@example.com MON_MARCHE_PASSWORD=your-password -
Build the project:
npm run build
Usage
Build
Before using the tools, you need build:
npm run build
Login Session
Before using the tools, you need to log in to Mon Marché:
npm run login
This will save the session cookies to session-cookie.json.
Start the Server
Run the server:
node dist/index.js
The server will start and listen for requests via the standard input/output (stdio) transport.
Tools
Search Products
Use the searchProduct tool to search for products by name:
{
"name": "searchProduct",
"query": {
"name": "pomme"
}
}
Add Products to Cart
Use the addProduct tool to add a product to your cart:
{
"name": "addProduct",
"arguments": {
"product": {
"id": "VwsP7FRQ7",
"quantity": 6
}
}
}
Commands
You can also run commands directly thefrom CLI:
- Login:
npm run login - SearchProducts:
npm run searchProducts pomme - AddProduct:
npm run addProduct -- --id VwsP7FRQ7 --quantity 6 - GetCartList:
npm run getCartList - CleartCart:
npm run clearCart
Project Structure
- index.ts: Main server implementation.
- monmarche.ts: Utility functions for interacting with the Mon Marché website.
- .env.example: Example environment variables file.
- tsconfig.json: TypeScript configuration.
- package.json: Project metadata and scripts.
Development
Build
To compile the TypeScript code:
npm run build
Run in Test Mode
You can run the server directly using @modelcontextprotocol/inspector:
npx @modelcontextprotocol/inspector node dist/index.js
Debugging
HEADLESS=false npx @modelcontextprotocol/inspector node dist/index.js
Known Issues
- Ensure you have valid Mon Marché credentials in the .env file.
- The session-cookie.json file must exist for the tools to work.
License
This project is licensed under the ISC License.