reportdash-datastore-mcp-claude-desktop 1.0.4 → 1.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/index.js +50 -26
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -41,7 +41,8 @@ rl.on('line', (line) => {
41
41
  const mcpRequest = JSON.parse(line);
42
42
  forwardToAPI(mcpRequest);
43
43
  } catch (error) {
44
- console.error(JSON.stringify({
44
+ // Only output to stdout, never stderr for MCP protocol
45
+ console.log(JSON.stringify({
45
46
  jsonrpc: '2.0',
46
47
  error: {
47
48
  code: -32700,
@@ -78,14 +79,26 @@ function forwardToAPI(mcpRequest) {
78
79
  });
79
80
 
80
81
  res.on('end', () => {
81
- if (res.statusCode === 200) {
82
- console.log(data);
82
+ // Treat 200-299 as success (including 204 No Content)
83
+ if (res.statusCode >= 200 && res.statusCode < 300) {
84
+ // For 204 No Content or empty response, return empty success
85
+ if (res.statusCode === 204 || !data.trim()) {
86
+ console.log(JSON.stringify({
87
+ jsonrpc: '2.0',
88
+ result: {},
89
+ id: mcpRequest.id || null
90
+ }));
91
+ } else {
92
+ // Forward the response as-is
93
+ console.log(data);
94
+ }
83
95
  } else {
84
- console.error(JSON.stringify({
96
+ // Send errors to stdout (not stderr!) so Claude can properly handle them
97
+ console.log(JSON.stringify({
85
98
  jsonrpc: '2.0',
86
99
  error: {
87
100
  code: res.statusCode,
88
- message: `API error: ${res.statusCode} - ${data}`,
101
+ message: `API error: ${res.statusCode}${data ? ' - ' + data : ''}`,
89
102
  data: { statusCode: res.statusCode, body: data }
90
103
  },
91
104
  id: mcpRequest.id || null
@@ -95,7 +108,8 @@ function forwardToAPI(mcpRequest) {
95
108
  });
96
109
 
97
110
  req.on('error', (error) => {
98
- console.error(JSON.stringify({
111
+ // Send errors to stdout (not stderr!)
112
+ console.log(JSON.stringify({
99
113
  jsonrpc: '2.0',
100
114
  error: {
101
115
  code: -32603,
@@ -108,7 +122,8 @@ function forwardToAPI(mcpRequest) {
108
122
 
109
123
  req.on('timeout', () => {
110
124
  req.destroy();
111
- console.error(JSON.stringify({
125
+ // Send errors to stdout (not stderr!)
126
+ console.log(JSON.stringify({
112
127
  jsonrpc: '2.0',
113
128
  error: {
114
129
  code: -32603,
@@ -162,28 +177,37 @@ function testConnection() {
162
177
  res.on('end', () => {
163
178
  console.log(`Response Status: ${res.statusCode}\n`);
164
179
 
165
- if (res.statusCode === 200) {
166
- try {
167
- const response = JSON.parse(data);
180
+ if (res.statusCode >= 200 && res.statusCode < 300) {
181
+ if (res.statusCode === 204 || !data.trim()) {
168
182
  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));
183
+ console.log('✅ API key is valid');
184
+ console.log('ℹ️ Server returned 204 No Content\n');
185
+ } else {
186
+ try {
187
+ const response = JSON.parse(data);
188
+ console.log('✅ Connection successful!');
189
+ console.log('✅ API key is valid\n');
190
+
191
+ if (response.result && response.result.tools) {
192
+ console.log(`📦 Available Tools: ${response.result.tools.length}\n`);
193
+ response.result.tools.slice(0, 5).forEach((tool, index) => {
194
+ console.log(`${index + 1}. ${tool.name}`);
195
+ console.log(` ${tool.description}\n`);
196
+ });
197
+ if (response.result.tools.length > 5) {
198
+ console.log(`... and ${response.result.tools.length - 5} more tools`);
199
+ }
200
+ } else {
201
+ console.log('Response:', JSON.stringify(response, null, 2));
202
+ }
203
+ } catch (e) {
204
+ console.log('✅ Connection successful but response parsing failed');
205
+ console.log('Raw response:', data);
179
206
  }
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
207
  }
208
+
209
+ console.log('\n🎉 You can now use ReportDash DataStore in Claude Desktop!');
210
+ console.log('\nTry asking Claude: "list my reportdash datastore sources"');
187
211
  } else {
188
212
  console.log('❌ Connection failed');
189
213
  console.log(`Status: ${res.statusCode}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reportdash-datastore-mcp-claude-desktop",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "ReportDash DataStore MCP server for Claude Desktop",
5
5
  "main": "index.js",
6
6
  "bin": {