MCP server violates JSON-RPC 2.0 by replying to unknown notifications with id: null
Summary
open-computer-use mcp replies with a -32601 (Method not found) error response containing "id": null when it receives JSON-RPC 2.0 notifications other than notifications/initialized (such as notifications/roots/list_changed, notifications/cancelled, notifications/progress).
Per JSON-RPC 2.0 Section 4.1 (Notification):
The Server MUST NOT reply to a Notification, including those that are within a batch request.
Strict MCP clients (such as Go-based MCP clients / Antigravity CLI) treat an unsolicited response with "id": null as a protocol violation (invalid request) and immediately terminate the MCP server connection.
Environment
open-computer-use:1.1.4- OS: macOS (Apple Silicon /
darwin-arm64)
Minimal Reproduction
python3 -c '
import subprocess, json, select
p = subprocess.Popen(
["open-computer-use", "mcp"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, bufsize=1
)
for method in [
"notifications/initialized",
"notifications/cancelled",
"notifications/roots/list_changed",
"notifications/progress",
]:
p.stdin.write(json.dumps({"jsonrpc": "2.0", "method": method}) + "\n")
p.stdin.flush()
r, _, _ = select.select([p.stdout], [], [], 0.3)
if r:
print(f"{method} -> REPLIED: {p.stdout.readline().strip()}")
else:
print(f"{method} -> silent (OK)")
p.terminate()
'
Actual Output
notifications/initialized -> silent (OK)
notifications/cancelled -> REPLIED: {"jsonrpc":"2.0","id":null,"error":{"message":"Method not found: notifications/cancelled","code":-32601}}
notifications/roots/list_changed -> REPLIED: {"error":{"message":"Method not found: notifications/roots/list_changed","code":-32601},"id":null,"jsonrpc":"2.0"}
notifications/progress -> REPLIED: {"jsonrpc":"2.0","id":null,"error":{"message":"Method not found: notifications/progress","code":-32601}}
Expected Behavior
All incoming JSON-RPC messages without an id field (notifications) should be silently ignored if not handled, without writing any response to stdout.
Suggested Fix
In the MCP request dispatcher, check if the incoming message has no id (i.e. it is a notification). If so, do not send any response — including Method not found errors.
https://github.com/iFurySt/open-computer-use/pull/170 fixed this issue. Let me release a new version.
@mmjang you can try to upgrade your open-computer-use version to https://github.com/iFurySt/open-computer-use/releases/tag/v1.1.5
use this cmd:
npm install -g [email protected]