Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"homepage": "https://github.com/adeze/raindrop-mcp#readme",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.18.0",
"@modelcontextprotocol/sdk": "^1.20.1",
"axios": "^1.12.2",
"dotenv": "^17.2.2",
"esm": "^3.2.25",
Expand All @@ -73,7 +73,7 @@
"openapi-fetch": "^0.14.0",
"rate-limiter-flexible": "^7.3.1",
"simple-oauth2": "^5.1.0",
"zod": "^4.1.9",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.24.6"
},
"devDependencies": {
Expand All @@ -93,4 +93,4 @@
"node": ">=18.0.0",
"bun": ">=1.0.0"
}
}
}
8 changes: 8 additions & 0 deletions scripts/print-tools.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { RaindropMCPService } from "../build/services/raindropmcp.service.js";

const svc = new RaindropMCPService();
const server = svc.getServer();
const tools = (server)._tools || [];
for (const t of tools) {
console.log(JSON.stringify({ name: t.name, type: t.inputSchema?.type, inputSchema: t.inputSchema }, null, 2));
}
12 changes: 10 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,16 @@ const server = http.createServer(async (req, res) => {
return;
}

// delegate to transport
await transport.handleRequest(req as any, res as any, body);
// delegate to transport and ensure response is flushed
try {
await transport.handleRequest(req as any, res as any, body);
} catch (e) {
logger.error('Transport handleRequest error', e);
if (!res.headersSent) {
res.writeHead(500, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ jsonrpc: '2.0', error: { code: -32603, message: 'Transport error' }, id: body?.id ?? null }));
}
}
} catch (error) {
logger.error('Error handling optimized Streamable HTTP request:', error);
if (!res.headersSent) {
Expand Down
Loading