Commit Graph

928 Commits

Author SHA1 Message Date
Taylor Wilsdon
39bea59f40 Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp into yairwein/main 2025-11-02 08:03:32 -05:00
Taylor Wilsdon
519434e7bd Merge pull request #249 from loserbcc/fix/gmail-from-header-bug
Fix: Gmail send_message now respects user_google_email for From header
2025-11-02 08:01:14 -05:00
Taylor Wilsdon
c45ddeba7e Update README.md 2025-11-01 19:59:49 -04:00
LoserBcc
2d4a2baefd Fix: Gmail send_message now respects user_google_email for From header
## Problem
Emails sent via send_gmail_message were always showing as from a default
user account regardless of which account was specified in the
user_google_email parameter.

## Root Cause
The _prepare_gmail_message() function was not setting the From header in
the MIME message. Gmail API defaults to the primary send-as address when
no From header is provided.

## Solution
- Added from_email parameter to _prepare_gmail_message()
- Set From header explicitly: message["From"] = from_email
- Updated send_gmail_message() to pass user_google_email as from_email
- Updated draft_gmail_message() to pass user_google_email as from_email
- Capitalized MIME headers (Subject, From, To, Cc, Bcc) per conventions

## Testing
Verified emails now correctly show sender address for multiple accounts.
Each account now properly displays its own address in the From field.

Fixes multi-account email sending functionality.
2025-10-24 21:40:36 -04:00
Yair Weinberger
241f0987ae feat: add external OAuth 2.1 provider mode for bearer token authentication
Add support for external OAuth 2.1 provider mode where authentication
is handled by external systems that issue Google OAuth access tokens.

**Changes:**

1. **New Environment Variable: `EXTERNAL_OAUTH21_PROVIDER`**
   - Enables external OAuth mode when set to `true`
   - Requires `MCP_ENABLE_OAUTH21=true`
   - Disables protocol-level auth (MCP handshake/tools list work without auth)
   - Requires bearer tokens in Authorization headers for tool calls

2. **New File: `auth/external_oauth_provider.py`**
   - Custom provider extending FastMCP's GoogleProvider
   - Handles ya29.* Google OAuth access tokens
   - Validates tokens via google-auth library + userinfo API
   - Returns properly formatted AccessToken objects

3. **Modified: `auth/oauth_config.py`**
   - Add `external_oauth21_provider` config option
   - Validation that external mode requires OAuth 2.1
   - Helper methods for checking external provider mode

4. **Modified: `core/server.py`**
   - Use ExternalOAuthProvider when external mode enabled
   - Use standard GoogleProvider otherwise
   - Set server.auth = None for external mode (no protocol auth)

5. **Modified: `README.md`**
   - New "External OAuth 2.1 Provider Mode" section
   - Usage examples and configuration
   - Added to environment variables table

**How It Works:**
- MCP handshake and tools/list do NOT require authentication
- Tool calls require `Authorization: Bearer ya29.xxx` headers
- Tokens validated by calling Google's userinfo API
- Multi-user support via per-request authentication
- Stateless-compatible for containerized deployments

**Use Cases:**
- Integrating with existing authentication systems
- Custom OAuth flows managed by your application
- API gateways handling authentication upstream
- Multi-tenant SaaS with centralized auth
- Mobile/web apps with their own OAuth implementation

