About My MCP Server
My MCP Server connects LLMs to the Mon Marché grocery platform, allowing product searches and shopping cart operations. It handles login sessions through saved cookies or an explicit session token, and includes command-line helpers.
Key features
- 01Search Mon Marché products
- 02Add products to a cart
- 03View cart contents
- 04Clear the cart
- 05Persist login sessions with cookies
Use cases
- 01Finding grocery products by name
- 02Adding selected items to a shopping cart
- 03Checking or clearing a cart from scripts
MCP support
The MCP server exposes tools for product search, adding products, viewing the cart, and clearing it. Tools use saved session cookies by default or can receive an explicit session token.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMon 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. Supports explicit
--sessionflag for scripted/headless use.
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:[email protected] 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.
All commands support an optional --session flag to use an explicit session token instead of session-cookie.json:
node dist/utils/cli.js <command> [args...] [--session <token>]
- 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
Using --session (explicit token)
Pass a session token directly to skip the session-cookie.json file:
# Direct node usage
node dist/utils/cli.js searchProducts "pasta" --session "abc123"
node dist/utils/cli.js getCartList --session "abc123"
node dist/utils/cli.js addProduct --id "123" --quantity 2 --session "abc123"
node dist/utils/cli.js clearCart --session "abc123"
# Via npm scripts (with -- separator)
npm run searchProducts -- "pasta" --session "abc123"
npm run getCartList -- --session "abc123"
npm run addProduct -- --id "123" --quantity 2 --session "abc123"
npm run clearCart -- --session "abc123"
Note
When
--sessionis provided, thesession-cookie.jsonfile is ignored for that call.
Available Tools
The server exposes the following tools to MCP clients:
searchProduct
Searches for products on Mon Marché.
- Input:
{ "name": "string", "session?": "string" } - Returns: List of matching products with IDs and details.
addProduct
Adds a specific product to the cart.
- Input:
{ "id": "string", "quantity": number, "session?": "string" } - Returns: Confirmation of addition.
getCartList
Retrieves the current contents of the shopping cart.
- Input:
{ "session?": "string" } - Returns: List of items in the cart.
clearCart
Removes all items from the shopping cart.
- Input:
{ "session?": "string" } - Returns: Confirmation message.
Note
All tools accept an optional
sessionparameter. If omitted, the session is read fromsession-cookie.json.
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, or pass a valid token via--session. - Build Errors: Make sure all dependencies are installed with
npm install.
License
This project is licensed under the ISC License.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.