continentept-mcp 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/README.md +18 -2
- package/dist/application.d.ts +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/mcp/guide.d.ts +5 -0
- package/dist/mcp/guide.js +67 -0
- package/dist/mcp/server.d.ts +13 -1
- package/dist/mcp/server.js +10 -1
- package/dist/runtime.js +2 -0
- package/docs/configuration.md +43 -0
- package/docs/tools.md +14 -2
- package/package.json +1 -1
- package/skills/basket-planner/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,19 @@ All notable changes to this project are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
## [0.
|
|
9
|
+
## [0.2.0] - 2026-10-15
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Server instructions: assistants receive the cart rules (exact totals, one change at a time, check the cart after an uncertain change) as soon as they connect.
|
|
14
|
+
- A `basket-planner` prompt with the full shopping workflow, with an optional request to plan for. No skill install is needed.
|
|
15
|
+
- Documentation for supplying credentials from 1Password with `op run`.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- The `basket-planner` skill links to the online tool reference, so it also works when uploaded on its own.
|
|
20
|
+
|
|
21
|
+
## [0.1.0] - 2026-10-15
|
|
10
22
|
|
|
11
23
|
### Added
|
|
12
24
|
|
|
@@ -16,5 +28,6 @@ All notable changes to this project are documented here. The format follows
|
|
|
16
28
|
- Automatic sign-in from environment variables or a private credentials file, and a `login` command.
|
|
17
29
|
- The `basket-planner` skill for planning a shopping list and updating the basket.
|
|
18
30
|
|
|
19
|
-
[Unreleased]: https://github.com/andredelgado/continente-mcp/compare/v0.
|
|
31
|
+
[Unreleased]: https://github.com/andredelgado/continente-mcp/compare/v0.2.0...HEAD
|
|
32
|
+
[0.2.0]: https://github.com/andredelgado/continente-mcp/compare/v0.1.0...v0.2.0
|
|
20
33
|
[0.1.0]: https://github.com/andredelgado/continente-mcp/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -23,8 +23,9 @@ on the website.
|
|
|
23
23
|
of retrying.
|
|
24
24
|
- **Your account**: favorites, order history and a ranking of the products you buy most.
|
|
25
25
|
- **Runs locally** over stdio. Credentials and cookies stay on your machine.
|
|
26
|
-
- **
|
|
27
|
-
|
|
26
|
+
- **Built-in guidance.** The server tells the assistant the cart rules as soon as it
|
|
27
|
+
connects, and offers a `basket-planner` prompt with the full shopping workflow. Nothing
|
|
28
|
+
extra to install; the same guide also ships as a [skill](skills/basket-planner/SKILL.md).
|
|
28
29
|
|
|
29
30
|
## Requirements
|
|
30
31
|
|
|
@@ -50,6 +51,9 @@ printf 'CONTINENTE_EMAIL=you@example.com\nCONTINENTE_PASSWORD=your-password\n' >
|
|
|
50
51
|
chmod 600 ~/.continentept-mcp/credentials.env
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
Using 1Password? Skip the file and pass secret references through `op run` instead; see
|
|
55
|
+
[Using 1Password](docs/configuration.md#using-1password).
|
|
56
|
+
|
|
53
57
|
Optionally check that login works:
|
|
54
58
|
|
|
55
59
|
```sh
|
|
@@ -108,6 +112,18 @@ In that case the result has `mutation.outcome: "unknown"` and asks the client to
|
|
|
108
112
|
`get_cart` before doing anything else. The server never retries such a change on its own,
|
|
109
113
|
and clients should not either: repeating an `add_cart_item` could add the item twice.
|
|
110
114
|
|
|
115
|
+
### Guidance for the assistant
|
|
116
|
+
|
|
117
|
+
When a client connects, the server sends short instructions with these cart rules, so the
|
|
118
|
+
assistant follows them without any setup. For planning a shopping list, pick the
|
|
119
|
+
**basket-planner** prompt from your client's prompt or attachment menu, optionally with a
|
|
120
|
+
request such as "weekly basket for two".
|
|
121
|
+
|
|
122
|
+
The same guide is available as a skill in
|
|
123
|
+
[`skills/basket-planner`](skills/basket-planner/SKILL.md). Clients that support skills, such
|
|
124
|
+
as Claude Desktop (Settings → Capabilities → Skills) or Claude Code (`~/.claude/skills/`),
|
|
125
|
+
then apply it automatically whenever you ask about groceries.
|
|
126
|
+
|
|
111
127
|
## Command line
|
|
112
128
|
|
|
113
129
|
```text
|
package/dist/application.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ContinenteMcpServer } from './mcp/server.js';
|
|
2
|
-
import type { ToolHandler } from './mcp/server.js';
|
|
2
|
+
import type { PromptHandler, ToolHandler } from './mcp/server.js';
|
|
3
3
|
export interface ApplicationOptions {
|
|
4
4
|
readonly version: string;
|
|
5
5
|
readonly tools?: readonly ToolHandler[];
|
|
6
|
+
readonly prompts?: readonly PromptHandler[];
|
|
7
|
+
readonly instructions?: string;
|
|
6
8
|
readonly closeResources?: () => Promise<void>;
|
|
7
9
|
readonly requestTimeoutMs?: number;
|
|
8
10
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { createApplication } from './application.js';
|
|
2
2
|
export type { ApplicationOptions } from './application.js';
|
|
3
3
|
export { ContinenteMcpServer } from './mcp/server.js';
|
|
4
|
-
export type { McpServerOptions, ToolHandler } from './mcp/server.js';
|
|
4
|
+
export type { McpServerOptions, PromptHandler, ToolHandler } from './mcp/server.js';
|
|
5
|
+
export { BASKET_PLANNER_GUIDE, SERVER_INSTRUCTIONS, basketPlannerPrompt } from './mcp/guide.js';
|
|
5
6
|
export * from './domain/index.js';
|
|
6
7
|
export { createShoppingApplication, createShoppingServices } from './runtime.js';
|
|
7
8
|
export type { RuntimeOptions } from './runtime.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createApplication } from './application.js';
|
|
2
2
|
export { ContinenteMcpServer } from './mcp/server.js';
|
|
3
|
+
export { BASKET_PLANNER_GUIDE, SERVER_INSTRUCTIONS, basketPlannerPrompt } from './mcp/guide.js';
|
|
3
4
|
export * from './domain/index.js';
|
|
4
5
|
export { createShoppingApplication, createShoppingServices } from './runtime.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PromptHandler } from './server.js';
|
|
2
|
+
export declare const BASKET_PLANNER_GUIDE = "# Basket planner\n\nTurn the user's shopping intent into a product list or a verified basket using the **continentept-mcp** tools. A request for a plan authorizes research only; a request to add, remove or set items authorizes those basket changes. Keep the user's existing choices and constraints. Ask only about choices that change the result, such as an unspecified substitute or whether a quantity means \"more\" or \"in total\".\n\n## Choose products and quantities\n\n1. Use `search_products` with `query` (and `limit` when useful). Treat results as candidates: match size, brand, dietary constraints and intended use before choosing. Keep `productId` as a string, including leading zeros.\n2. Use `get_product` when price, availability or sale rules matter. Quantities are in the returned sale unit. Respect minimum, maximum and step; never assume a weighted product is sold by the kilogram and never silently round a requested amount.\n3. Before changing the basket, read `get_cart` for current quantities and line identities. If several lines share a product ID, use the intended line's `cartItemId`, or ask the user which line they mean.\n4. Show unresolved choices. Missing prices, availability, quantities or sale rules stay unknown. Money is EUR in integer `minorUnits` (129 means \u20AC1.29). Keep product prices, basket totals and estimated list costs distinct.\n\nSearches read a bounded number of result pages; respect `completeness` and `failures` and do not claim a search was exhaustive.\n\n## Change the basket\n\n- `set_cart_item_quantity({ productId, quantity, cartItemId? })` makes the basket hold exactly `quantity`, adding the product if needed. Zero removes it. Prefer this whenever the user states a desired total; repeating it is safe.\n- `add_cart_item({ productId, quantity, cartItemId? })` adds `quantity` on top of what is already there (default one sale unit). Use it only for \"add more\".\n- `remove_cart_item({ productId, cartItemId? })` removes a line. An already absent item is confirmed without a write.\n\nIf the basket holds two units, \"add two more\" is `add_cart_item` with 2, while \"I need two\" is `set_cart_item_quantity` with 2 (which changes nothing). Process a list one item at a time and read each result before continuing. There is no batch, checkout or payment tool; checkout happens on the website.\n\n## Read outcomes before reporting success\n\nRead `structuredContent.result` rather than inferring success from prose.\n\n- `status: success`, `empty` or `partial` carries `data`. Report partial-result warnings and unavailable data.\n- A confirmed change has `data.outcome: \"confirmed\"` and `confirmedQuantity`, the quantity now in the basket. Report that observed quantity.\n- `status: error` carries `error`. For basket changes also read `mutation`: `not_applied` means nothing was submitted or the change was rejected; fix the reported cause before trying again.\n- `mutation.outcome: \"unknown\"` means the change may have happened. Stop dependent basket changes, call `get_cart`, and compare with the state before the change. Never repeat the original request just because the response was lost. If the basket state cannot settle the intent, explain the uncertainty and ask the user.\n\nA timeout, cancellation or lost connection during a change is not evidence that the basket stayed the same. Apply the same reconciliation when no structured result arrives.\n\n## Use account context when it helps\n\nFor \"my usual items\", `list_favorites` and `list_frequently_bought_products` can inform a proposed list. Past purchases are evidence, not permission to buy them again.\n\n`list_favorites` returns a local snapshot with `source` and `freshness`; pass `refresh: true` when the user wants the current website list or the snapshot is stale. An empty list is a valid result, and a failed refresh does not mean favorites disappeared.\n\n`list_orders` supports `limit`, `includeLines`, `detailLimit` and `cursor` (the returned `nextCursor`). Use the internal `orderId` with `get_order`, not the displayed order number. `list_frequently_bought_products` has separate `orderLimit` and `limit`; its scan counts and failures show how representative the ranking is. Never add quantities expressed in different units.\n\n`get_session_status` reports local state only; it does not verify that the login still works. Do not include credentials or account details in summaries.\n\nFinish with the chosen or changed items, confirmed quantities and units, and any unresolved choices or failures. Keep planned items separate from changes the server confirmed.\n\nFor exact schemas and limits, see the [tool reference](https://github.com/andredelgado/continente-mcp/blob/main/docs/tools.md).";
|
|
3
|
+
/** Sent to every client on connect; the essential rules for working with the cart safely. */
|
|
4
|
+
export declare const SERVER_INSTRUCTIONS = "Continente MCP shops at Continente.pt for one account. Checkout and payment always happen on the website.\n\n- Quantities are in the product's sale unit. Call get_product before choosing a quantity for weighted or bulk products, and respect its minimum, maximum and step.\n- set_cart_item_quantity sets an exact total (adding the product if needed; 0 removes it). add_cart_item adds on top of what is already there. When the user says how many they need, use set_cart_item_quantity.\n- Change the cart one item at a time and read structuredContent.result before reporting success. confirmedQuantity is what the cart now holds.\n- If a cart change returns mutation.outcome \"unknown\", the cart may have changed. Call get_cart and decide from its contents. Never repeat the change automatically.\n- Money is EUR in integer minorUnits (129 means \u20AC1.29). Missing prices, quantities or completeness stay unknown; do not guess them.\n- For planning a shopping list or basket, use the basket-planner prompt for the full workflow.";
|
|
5
|
+
export declare const basketPlannerPrompt: PromptHandler;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// The basket-planner guide, served as the `basket-planner` prompt. Keep it identical to the body of
|
|
2
|
+
// skills/basket-planner/SKILL.md; a test fails when they differ.
|
|
3
|
+
export const BASKET_PLANNER_GUIDE = `# Basket planner
|
|
4
|
+
|
|
5
|
+
Turn the user's shopping intent into a product list or a verified basket using the **continentept-mcp** tools. A request for a plan authorizes research only; a request to add, remove or set items authorizes those basket changes. Keep the user's existing choices and constraints. Ask only about choices that change the result, such as an unspecified substitute or whether a quantity means "more" or "in total".
|
|
6
|
+
|
|
7
|
+
## Choose products and quantities
|
|
8
|
+
|
|
9
|
+
1. Use \`search_products\` with \`query\` (and \`limit\` when useful). Treat results as candidates: match size, brand, dietary constraints and intended use before choosing. Keep \`productId\` as a string, including leading zeros.
|
|
10
|
+
2. Use \`get_product\` when price, availability or sale rules matter. Quantities are in the returned sale unit. Respect minimum, maximum and step; never assume a weighted product is sold by the kilogram and never silently round a requested amount.
|
|
11
|
+
3. Before changing the basket, read \`get_cart\` for current quantities and line identities. If several lines share a product ID, use the intended line's \`cartItemId\`, or ask the user which line they mean.
|
|
12
|
+
4. Show unresolved choices. Missing prices, availability, quantities or sale rules stay unknown. Money is EUR in integer \`minorUnits\` (129 means €1.29). Keep product prices, basket totals and estimated list costs distinct.
|
|
13
|
+
|
|
14
|
+
Searches read a bounded number of result pages; respect \`completeness\` and \`failures\` and do not claim a search was exhaustive.
|
|
15
|
+
|
|
16
|
+
## Change the basket
|
|
17
|
+
|
|
18
|
+
- \`set_cart_item_quantity({ productId, quantity, cartItemId? })\` makes the basket hold exactly \`quantity\`, adding the product if needed. Zero removes it. Prefer this whenever the user states a desired total; repeating it is safe.
|
|
19
|
+
- \`add_cart_item({ productId, quantity, cartItemId? })\` adds \`quantity\` on top of what is already there (default one sale unit). Use it only for "add more".
|
|
20
|
+
- \`remove_cart_item({ productId, cartItemId? })\` removes a line. An already absent item is confirmed without a write.
|
|
21
|
+
|
|
22
|
+
If the basket holds two units, "add two more" is \`add_cart_item\` with 2, while "I need two" is \`set_cart_item_quantity\` with 2 (which changes nothing). Process a list one item at a time and read each result before continuing. There is no batch, checkout or payment tool; checkout happens on the website.
|
|
23
|
+
|
|
24
|
+
## Read outcomes before reporting success
|
|
25
|
+
|
|
26
|
+
Read \`structuredContent.result\` rather than inferring success from prose.
|
|
27
|
+
|
|
28
|
+
- \`status: success\`, \`empty\` or \`partial\` carries \`data\`. Report partial-result warnings and unavailable data.
|
|
29
|
+
- A confirmed change has \`data.outcome: "confirmed"\` and \`confirmedQuantity\`, the quantity now in the basket. Report that observed quantity.
|
|
30
|
+
- \`status: error\` carries \`error\`. For basket changes also read \`mutation\`: \`not_applied\` means nothing was submitted or the change was rejected; fix the reported cause before trying again.
|
|
31
|
+
- \`mutation.outcome: "unknown"\` means the change may have happened. Stop dependent basket changes, call \`get_cart\`, and compare with the state before the change. Never repeat the original request just because the response was lost. If the basket state cannot settle the intent, explain the uncertainty and ask the user.
|
|
32
|
+
|
|
33
|
+
A timeout, cancellation or lost connection during a change is not evidence that the basket stayed the same. Apply the same reconciliation when no structured result arrives.
|
|
34
|
+
|
|
35
|
+
## Use account context when it helps
|
|
36
|
+
|
|
37
|
+
For "my usual items", \`list_favorites\` and \`list_frequently_bought_products\` can inform a proposed list. Past purchases are evidence, not permission to buy them again.
|
|
38
|
+
|
|
39
|
+
\`list_favorites\` returns a local snapshot with \`source\` and \`freshness\`; pass \`refresh: true\` when the user wants the current website list or the snapshot is stale. An empty list is a valid result, and a failed refresh does not mean favorites disappeared.
|
|
40
|
+
|
|
41
|
+
\`list_orders\` supports \`limit\`, \`includeLines\`, \`detailLimit\` and \`cursor\` (the returned \`nextCursor\`). Use the internal \`orderId\` with \`get_order\`, not the displayed order number. \`list_frequently_bought_products\` has separate \`orderLimit\` and \`limit\`; its scan counts and failures show how representative the ranking is. Never add quantities expressed in different units.
|
|
42
|
+
|
|
43
|
+
\`get_session_status\` reports local state only; it does not verify that the login still works. Do not include credentials or account details in summaries.
|
|
44
|
+
|
|
45
|
+
Finish with the chosen or changed items, confirmed quantities and units, and any unresolved choices or failures. Keep planned items separate from changes the server confirmed.
|
|
46
|
+
|
|
47
|
+
For exact schemas and limits, see the [tool reference](https://github.com/andredelgado/continente-mcp/blob/main/docs/tools.md).`;
|
|
48
|
+
/** Sent to every client on connect; the essential rules for working with the cart safely. */
|
|
49
|
+
export const SERVER_INSTRUCTIONS = `Continente MCP shops at Continente.pt for one account. Checkout and payment always happen on the website.
|
|
50
|
+
|
|
51
|
+
- Quantities are in the product's sale unit. Call get_product before choosing a quantity for weighted or bulk products, and respect its minimum, maximum and step.
|
|
52
|
+
- set_cart_item_quantity sets an exact total (adding the product if needed; 0 removes it). add_cart_item adds on top of what is already there. When the user says how many they need, use set_cart_item_quantity.
|
|
53
|
+
- Change the cart one item at a time and read structuredContent.result before reporting success. confirmedQuantity is what the cart now holds.
|
|
54
|
+
- If a cart change returns mutation.outcome "unknown", the cart may have changed. Call get_cart and decide from its contents. Never repeat the change automatically.
|
|
55
|
+
- Money is EUR in integer minorUnits (129 means €1.29). Missing prices, quantities or completeness stay unknown; do not guess them.
|
|
56
|
+
- For planning a shopping list or basket, use the basket-planner prompt for the full workflow.`;
|
|
57
|
+
export const basketPlannerPrompt = {
|
|
58
|
+
name: 'basket-planner',
|
|
59
|
+
title: 'Plan a Continente basket',
|
|
60
|
+
description: 'Workflow for choosing products, checking sale quantities and changing the cart safely.',
|
|
61
|
+
arguments: { request: 'What to plan or buy, for example "weekly basket for two" or "add milk and eggs".' },
|
|
62
|
+
render: ({ request }) => ({
|
|
63
|
+
description: 'Continente basket planning workflow',
|
|
64
|
+
messages: [{ role: 'user', content: { type: 'text',
|
|
65
|
+
text: request?.trim() ? `${BASKET_PLANNER_GUIDE}\n\n## Request\n\n${request.trim()}` : BASKET_PLANNER_GUIDE } }],
|
|
66
|
+
}),
|
|
67
|
+
};
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CallToolResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
|
|
1
|
+
import type { CallToolResult, GetPromptResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import type { RequestOptions } from '../session/request.js';
|
|
@@ -14,9 +14,20 @@ export interface ToolHandler {
|
|
|
14
14
|
readonly cartMutation?: boolean;
|
|
15
15
|
execute(input: unknown): Promise<CallToolResult>;
|
|
16
16
|
}
|
|
17
|
+
/** A prompt template. Every argument is an optional string, as MCP prompt arguments are strings. */
|
|
18
|
+
export interface PromptHandler {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly title?: string;
|
|
21
|
+
readonly description?: string;
|
|
22
|
+
readonly arguments?: Readonly<Record<string, string>>;
|
|
23
|
+
render(args: Readonly<Record<string, string | undefined>>): GetPromptResult;
|
|
24
|
+
}
|
|
17
25
|
export interface McpServerOptions {
|
|
18
26
|
readonly version: string;
|
|
19
27
|
readonly tools: readonly ToolHandler[];
|
|
28
|
+
readonly prompts?: readonly PromptHandler[];
|
|
29
|
+
/** Usage guidance sent to clients when they connect. */
|
|
30
|
+
readonly instructions?: string;
|
|
20
31
|
readonly closeResources?: () => Promise<void>;
|
|
21
32
|
readonly requestTimeoutMs?: number;
|
|
22
33
|
}
|
|
@@ -27,6 +38,7 @@ export declare class ContinenteMcpServer {
|
|
|
27
38
|
private cleanup;
|
|
28
39
|
private readonly shutdown;
|
|
29
40
|
constructor(options: McpServerOptions);
|
|
41
|
+
private registerPrompts;
|
|
30
42
|
private registerTools;
|
|
31
43
|
dispatchToolCall(name: string, input?: unknown, options?: RequestOptions): Promise<CallToolResult>;
|
|
32
44
|
private execute;
|
package/dist/mcp/server.js
CHANGED
|
@@ -11,7 +11,7 @@ export class ContinenteMcpServer {
|
|
|
11
11
|
shutdown = new AbortController();
|
|
12
12
|
constructor(options) {
|
|
13
13
|
this.options = options;
|
|
14
|
-
this.server = new McpServer({ name: 'continentept-mcp', version: options.version }, { capabilities: { tools: {} } });
|
|
14
|
+
this.server = new McpServer({ name: 'continentept-mcp', version: options.version }, { capabilities: { tools: {} }, ...(options.instructions ? { instructions: options.instructions } : {}) });
|
|
15
15
|
for (const handler of options.tools) {
|
|
16
16
|
if (this.handlers.has(handler.definition.name))
|
|
17
17
|
throw new Error(`Duplicate tool: ${handler.definition.name}`);
|
|
@@ -19,6 +19,15 @@ export class ContinenteMcpServer {
|
|
|
19
19
|
}
|
|
20
20
|
this.server.server.onclose = () => { this.shutdown.abort(new RequestStopped('server_closed')); void this.closeResources().catch(() => { }); };
|
|
21
21
|
this.registerTools();
|
|
22
|
+
this.registerPrompts();
|
|
23
|
+
}
|
|
24
|
+
registerPrompts() {
|
|
25
|
+
for (const prompt of this.options.prompts ?? []) {
|
|
26
|
+
const argsSchema = Object.fromEntries(Object.entries(prompt.arguments ?? {})
|
|
27
|
+
.map(([name, description]) => [name, z.string().optional().describe(description)]));
|
|
28
|
+
this.server.registerPrompt(prompt.name, { ...(prompt.title ? { title: prompt.title } : {}),
|
|
29
|
+
...(prompt.description ? { description: prompt.description } : {}), argsSchema }, args => prompt.render(args));
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
registerTools() {
|
|
24
33
|
if (!this.handlers.size)
|
package/dist/runtime.js
CHANGED
|
@@ -8,6 +8,7 @@ import { CatalogService, FavoritesService } from './services/catalog.js';
|
|
|
8
8
|
import { CartService } from './services/cart.js';
|
|
9
9
|
import { OrderService, PurchaseHistoryService } from './services/orders.js';
|
|
10
10
|
import { registerShoppingTools } from './mcp/shopping.js';
|
|
11
|
+
import { SERVER_INSTRUCTIONS, basketPlannerPrompt } from './mcp/guide.js';
|
|
11
12
|
export const systemClock = { now: () => new Date() };
|
|
12
13
|
export const launchBrowser = async (options) => (await import('playwright')).chromium.launch(options);
|
|
13
14
|
/** Build the shopping services. Nothing is read or launched until this is called. */
|
|
@@ -34,5 +35,6 @@ export function createShoppingServices(options = {}) {
|
|
|
34
35
|
export function createShoppingApplication(options) {
|
|
35
36
|
const services = options.services ?? createShoppingServices(options);
|
|
36
37
|
return createApplication({ version: options.version, tools: registerShoppingTools(services),
|
|
38
|
+
prompts: [basketPlannerPrompt], instructions: SERVER_INSTRUCTIONS,
|
|
37
39
|
closeResources: () => services.session.shutdown?.() ?? services.session.run(() => services.session.closeBrowserSession()) });
|
|
38
40
|
}
|
package/docs/configuration.md
CHANGED
|
@@ -40,6 +40,49 @@ chmod 600 ~/.continentept-mcp/credentials.env
|
|
|
40
40
|
|
|
41
41
|
On Windows, limit the folder's permissions to your user account.
|
|
42
42
|
|
|
43
|
+
## Using 1Password
|
|
44
|
+
|
|
45
|
+
With the [1Password CLI](https://developer.1password.com/docs/cli/get-started/), the
|
|
46
|
+
credentials never need to be written to a file. Put secret references in the MCP client
|
|
47
|
+
configuration and start the server through `op run`, which swaps them for the real values:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"continente": {
|
|
53
|
+
"command": "op",
|
|
54
|
+
"args": ["run", "--no-masking", "--", "npx", "-y", "continentept-mcp"],
|
|
55
|
+
"env": {
|
|
56
|
+
"CONTINENTE_EMAIL": "op://Personal/Continente/username",
|
|
57
|
+
"CONTINENTE_PASSWORD": "op://Personal/Continente/password"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For Claude Code:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
claude mcp add continente \
|
|
68
|
+
-e CONTINENTE_EMAIL=op://Personal/Continente/username \
|
|
69
|
+
-e CONTINENTE_PASSWORD=op://Personal/Continente/password \
|
|
70
|
+
-- op run --no-masking -- npx -y continentept-mcp
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- Replace `Personal/Continente` with your vault and item. In 1Password, right-click a field
|
|
74
|
+
and choose **Copy Secret Reference** to get the exact reference.
|
|
75
|
+
- Turn on **Settings → Developer → Integrate with 1Password CLI** in the 1Password app so
|
|
76
|
+
`op` unlocks with Touch ID or your system password. You are asked when the client starts
|
|
77
|
+
the server.
|
|
78
|
+
- Keep `--no-masking`. Without it, `op run` filters the server's output, which carries the MCP
|
|
79
|
+
protocol.
|
|
80
|
+
- The same works for the login command:
|
|
81
|
+
`CONTINENTE_EMAIL=op://… CONTINENTE_PASSWORD=op://… op run -- npx -y continentept-mcp login`.
|
|
82
|
+
|
|
83
|
+
Only the credentials come from 1Password. The website session the server saves after signing
|
|
84
|
+
in still lives in the data directory, as described below.
|
|
85
|
+
|
|
43
86
|
## Sign-in and saved session
|
|
44
87
|
|
|
45
88
|
Account tools reuse the saved session. When the website reports that it has expired, the
|
package/docs/tools.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Tool reference
|
|
2
2
|
|
|
3
|
-
Continente MCP exposes 11 tools. Every tool has a strict
|
|
4
|
-
rejected), an output schema, a title and the four MCP
|
|
3
|
+
Continente MCP exposes 11 tools, server instructions and one prompt. Every tool has a strict
|
|
4
|
+
input schema (unknown fields are rejected), an output schema, a title and the four MCP
|
|
5
|
+
behaviour annotations.
|
|
5
6
|
|
|
6
7
|
| Tool | Login | Changes the cart | Inputs |
|
|
7
8
|
| --- | --- | --- | --- |
|
|
@@ -199,6 +200,17 @@ credentials, cookies or file paths.
|
|
|
199
200
|
|
|
200
201
|
Invalid arguments and unknown tools are JSON-RPC errors (`-32602`), not tool results.
|
|
201
202
|
|
|
203
|
+
## Instructions and prompt
|
|
204
|
+
|
|
205
|
+
The server sends **instructions** when a client connects: the quantity, cart-change and
|
|
206
|
+
uncertain-outcome rules described above, in a few lines. Clients such as Claude include them
|
|
207
|
+
in the assistant's context automatically.
|
|
208
|
+
|
|
209
|
+
It also offers one **prompt**, `basket-planner` ("Plan a Continente basket"). It returns the
|
|
210
|
+
full shopping workflow as a user message. Its optional `request` argument, such as
|
|
211
|
+
`weekly basket for two`, is appended to the workflow. The text is the same as the
|
|
212
|
+
[`basket-planner` skill](../skills/basket-planner/SKILL.md).
|
|
213
|
+
|
|
202
214
|
## Limits and lifecycle
|
|
203
215
|
|
|
204
216
|
- Calls run one at a time. Each call has a 45-second budget, including time spent waiting.
|
package/package.json
CHANGED
|
@@ -47,4 +47,4 @@ For "my usual items", `list_favorites` and `list_frequently_bought_products` can
|
|
|
47
47
|
|
|
48
48
|
Finish with the chosen or changed items, confirmed quantities and units, and any unresolved choices or failures. Keep planned items separate from changes the server confirmed.
|
|
49
49
|
|
|
50
|
-
For exact schemas and limits, see the [tool reference](
|
|
50
|
+
For exact schemas and limits, see the [tool reference](https://github.com/andredelgado/continente-mcp/blob/main/docs/tools.md).
|