reportdash-datastore-mcp-claude-desktop 1.0.6 → 1.0.7
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/index.js +17 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
//goto folder, increment version then run > npm publish --access public
|
|
2
3
|
|
|
3
4
|
const https = require('https');
|
|
4
5
|
const http = require('http');
|
|
@@ -21,6 +22,18 @@ if (!API_KEY) {
|
|
|
21
22
|
process.exit(1);
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Ensure every outbound request includes platform="claude"
|
|
27
|
+
* without breaking existing requests.
|
|
28
|
+
*/
|
|
29
|
+
function withClaudePlatform(mcpRequest) {
|
|
30
|
+
// If caller already provided platform, keep it.
|
|
31
|
+
if (mcpRequest && typeof mcpRequest === 'object') {
|
|
32
|
+
if (!mcpRequest.platform) mcpRequest.platform = 'claude';
|
|
33
|
+
}
|
|
34
|
+
return mcpRequest;
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
// Test mode
|
|
25
38
|
if (process.argv.includes('--test')) {
|
|
26
39
|
testConnection();
|
|
@@ -39,7 +52,7 @@ rl.on('line', (line) => {
|
|
|
39
52
|
|
|
40
53
|
try {
|
|
41
54
|
const mcpRequest = JSON.parse(line);
|
|
42
|
-
forwardToAPI(mcpRequest);
|
|
55
|
+
forwardToAPI(withClaudePlatform(mcpRequest));
|
|
43
56
|
} catch (error) {
|
|
44
57
|
// Only output to stdout, never stderr for MCP protocol
|
|
45
58
|
console.log(JSON.stringify({
|
|
@@ -147,11 +160,11 @@ function testConnection() {
|
|
|
147
160
|
const client = isHttps ? https : http;
|
|
148
161
|
|
|
149
162
|
// Create MCP tools/list request
|
|
150
|
-
const mcpRequest = {
|
|
163
|
+
const mcpRequest = withClaudePlatform({
|
|
151
164
|
jsonrpc: '2.0',
|
|
152
165
|
method: 'tools/list',
|
|
153
166
|
id: 'test-connection'
|
|
154
|
-
};
|
|
167
|
+
});
|
|
155
168
|
|
|
156
169
|
const postData = JSON.stringify(mcpRequest);
|
|
157
170
|
|
|
@@ -230,4 +243,4 @@ function testConnection() {
|
|
|
230
243
|
|
|
231
244
|
req.write(postData);
|
|
232
245
|
req.end();
|
|
233
|
-
}
|
|
246
|
+
}
|