Commit Graph

1006 Commits

Author SHA1 Message Date
Taylor Wilsdon
f9fdb94529 add streamable http check 2025-11-10 11:13:47 -05:00
Taylor Wilsdon
9f969f05a5 ruff 2025-11-10 11:03:44 -05:00
Taylor Wilsdon
b3efc76399 address feedback 2025-11-10 11:03:38 -05:00
Taylor Wilsdon
4c92a542da Merge pull request #266 from benjaminjackson/fix/add-to-cc-metadata-fields
fix(gmail): add To and Cc fields to message metadata responses
2025-11-10 10:56:16 -05:00
Taylor Wilsdon
d8c0e719df Merge pull request #268 from cfdude/feat/update-drive-file-tool
feat(drive): add update_drive_file tool for comprehensive file metadata management
2025-11-10 10:55:49 -05:00
Taylor Wilsdon
902ca92bb6 address feedback 2025-11-10 10:54:38 -05:00
Yair Weinberger
12e2be0807 feat: Add support for file:// URLs in create_drive_file
Added ability to upload local files to Google Drive using file:// URL scheme
in the create_drive_file tool. This enables uploading files from /tmp and
other local paths without requiring HTTP/HTTPS hosting.

Changes:
- Added urllib.parse.urlparse and pathlib.Path imports
- Detect file:// URLs and read directly from local filesystem
- Validate file exists before attempting upload
- Updated docstring to reflect support for file://, http://, and https://
- Added error handling for unsupported URL schemes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 17:12:26 +00:00
Rob Sherman
541677388b feat(drive): implement update_drive_file function with OAuth scope fix
- Added comprehensive update_drive_file function to modify Google Drive file metadata
- Fixed OAuth scope issue by using 'drive_file' instead of non-existent 'drive_write'
- Supports moving files, renaming, updating descriptions, managing sharing permissions
- Includes support for custom properties and file status (starred/trashed)
- Updated README.md and tool_tiers.yaml documentation
- Successfully tested with all parameters

Fixes #220 (OAuth stdio mode authentication issues)
2025-11-05 22:58:44 -08:00
Benjamin Jackson
ca61416acb fix(gmail): add To and Cc fields to message metadata responses
Previously, the metadataHeaders parameter only requested Subject and
From fields from the Gmail API, even though To and Cc are standard
metadata fields. This updates all metadata API calls to include To
and Cc in both single message and batch operations.

Changes:
- Updated metadataHeaders to include To, Cc in all API calls
- Extended _extract_headers() calls to request To, Cc
- Updated response formatting to display To, Cc fields
- Handles missing To/Cc gracefully with empty strings
- Updated docstrings to reflect new fields in responses

Affected functions:
- get_gmail_message_content() (gmail/gmail_tools.py:369-457)
- get_gmail_messages_content_batch() (gmail/gmail_tools.py:463-638)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 16:40:04 -05:00
Taylor Wilsdon
c7b1a633d1 Merge pull request #264 from taylorwilsdon/all_drive_support
enh: All Drive API operations now include supportsAllDrives=True
2025-11-04 11:20:35 -05:00
Taylor Wilsdon
332bc9c9ae Update README.md 2025-11-04 11:17:00 -05:00
Taylor Wilsdon
9b873092b2 remove alldrives from comments 2025-11-04 11:02:20 -05:00
Taylor Wilsdon
01a0de105a trailing comma 2025-11-04 10:39:53 -05:00
Taylor Wilsdon
8363ae1c06 add additional bits 2025-11-04 10:36:49 -05:00
Taylor Wilsdon
24d79ab470 All Drive API operations now include supportsAllDrives=True 2025-11-04 10:19:37 -05:00
Taylor Wilsdon
7ac9087939 Update README.md 2025-11-03 12:21:20 -05:00
Taylor Wilsdon
2fc133ec5a Update README.md 2025-11-03 12:20:42 -05:00
Taylor Wilsdon
a9625dd71a update dxt 2025-11-02 08:44:08 -05:00
Taylor Wilsdon
e9e8c40ab7 chore: release v1.5.4 2025-11-02 08:43:15 -05:00
Taylor Wilsdon
ee6242627b bump vers 2025-11-02 08:43:06 -05:00
Taylor Wilsdon
6691de4ccf chore: release v1.5.3 2025-11-02 08:42:57 -05:00
Taylor Wilsdon
64d4050bda Merge pull request #237 from olivermdb/fix-gmail-attachment-ephemeral-ids
Add Gmail attachment support with ephemeral ID handling
2025-11-02 08:40:18 -05:00
Taylor Wilsdon
3b9805a5b7 Merge pull request #248 from yairwein/main
feat: add external OAuth 2.1 provider mode for bearer token authentic…
2025-11-02 08:04:29 -05:00
Taylor Wilsdon
6833ebd70b populate synthetic token object 2025-11-02 08:03:50 -05:00
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
ec41ba18c9 fix type hints 2025-10-23 14:49:47 -04:00
Taylor Wilsdon
a14ee47ee8 Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp into fix-gmail-attachment-ephemeral-ids 2025-10-23 14:39:55 -04: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