Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ jobs:
run: |
tail data/nextcloud.log

- name: Show context_chat logs
- name: Show context_agent logs
if: always()
run: |
[ -f ${{ env.APP_NAME }}/logs ] && cat ${{ env.APP_NAME }}/logs || echo "No context_chat logs"
Expand Down
3 changes: 2 additions & 1 deletion ex_app/lib/mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from fastmcp.server.dependencies import get_context
from nc_py_api import AsyncNextcloudApp, NextcloudApp
from fastmcp.server.middleware import Middleware, MiddlewareContext, CallNext
from fastmcp.server.dependencies import get_http_headers
from fastmcp.tools import Tool
from mcp import types as mt
from ex_app.lib.tools import get_tools
Expand All @@ -30,7 +31,7 @@ def get_user(authorization_header: str, nc: AsyncNextcloudApp) -> str:
class UserAuthMiddleware(Middleware):
async def on_message(self, context: MiddlewareContext, call_next):
# Middleware stores user info in context state
authorization_header = context.fastmcp_context.request_context.request.headers.get("Authorization")
authorization_header = get_http_headers().get("authorization")
if authorization_header is None:
raise Exception("Authorization header is missing/invalid")
nc = AsyncNextcloudApp()
Expand Down
Loading
Loading