@cloudstreamsoftware/knowledge-mcp-client 1.0.1 → 1.0.2

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/dist/bridge.d.ts CHANGED
@@ -31,7 +31,8 @@ export declare class HttpBridge {
31
31
  */
32
32
  private handleError;
33
33
  /**
34
- * Generate offline mode response with helpful message
34
+ * Generate offline mode response
35
+ * Per JSON-RPC 2.0, failures must return error, not result
35
36
  */
36
37
  private offlineModeResponse;
37
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGjF;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,SAAS,CAAsB;gBAE3B,MAAM,EAAE,YAAY;IAIhC;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAgBxD;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;YACW,WAAW;IAwDzB;;OAEG;IACH,OAAO,CAAC,WAAW;IAoBnB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0C3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,kBAAkB,IAAI,eAAe;IAIrC;;OAEG;IACH,YAAY,IAAI,KAAK,GAAG,IAAI;CAG7B"}
1
+ {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGjF;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,SAAS,CAAsB;gBAE3B,MAAM,EAAE,YAAY;IAIhC;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAgBxD;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;YACW,WAAW;IAwDzB;;OAEG;IACH,OAAO,CAAC,WAAW;IAoBnB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA8B3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,kBAAkB,IAAI,eAAe;IAIrC;;OAEG;IACH,YAAY,IAAI,KAAK,GAAG,IAAI;CAG7B"}
package/dist/bridge.js CHANGED
@@ -115,10 +115,11 @@ class HttpBridge {
115
115
  `Bridge error: ${error.message}`);
116
116
  }
117
117
  /**
118
- * Generate offline mode response with helpful message
118
+ * Generate offline mode response
119
+ * Per JSON-RPC 2.0, failures must return error, not result
119
120
  */
120
121
  offlineModeResponse(request) {
121
- // For tools/list, return empty list with offline notice
122
+ // For tools/list, return empty list (graceful degradation)
122
123
  if (request.method === 'tools/list') {
123
124
  return {
124
125
  jsonrpc: '2.0',
@@ -128,27 +129,11 @@ class HttpBridge {
128
129
  },
129
130
  };
130
131
  }
131
- // For tool calls, return friendly error
132
+ // For tool calls, return proper JSON-RPC error
132
133
  if (request.method === 'tools/call') {
133
134
  const toolName = request.params?.name || 'unknown tool';
134
- return {
135
- jsonrpc: '2.0',
136
- id: request.id,
137
- result: {
138
- content: [
139
- {
140
- type: 'text',
141
- text: `[OFFLINE] The CloudStream Knowledge Server is currently unavailable.\n\n` +
142
- `Unable to process: ${toolName}\n\n` +
143
- `Please check:\n` +
144
- `1. Your internet connection\n` +
145
- `2. Knowledge Server status at ${this.config.apiUrl}/health\n` +
146
- `3. Your license key validity\n\n` +
147
- `Local skills and web search remain available.`,
148
- },
149
- ],
150
- },
151
- };
135
+ return this.errorResponse(request.id, -32003, `Knowledge Server unavailable. Unable to process: ${toolName}. ` +
136
+ `Check your internet connection and try again.`);
152
137
  }
153
138
  return this.errorResponse(request.id, -32003, 'Knowledge Server unavailable');
154
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudstreamsoftware/knowledge-mcp-client",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MCP client bridge for CloudStream Knowledge Server - translates stdio to HTTP",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",