mssql-mcp 2.3.4 → 2.3.5

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # MS SQL Server MCP Server v2.3.4
1
+ # MS SQL Server MCP Server v2.3.5
2
2
 
3
3
  🚀 **Model Context Protocol (MCP) server** for Microsoft SQL Server - compatible with Claude Desktop, Cursor, Windsurf and VS Code.
4
4
 
@@ -1,5 +1,5 @@
1
1
  export declare const SERVER_NAME = "mssql-mcp-server";
2
- export declare const SERVER_VERSION = "2.3.4";
2
+ export declare const SERVER_VERSION = "2.3.5";
3
3
  export declare const DEFAULT_PORT = 1433;
4
4
  export declare const DEFAULT_ENCRYPT = true;
5
5
  export declare const DEFAULT_TRUST_SERVER_CERTIFICATE = false;
@@ -1,5 +1,5 @@
1
1
  export const SERVER_NAME = "mssql-mcp-server";
2
- export const SERVER_VERSION = "2.3.4";
2
+ export const SERVER_VERSION = "2.3.5";
3
3
  export const DEFAULT_PORT = 1433;
4
4
  export const DEFAULT_ENCRYPT = true;
5
5
  export const DEFAULT_TRUST_SERVER_CERTIFICATE = false;
@@ -2,12 +2,24 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
2
2
  import { closePoolOnShutdown } from "../db/connection.js";
3
3
  export async function runStdioTransport(server) {
4
4
  const transport = new StdioServerTransport();
5
- const shutdown = async (signal) => {
6
- console.error(`\nShutting down (${signal})...`);
5
+ let shuttingDown = false;
6
+ const shutdown = async (reason) => {
7
+ if (shuttingDown)
8
+ return;
9
+ shuttingDown = true;
10
+ console.error(`\nShutting down (${reason})...`);
7
11
  await closePoolOnShutdown();
8
12
  console.error("Server stopped.");
9
13
  process.exit(0);
10
14
  };
15
+ // Per the MCP stdio spec, the client signals shutdown by closing the child's
16
+ // stdin; the server is expected to exit when stdin reaches EOF. Windows does
17
+ // not reliably deliver OS signals to child processes when the parent exits,
18
+ // so we must also react to stdin EOF and transport close, otherwise orphaned
19
+ // node processes accumulate. See https://github.com/BYMCS/mssql-mcp/issues/2
20
+ transport.onclose = () => shutdown("stdio-close");
21
+ process.stdin.on("end", () => shutdown("stdin-end"));
22
+ process.stdin.on("close", () => shutdown("stdin-close"));
11
23
  process.on("SIGINT", () => shutdown("SIGINT"));
12
24
  process.on("SIGTERM", () => shutdown("SIGTERM"));
13
25
  process.on("SIGUSR2", () => shutdown("SIGUSR2"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mssql-mcp",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "MCP Server for MS SQL Server integration with Claude Desktop, Cursor, Windsurf and VS Code",
5
5
  "main": "dist/src/index.js",
6
6
  "type": "module",