fix: add missing await for get_nextcloud_client in capabilities resource
Fix nc_get_capabilities resource handler that was missing await when calling get_nextcloud_client(ctx), causing error: 'coroutine' object has no attribute 'capabilities' Root cause: - get_nextcloud_client() is an async function (context.py:9) - Returns a coroutine that must be awaited - app.py:737 called it without await Solution: - Add await: client = await get_nextcloud_client(ctx) - The handler is already async, so can await the call Test fixed: - test_mcp_resources_access now passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -734,7 +734,7 @@ def get_app(transport: str = "sse", enabled_apps: list[str] | None = None):
|
|||||||
async def nc_get_capabilities():
|
async def nc_get_capabilities():
|
||||||
"""Get the Nextcloud Host capabilities"""
|
"""Get the Nextcloud Host capabilities"""
|
||||||
ctx: Context = mcp.get_context()
|
ctx: Context = mcp.get_context()
|
||||||
client = get_nextcloud_client(ctx)
|
client = await get_nextcloud_client(ctx)
|
||||||
return await client.capabilities()
|
return await client.capabilities()
|
||||||
|
|
||||||
# Define available apps and their configuration functions
|
# Define available apps and their configuration functions
|
||||||
|
|||||||
Reference in New Issue
Block a user