**Example Configuration:**
```bash
export MCP_ENABLE_OAUTH21=true
export EXTERNAL_OAUTH21_PROVIDER=true
export GOOGLE_OAUTH_CLIENT_ID=your_client_id
export GOOGLE_OAUTH_CLIENT_SECRET=your_client_secret
export WORKSPACE_MCP_STATELESS_MODE=true  # Optional
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:43:29 +03:00
Taylor Wilsdon
95d5c8b4ad remove mcpo 2025-10-19 16:18:42 -04:00
Taylor Wilsdon
d4b7cab7ab update dxt 2025-10-19 16:17:06 -04:00
Taylor Wilsdon
8adc7527dd Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp 2025-10-19 15:33:02 -04:00
Taylor Wilsdon
1caecee035 Merge pull request #239 from shawnzhu/fix/file-download-upload
enh: tempfile downloads to save memory in non-stateless mode
2025-10-19 14:25:34 -04:00
Taylor Wilsdon
33a0938fb5 use that var 2025-10-19 14:24:06 -04:00
Taylor Wilsdon
e35973c14d Wrapped the in-memory download path with MediaIoBaseUpload so Drive receives a proper upload object even when stateless (gdrive/drive_tools.py:296). Keep the Content-Type override synced by updating mime_type before constructing the uploader 2025-10-19 14:18:06 -04:00
Taylor Wilsdon
52edcd4172 address review feedback 2025-10-19 14:14:20 -04:00
Taylor Wilsdon
bfb8cb40a3 Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp into fix/file-download-upload 2025-10-19 14:10:28 -04:00
Taylor Wilsdon
3e48fdb683 bump pyproject.toml 2025-10-19 14:09:55 -04:00
Shawn Zhu
d613dc204c supports redirects for downloading file 2025-10-19 12:02:16 -04:00
Shawn Zhu
2b50b4caa0 do not use tmp file during stateless mode 2025-10-19 11:59:56 -04:00
Taylor Wilsdon
582195b6be Merge pull request #240 from taylorwilsdon/timezones_n_stuff
timezone awareness handling improvements and tasks fix
2025-10-18 14:22:26 -04:00
Taylor Wilsdon
b0f04eff69 more feedback 2025-10-18 13:44:31 -04:00
Taylor Wilsdon
f70da12dfd review comments 2025-10-18 13:19:24 -04:00
Taylor Wilsdon
33b41a59d8 timezone awareness handling improvements and tasks fix 2025-10-18 13:01:43 -04:00
Taylor Wilsdon
a995fa4fde fastmcp specific deployment 2025-10-17 18:20:38 -04:00
Shawn Zhu
b91ed69914 address review comment 2025-10-17 12:59:10 -04:00
Shawn
811e17e167 Update gdrive/drive_tools.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-17 12:58:31 -04:00
Shawn
f4a3d3cafe Update gdrive/drive_tools.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-17 12:57:04 -04:00
Taylor Wilsdon
f611c00091 Merge pull request #232 from accorvin/calendar-event-attachments
Add attachment details support to calendar events
2025-10-17 12:18:32 -04:00
Shawn Zhu
67331a766d fix: improves file download 2025-10-16 21:13:42 -04:00
Taylor Wilsdon
b373e12e5b Update gcalendar/calendar_tools.py 2025-10-15 16:17:56 -04:00
Taylor Wilsdon
7a70bfefd4 Merge pull request #234 from luutuankiet/feat/gmail_create_draft_html_type
chore: Gmail tool enable html message for `draft_gmail_message`
2025-10-13 15:47:01 -04:00
luutuankiet
7ef0c2503a chore: port same html arguments to draft_gmail_message 2025-10-13 12:15:18 +07:00
Taylor Wilsdon
31e6987010 update dxt 2025-10-12 09:59:25 -04:00
Alex Corvin
4fbddb6c42 Add attachment details support to calendar events
Enhance the get_events function to include detailed attachment information
when include_attachments=True, including:
- File ID (fileId)
- File URL (fileUrl)
- MIME type (mimeType)
- File title

Changes:
- Add _format_attachment_details() helper function following existing code patterns
- Add include_attachments parameter to get_events() (defaults to False)
- Update get_events() to display attachment details in both single and multiple event detailed views
- Maintain backward compatibility - attachments only shown when include_attachments=True and detailed=True
- Update function docstring with comprehensive documentation for LLM usage

Resolves #231

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 09:42:50 -04:00
Taylor Wilsdon
577bfafb7c chore: release v1.5.2 2025-10-07 18:01:21 -04:00
Taylor Wilsdon
24101902f1 version 2025-10-07 18:01:17 -04:00
Taylor Wilsdon
0adab0cdd7 cleanup 2025-10-07 18:01:06 -04:00
Taylor Wilsdon
ad198ef2a9 dxt 2025-10-07 17:56:03 -04:00
Taylor Wilsdon
a624d3661c chore: release v1.5.1 2025-10-07 17:54:59 -04:00
Taylor Wilsdon
bc711bc606 version 2025-10-07 17:54:56 -04:00
Taylor Wilsdon
d3a06aac38 gtasks fix 2025-10-07 17:54:35 -04:00
Taylor Wilsdon
1c7354cb5e update dxt 2025-10-07 14:33:08 -04:00
Taylor Wilsdon
91ec3c6947 chore: release v1.5.0 2025-10-07 14:31:38 -04:00
Taylor Wilsdon
7269a1042a Merge pull request #229 from accorvin/google-calendar-responses
Add attendee response status and details to calendar events
2025-10-07 13:55:44 -04:00
Alex Corvin
158780ab10 Add attendee response status and details to calendar events
Enhance the get_events function to include detailed attendee information
when detailed=True, including:
- Response status (accepted/declined/tentative/needsAction)
- Organizer flag
- Optional attendee flag

Changes:
- Add _format_attendee_details() helper function following existing code patterns
- Update get_events() to display attendee details in both single and multiple event views
- Maintain backward compatibility - new field only shown in detailed mode
- Update function docstring to document new attendee details

Resolves #228

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 13:15:45 -04:00
Taylor Wilsdon
26981cac24 Merge pull request #227 from benjaminjackson/main
feat(gcalendar): Add event transparency option
2025-10-07 12:50:01 -04:00
Taylor Wilsdon
8fcedefa6e refactor into helper function 2025-10-07 12:30:49 -04:00
Taylor Wilsdon
c64cfd6866 Merge pull request #225 from taylorwilsdon/auth_simplification
feat: FastMCP Native OAuth 2.1 Provider Support
2025-10-07 11:48:43 -04:00
Taylor Wilsdon
43fed1741e fix ruff return groups 2025-10-07 10:30:05 -04:00
Taylor Wilsdon
03297f0670 prune dependency groups 2025-10-07 09:57:50 -04:00
Taylor Wilsdon
8f4bcad3a6 prune dependency groups 2025-10-07 09:57:31 -04:00
Taylor Wilsdon
b8703d229a refactor pyproject.toml to best practices, chunk out runtime dependencies from dev dependencies 2025-10-07 09:50:23 -04:00
Benjamin Jackson
148127e364 feat(gcalendar): Add event transparency option
- Add 'transparency' parameter to create_event and modify_event functions
- Supports 'opaque' (Busy) and 'transparent' (Available/Free) modes
- Validates input and logs transparency setting or warning
- Defaults to None, preserving existing Google Calendar behavior

Provides more granular control over event scheduling and visibility.
2025-10-06 19:15:53 -04:00