Skip to content

Commit 80f0564

Browse files
committed
fix: keep event loop alive for mcp-proxy ping, update MCP protocol version
- Add process.stdin.resume() to prevent premature Node.js exit - Update protocolVersion to 2025-03-26 - Add stdin error handler for graceful shutdown - Bump v0.5.14
1 parent 95e501c commit 80f0564

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shellward",
3-
"version": "0.5.13",
3+
"version": "0.5.14",
44
"mcpName": "io.github.jnMetaCode/shellward",
55
"description": "AI agent security & MCP security middleware — prompt injection detection, AI firewall, runtime guardrails & data-loss prevention for LLM tool calls. 8-layer defense against data exfiltration & dangerous commands. Zero dependencies. SDK + OpenClaw plugin. Supports LangChain, AutoGPT, Claude Code, Cursor, OpenAI Agents.",
66
"keywords": [

server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"url": "https://github.com/jnMetaCode/shellward",
77
"source": "github"
88
},
9-
"version": "0.5.13",
9+
"version": "0.5.14",
1010
"packages": [
1111
{
1212
"registryType": "npm",
1313
"identifier": "shellward",
14-
"version": "0.5.13",
14+
"version": "0.5.14",
1515
"runtime": "node",
1616
"transport": {
1717
"type": "stdio"

src/mcp-server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function handleRequest(req: JsonRpcRequest): JsonRpcResponse | null {
254254
jsonrpc: '2.0',
255255
id: id ?? null,
256256
result: {
257-
protocolVersion: '2024-11-05',
257+
protocolVersion: '2025-03-26',
258258
capabilities: { tools: {} },
259259
serverInfo: {
260260
name: 'shellward',
@@ -337,6 +337,9 @@ function handleRequest(req: JsonRpcRequest): JsonRpcResponse | null {
337337

338338
let rawBuffer = Buffer.alloc(0)
339339

340+
// Keep event loop alive — prevent Node.js from exiting before mcp-proxy connects
341+
process.stdin.resume()
342+
340343
process.stdin.on('data', (chunk: Buffer) => {
341344
rawBuffer = Buffer.concat([rawBuffer, chunk])
342345

@@ -381,6 +384,7 @@ function send(msg: JsonRpcResponse) {
381384
}
382385

383386
process.stdin.on('end', () => process.exit(0))
387+
process.stdin.on('error', () => process.exit(1))
384388

385389
// Log to stderr so it doesn't interfere with stdio protocol
386390
process.stderr.write(`[ShellWard MCP] Server started (mode: ${guard.config.mode}, locale: ${guard.locale})\n`)

0 commit comments

Comments
 (0)