cellium-mcp-client 2.0.3 → 2.0.5
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/client.js +11 -7
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -362,14 +362,14 @@ class CelliumMCPClient {
|
|
|
362
362
|
throw new Error('Cannot connect to remote Cellium server');
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
const
|
|
365
|
+
const endpoint = this.config.endpoint;
|
|
366
366
|
const requestBody = {
|
|
367
367
|
jsonrpc: '2.0',
|
|
368
368
|
id: requestId,
|
|
369
369
|
method,
|
|
370
370
|
params
|
|
371
371
|
};
|
|
372
|
-
this.logDebug(`Making HTTP request to ${
|
|
372
|
+
this.logDebug(`Making HTTP request to ${endpoint}`, {
|
|
373
373
|
requestId,
|
|
374
374
|
method,
|
|
375
375
|
bodySize: JSON.stringify(requestBody).length
|
|
@@ -377,11 +377,13 @@ class CelliumMCPClient {
|
|
|
377
377
|
let response;
|
|
378
378
|
let responseText;
|
|
379
379
|
try {
|
|
380
|
-
response = await fetch(
|
|
380
|
+
response = await fetch(endpoint, {
|
|
381
381
|
method: 'POST',
|
|
382
382
|
headers: {
|
|
383
383
|
'Authorization': `Bearer ${this.config.token}`,
|
|
384
384
|
'Content-Type': 'application/json',
|
|
385
|
+
'Accept': 'application/json, text/event-stream',
|
|
386
|
+
'MCP-Protocol-Version': this.mcpProtocolVersion,
|
|
385
387
|
'User-Agent': 'cellium-mcp-client/2.0.0'
|
|
386
388
|
},
|
|
387
389
|
body: JSON.stringify(requestBody)
|
|
@@ -441,7 +443,7 @@ class CelliumMCPClient {
|
|
|
441
443
|
requestId,
|
|
442
444
|
method,
|
|
443
445
|
duration,
|
|
444
|
-
endpoint:
|
|
446
|
+
endpoint: endpoint
|
|
445
447
|
}, 'HTTP request to remote server failed');
|
|
446
448
|
this.isConnected = false; // Mark as disconnected on error
|
|
447
449
|
throw error;
|
|
@@ -605,16 +607,18 @@ class CelliumMCPClient {
|
|
|
605
607
|
}
|
|
606
608
|
async testConnection() {
|
|
607
609
|
const startTime = Date.now();
|
|
608
|
-
const
|
|
610
|
+
const endpoint = this.config.endpoint;
|
|
609
611
|
this.logDebug('Testing connection', {
|
|
610
|
-
endpoint:
|
|
612
|
+
endpoint: endpoint,
|
|
611
613
|
hasToken: !!this.config.token
|
|
612
614
|
});
|
|
613
|
-
const response = await fetch(
|
|
615
|
+
const response = await fetch(endpoint, {
|
|
614
616
|
method: 'POST',
|
|
615
617
|
headers: {
|
|
616
618
|
'Authorization': `Bearer ${this.config.token}`,
|
|
617
619
|
'Content-Type': 'application/json',
|
|
620
|
+
'Accept': 'application/json, text/event-stream',
|
|
621
|
+
'MCP-Protocol-Version': this.mcpProtocolVersion,
|
|
618
622
|
'User-Agent': 'cellium-mcp-client/2.0.0'
|
|
619
623
|
},
|
|
620
624
|
body: JSON.stringify({
|