@imenam/mcp-http-gateway 2.0.5 → 2.0.6

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.
Files changed (2) hide show
  1. package/mcp-endpoint.js +10 -0
  2. package/package.json +1 -1
package/mcp-endpoint.js CHANGED
@@ -173,6 +173,16 @@ export function registerMcpEndpoint(app, { clients, registry }) {
173
173
  };
174
174
  await buildMcpServer({ registry }).connect(transport);
175
175
  } else if (!entry) {
176
+ if (sessionId) {
177
+ // Session ID fourni mais inconnu (restart serveur, session expirée) → 404
178
+ // Le client MCP doit réinitialiser une nouvelle session (spec MCP §Session Management §4)
179
+ return res.status(404).json({
180
+ jsonrpc: '2.0',
181
+ error: { code: -32000, message: 'Session not found' },
182
+ id: null,
183
+ });
184
+ }
185
+ // Pas de session ID sur une requête non-initialize → 400
176
186
  return res.status(400).json({
177
187
  jsonrpc: '2.0',
178
188
  error: { code: -32000, message: 'Bad Request: No valid session ID provided' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-http-gateway",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "type": "module",
5
5
  "description": "HTTP gateway that exposes MCP servers as REST routes — bridge between MCP and any HTTP-capable agent",
6
6
  "main": "server.js",