-
Notifications
You must be signed in to change notification settings - Fork 6
Server crashes on startup: notification_options=None incompatible with current MCP SDK #2
Copy link
Copy link
Open
Description
Bug Description
The server crashes immediately on startup with an AttributeError because notification_options=None is passed to server.get_capabilities(), but the current MCP SDK (mcp package) expects a NotificationOptions instance, not None.
Error
AttributeError: 'NoneType' object has no attribute 'tools_changed'
Full traceback:
File "servicenow_mcp/server.py", line 132, in run
capabilities=self.server.get_capabilities(
notification_options=None, # type: ignore[arg-type]
experimental_capabilities={},
),
File "mcp/server/lowlevel/server.py", line 217, in get_capabilities
tools_capability = types.ToolsCapability(listChanged=notification_options.tools_changed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'tools_changed'
Root Cause
In src/servicenow_mcp/server.py line 132, notification_options=None is passed explicitly. The MCP SDK's get_capabilities() method dereferences this parameter without a None check (it expects NotificationOptions).
Fix
Replace None with NotificationOptions() and add the missing import:
from mcp.server.lowlevel.server import NotificationOptionscapabilities=self.server.get_capabilities(
notification_options=NotificationOptions(),
experimental_capabilities={},
),Environment
- Python 3.13
- Latest
mcpSDK (installed viauvx) - Linux
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels