Merge pull request #423 from gpminsuk/feat/server-instructions-user-email

feat: Add USER_GOOGLE_EMAIL to server instructions for single-user mode
This commit is contained in:
Taylor Wilsdon
2026-03-03 17:54:12 -05:00
committed by GitHub
2 changed files with 113 additions and 0 deletions

View File

@@ -100,9 +100,18 @@ class SecureFastMCP(FastMCP):
return app
# Build server instructions with user email context for single-user mode
_server_instructions = None
if USER_GOOGLE_EMAIL:
_server_instructions = f"""Connected Google account: {USER_GOOGLE_EMAIL}
When using Google Workspace tools, always use `{USER_GOOGLE_EMAIL}` as the `user_google_email` parameter. Do not ask the user for their email address."""
logger.info(f"Server instructions configured for user: {USER_GOOGLE_EMAIL}")
server = SecureFastMCP(
name="google_workspace",
auth=None,
instructions=_server_instructions,
)
# Add the AuthInfo middleware to inject authentication into FastMCP context