reportdash-datastore-mcp-claude-desktop 1.0.3 ā 1.0.4
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 +40 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -131,26 +131,59 @@ function testConnection() {
|
|
|
131
131
|
const isHttps = url.protocol === 'https:';
|
|
132
132
|
const client = isHttps ? https : http;
|
|
133
133
|
|
|
134
|
+
// Create MCP tools/list request
|
|
135
|
+
const mcpRequest = {
|
|
136
|
+
jsonrpc: '2.0',
|
|
137
|
+
method: 'tools/list',
|
|
138
|
+
id: 'test-connection'
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const postData = JSON.stringify(mcpRequest);
|
|
142
|
+
|
|
134
143
|
const options = {
|
|
135
144
|
hostname: url.hostname,
|
|
136
145
|
port: url.port || (isHttps ? 443 : 80),
|
|
137
146
|
path: url.pathname,
|
|
138
|
-
method: '
|
|
147
|
+
method: 'POST',
|
|
139
148
|
headers: {
|
|
140
|
-
'
|
|
149
|
+
'Content-Type': 'application/json',
|
|
150
|
+
'X-Api-Key': API_KEY,
|
|
151
|
+
'Content-Length': Buffer.byteLength(postData),
|
|
152
|
+
'User-Agent': 'ReportDash-DataStore-MCP/1.0'
|
|
141
153
|
},
|
|
142
154
|
timeout: 10000
|
|
143
155
|
};
|
|
144
156
|
|
|
157
|
+
console.log('š” Sending MCP tools/list request...\n');
|
|
158
|
+
|
|
145
159
|
const req = client.request(options, (res) => {
|
|
146
160
|
let data = '';
|
|
147
161
|
res.on('data', (chunk) => { data += chunk; });
|
|
148
162
|
res.on('end', () => {
|
|
163
|
+
console.log(`Response Status: ${res.statusCode}\n`);
|
|
164
|
+
|
|
149
165
|
if (res.statusCode === 200) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
try {
|
|
167
|
+
const response = JSON.parse(data);
|
|
168
|
+
console.log('ā
Connection successful!');
|
|
169
|
+
console.log('ā
API key is valid\n');
|
|
170
|
+
|
|
171
|
+
if (response.result && response.result.tools) {
|
|
172
|
+
console.log(`š¦ Available Tools: ${response.result.tools.length}\n`);
|
|
173
|
+
response.result.tools.forEach((tool, index) => {
|
|
174
|
+
console.log(`${index + 1}. ${tool.name}`);
|
|
175
|
+
console.log(` ${tool.description}\n`);
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
console.log('Response:', JSON.stringify(response, null, 2));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
console.log('\nš You can now use ReportDash DataStore in Claude Desktop!');
|
|
182
|
+
console.log('\nTry asking Claude: "list my reportdash datastore sources"');
|
|
183
|
+
} catch (e) {
|
|
184
|
+
console.log('ā
Connection successful but response parsing failed');
|
|
185
|
+
console.log('Raw response:', data);
|
|
186
|
+
}
|
|
154
187
|
} else {
|
|
155
188
|
console.log('ā Connection failed');
|
|
156
189
|
console.log(`Status: ${res.statusCode}`);
|
|
@@ -171,5 +204,6 @@ function testConnection() {
|
|
|
171
204
|
console.log('\nš” Check your internet connection');
|
|
172
205
|
});
|
|
173
206
|
|
|
207
|
+
req.write(postData);
|
|
174
208
|
req.end();
|
|
175
209
|
}
|