sqlcipher-mcp-server 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/package.json +1 -1
- package/src/server/mcp-server.js +19 -0
package/package.json
CHANGED
package/src/server/mcp-server.js
CHANGED
|
@@ -69,8 +69,27 @@ export async function startMcpServer() {
|
|
|
69
69
|
// Create stdio transport
|
|
70
70
|
const transport = new StdioServerTransport();
|
|
71
71
|
|
|
72
|
+
// Add error handler for transport errors
|
|
73
|
+
transport.onerror = (error) => {
|
|
74
|
+
console.error('Transport error:', error);
|
|
75
|
+
};
|
|
76
|
+
|
|
72
77
|
// Connect server to transport
|
|
73
78
|
await server.connect(transport);
|
|
74
79
|
|
|
75
80
|
console.error('SQLCipher MCP Server running on stdio');
|
|
81
|
+
|
|
82
|
+
// Keep the process alive - keep stdin open to prevent the process from exiting
|
|
83
|
+
process.stdin.resume();
|
|
84
|
+
|
|
85
|
+
// Handle stdin end event (when client disconnects)
|
|
86
|
+
process.stdin.on('end', () => {
|
|
87
|
+
// When stdin ends, exit gracefully
|
|
88
|
+
process.exit(0);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Handle errors on stdin
|
|
92
|
+
process.stdin.on('error', (error) => {
|
|
93
|
+
console.error('Stdin error:', error);
|
|
94
|
+
});
|
|
76
95
|
}
|