Purge standalone OAuth setup for Gmail and Gcal
- Deleted gmail_oauth_setup.py and gcal_oauth_setup.py (Skald handles OAuth) - Removed google-auth-oauthlib dependency from requirements.txt and connector.json - Simplified setup_instructions to point to Skald's OAuth flow - Updated docstrings and error messages in *_mcp_server.py (no more refs to *_oauth_setup.py, point to Skald OAuth / env-var instead) - connectors.json: removed oauth_setup.py from files[], updated sha256 hashes
This commit is contained in:
@@ -13,7 +13,6 @@ Capabilities (callable as `mcp__gcal__<tool>`):
|
||||
|
||||
Skald mode: Skald injects credentials via GCAL_CREDS_JSON env var (authorized_user JSON).
|
||||
Standalone mode: reads from GOOGLE_CREDS_PATH or ./secrets/google_creds.json.
|
||||
Run scripts/gcal_oauth_setup.py to (re-)authenticate (standalone).
|
||||
|
||||
Required OAuth scopes:
|
||||
https://www.googleapis.com/auth/calendar
|
||||
@@ -282,21 +281,20 @@ def _format_google_error(e: Exception, api_label: str) -> str:
|
||||
if RefreshError is not None and isinstance(e, RefreshError):
|
||||
return (
|
||||
f"Error: {api_label} API token refresh failed (the refresh token may have been revoked "
|
||||
"or expired). Re-run scripts/gcal_oauth_setup.py to re-authenticate."
|
||||
"or expired). Re-authenticate via Skald's OAuth flow (Sign in from the connector page)."
|
||||
)
|
||||
|
||||
if HttpError is not None and isinstance(e, HttpError):
|
||||
status = getattr(e, "status_code", None)
|
||||
if status == 401:
|
||||
return (
|
||||
f"Error: {api_label} API rejected the access token (401). The OAuth token is invalid "
|
||||
"or revoked. Re-run scripts/gcal_oauth_setup.py to re-authenticate."
|
||||
)
|
||||
f"Error: {api_label} API rejected the access token (401). The OAuth token is invalid "
|
||||
"or revoked. Re-authenticate via Skald's OAuth flow (Sign in from the connector page)." )
|
||||
if status == 403:
|
||||
return (
|
||||
f"Error: {api_label} API returned 403 Forbidden. The OAuth scopes granted are "
|
||||
"insufficient for this operation, or the Calendar API is disabled in the Google Cloud "
|
||||
"Console. Verify the scopes in scripts/gcal_oauth_setup.py and the API enablement."
|
||||
"Console. Verify the scopes in the Google OAuth provider config and the API enablement."
|
||||
)
|
||||
if status == 404:
|
||||
return (
|
||||
@@ -350,9 +348,8 @@ def _gcal_status(args: dict | None = None) -> str:
|
||||
except Exception as e:
|
||||
return _status_report("❌", "AUTH_OR_API_ERROR", "action needed",
|
||||
f"The Calendar API did not respond to the probe call: {_format_google_error(e, 'Calendar')}",
|
||||
["Run scripts/gcal_oauth_setup.py to refresh / re-issue credentials.",
|
||||
["Re-authenticate via Skald's OAuth flow (Sign in from the connector page).",
|
||||
"If credentials are valid, verify the Google Calendar API is enabled in the Google Cloud Console."])
|
||||
|
||||
items = result.get("items", []) if isinstance(result, dict) else []
|
||||
primary = next((c for c in items if c.get("primary")), None)
|
||||
suffix = f"\nAccount: {primary.get('id')}" if primary else ""
|
||||
|
||||
Reference in New Issue
Block a user