continentept-mcp 0.7.0 → 0.7.1
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 +8 -1
- package/dist/cli.js +1 -1
- package/dist/mcp/server.d.ts +1 -2
- package/dist/mcp/server.js +16 -16
- package/dist/mcp/shopping.d.ts +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ All notable changes to this project are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.7.1] - 2026-10-16
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- The server runs on the MCP server package (`@modelcontextprotocol/server` 2.x) instead of the full SDK, which also installed an HTTP server stack this stdio server never used. Installing it now brings 26 packages instead of 113, and the Claude Desktop extension is about 1.6 MB smaller. Tools, prompts and protocol versions are unchanged; task-augmented tool calls are still refused before they run.
|
|
14
|
+
|
|
9
15
|
## [0.7.0] - 2026-10-16
|
|
10
16
|
|
|
11
17
|
### Fixed
|
|
@@ -127,7 +133,8 @@ All notable changes to this project are documented here. The format follows
|
|
|
127
133
|
- Automatic sign-in from environment variables or a private credentials file, and a `login` command.
|
|
128
134
|
- The `basket-planner` skill for planning a shopping list and updating the basket.
|
|
129
135
|
|
|
130
|
-
[Unreleased]: https://github.com/andredelgado/continente-mcp/compare/v0.7.
|
|
136
|
+
[Unreleased]: https://github.com/andredelgado/continente-mcp/compare/v0.7.1...HEAD
|
|
137
|
+
[0.7.1]: https://github.com/andredelgado/continente-mcp/compare/v0.7.0...v0.7.1
|
|
131
138
|
[0.7.0]: https://github.com/andredelgado/continente-mcp/compare/v0.6.1...v0.7.0
|
|
132
139
|
[0.6.1]: https://github.com/andredelgado/continente-mcp/compare/v0.6.0...v0.6.1
|
|
133
140
|
[0.6.0]: https://github.com/andredelgado/continente-mcp/compare/v0.5.0...v0.6.0
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
|
-
import { StdioServerTransport } from '@modelcontextprotocol/
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
|
|
4
4
|
import { createShoppingApplication } from './runtime.js';
|
|
5
5
|
import { runAutoLogin } from './auto-login.js';
|
|
6
6
|
import { isMainModule } from './main-module.js';
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { CallToolResult, GetPromptResult, ToolAnnotations } from '@modelcontextprotocol/
|
|
2
|
-
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
1
|
+
import type { CallToolResult, GetPromptResult, ToolAnnotations, Transport } from '@modelcontextprotocol/server';
|
|
3
2
|
import { z } from 'zod';
|
|
4
3
|
import type { RequestOptions } from '../session/request.js';
|
|
5
4
|
export interface ToolHandler {
|
package/dist/mcp/server.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/
|
|
2
|
-
import { CallToolRequestSchema, CallToolResultSchema, ListToolsRequestSchema, McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
1
|
+
import { McpServer, ProtocolError, ProtocolErrorCode, isCallToolResult } from '@modelcontextprotocol/server';
|
|
3
2
|
import { z } from 'zod';
|
|
4
3
|
import { ExecutionErrorSchema } from './contracts.js';
|
|
5
4
|
import { checkRequest, inRequest, RequestScope, RequestStopped } from '../session/request.js';
|
|
5
|
+
/** The `result` envelope every tool returns in its structured content. */
|
|
6
|
+
const structuredResult = (result) => result.structuredContent?.result;
|
|
6
7
|
export class ContinenteMcpServer {
|
|
7
8
|
options;
|
|
8
9
|
server;
|
|
@@ -31,23 +32,22 @@ export class ContinenteMcpServer {
|
|
|
31
32
|
}
|
|
32
33
|
registerTools() {
|
|
33
34
|
if (!this.handlers.size)
|
|
34
|
-
this.server.server.setRequestHandler(
|
|
35
|
+
this.server.server.setRequestHandler('tools/list', async () => ({ tools: [] }));
|
|
35
36
|
for (const handler of this.handlers.values()) {
|
|
36
37
|
const { name, ...metadata } = handler.definition;
|
|
37
38
|
this.server.registerTool(name, { ...metadata, inputSchema: handler.inputSchema,
|
|
38
39
|
...(handler.outputSchema ? { outputSchema: handler.outputSchema } : {}) }, input => this.dispatchToolCall(name, input));
|
|
39
40
|
}
|
|
40
41
|
// Replace the SDK's tools/call handler: it turns argument errors into text-only tool results
|
|
41
|
-
// and skips output validation for errors.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
throw new McpError(ErrorCode.InvalidParams, 'Task execution is not supported');
|
|
42
|
+
// and skips output validation for errors.
|
|
43
|
+
this.server.server.setRequestHandler('tools/call', (request, ctx) => {
|
|
44
|
+
// Task-augmented calls would run as ordinary calls here; refuse them, as no task support is advertised.
|
|
45
|
+
if (request.params.task !== undefined)
|
|
46
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, 'Task execution is not supported');
|
|
47
47
|
const progressToken = request.params._meta?.progressToken;
|
|
48
|
-
return this.dispatchToolCall(request.params.name, request.params.arguments ?? {}, { signal:
|
|
48
|
+
return this.dispatchToolCall(request.params.name, request.params.arguments ?? {}, { signal: ctx.mcpReq.signal,
|
|
49
49
|
...(progressToken === undefined ? {} : { onProgress: progress => {
|
|
50
|
-
void
|
|
50
|
+
void ctx.mcpReq.notify({ method: 'notifications/progress', params: { progressToken,
|
|
51
51
|
progress: progress.completed, ...(progress.total === undefined ? {} : { total: progress.total }), message: progress.message } }).catch(() => { });
|
|
52
52
|
} }),
|
|
53
53
|
});
|
|
@@ -66,17 +66,17 @@ export class ContinenteMcpServer {
|
|
|
66
66
|
async execute(name, input, scope) {
|
|
67
67
|
const handler = this.handlers.get(name);
|
|
68
68
|
if (!handler)
|
|
69
|
-
throw new
|
|
69
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `No tool named "${name}"`);
|
|
70
70
|
const parsed = handler.inputSchema.safeParse(input);
|
|
71
71
|
if (!parsed.success)
|
|
72
|
-
throw new
|
|
72
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for ${name}`, {
|
|
73
73
|
issues: parsed.error.issues.map(issue => ({ path: issue.path.map(String).join('.'), code: issue.code })),
|
|
74
74
|
});
|
|
75
75
|
let result;
|
|
76
76
|
try {
|
|
77
77
|
checkRequest();
|
|
78
78
|
result = await handler.execute(parsed.data);
|
|
79
|
-
if (scope.signal.aborted && result
|
|
79
|
+
if (scope.signal.aborted && structuredResult(result)?.status !== 'partial')
|
|
80
80
|
throw scope.signal.reason;
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
@@ -84,13 +84,13 @@ export class ContinenteMcpServer {
|
|
|
84
84
|
return this.executionError(error.code, handler.cartMutation === true, scope.writeAttempted ? 'unknown' : 'not_applied');
|
|
85
85
|
return this.executionError('internal_error', handler.cartMutation === true);
|
|
86
86
|
}
|
|
87
|
-
if (!
|
|
87
|
+
if (!isCallToolResult(result))
|
|
88
88
|
return this.executionError('invalid_result', handler.cartMutation === true);
|
|
89
89
|
if (handler.outputSchema) {
|
|
90
90
|
const validated = handler.outputSchema.safeParse(result.structuredContent);
|
|
91
91
|
if (!validated.success)
|
|
92
92
|
return this.executionError('invalid_result', handler.cartMutation === true);
|
|
93
|
-
const failed = ExecutionErrorSchema.safeParse({ result: result
|
|
93
|
+
const failed = ExecutionErrorSchema.safeParse({ result: structuredResult(result) }).success;
|
|
94
94
|
if (failed !== (result.isError === true))
|
|
95
95
|
return this.executionError('invalid_result', handler.cartMutation === true);
|
|
96
96
|
}
|
package/dist/mcp/shopping.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { CallToolResult } from '@modelcontextprotocol/
|
|
2
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
3
3
|
import type { ToolHandler } from './server.js';
|
|
4
4
|
import type { Clock, SessionService } from '../ports.js';
|
|
5
5
|
import type { UpdateStatus } from '../domain/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "continentept-mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"mcpName": "io.github.andredelgado/continente-mcp",
|
|
5
5
|
"description": "MCP server for Continente.pt: search products, check sale rules, read favorites and orders, and make verified cart changes.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,13 +68,14 @@
|
|
|
68
68
|
"check:site": "npm run build && node build/tools/site-check.js"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@modelcontextprotocol/
|
|
71
|
+
"@modelcontextprotocol/server": "2.3.1",
|
|
72
72
|
"cheerio": "1.2.0",
|
|
73
73
|
"playwright": "1.64.0",
|
|
74
74
|
"zod": "4.6.7"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@anthropic-ai/mcpb": "2.1.2",
|
|
78
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
78
79
|
"@types/node": "^22.18.0",
|
|
79
80
|
"typescript": "^7.0.2"
|
|
80
81
|
},
|