Skip to content

Import issue with ai_mcp_server.py #1431

Description

@ccbogel

Windows 11

ImportError,
from mcp.server.lowlevel.server import ReadResourceContents

I tried this to fix:
try:
from mcp.server.lowlevel.server import ReadResourceContents
except ImportError: # Quick fix
from mcp.server.lowlevel.helper_types import ReadResourceContents

Now gets:
File "C:\Users\ccurtain\Downloads\QualCoder-master\src\qualcoder\ai_mcp_server.py", line 682, in _register_sdk_handlers
@self._sdk_server.list_resources()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'Server' object has no attribute 'list_resources'

Now added in init() method lines 141-144. This is a temporary fix.

try:
self._register_sdk_handlers()
except AttributeError:
print("AttributeError: 'Server' object has no attribute 'list_resources'")

@kai - to review. I have uploaded this fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions