google-workspace-suite-mcp 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. google_workspace_suite_mcp-0.3.0/LICENSE +21 -0
  2. google_workspace_suite_mcp-0.3.0/PKG-INFO +151 -0
  3. google_workspace_suite_mcp-0.3.0/README.md +119 -0
  4. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/__init__.py +8 -0
  5. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/calendar/__init__.py +1 -0
  6. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/calendar/server.py +452 -0
  7. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/core/__init__.py +23 -0
  8. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/core/common_tools.py +51 -0
  9. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/core/runtime.py +95 -0
  10. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/core/server.py +19 -0
  11. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/docs/__init__.py +1 -0
  12. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/docs/docs_api.py +593 -0
  13. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/docs/server.py +280 -0
  14. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/drive/__init__.py +1 -0
  15. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/drive/drive_api.py +397 -0
  16. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/drive/server.py +293 -0
  17. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/gmail/__init__.py +1 -0
  18. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/gmail/server.py +509 -0
  19. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/sheets/__init__.py +1 -0
  20. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/sheets/server.py +403 -0
  21. google_workspace_suite_mcp-0.3.0/google_workspace_mcp/sheets/sheets_api.py +800 -0
  22. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/PKG-INFO +151 -0
  23. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/SOURCES.txt +34 -0
  24. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/dependency_links.txt +1 -0
  25. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/entry_points.txt +6 -0
  26. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/requires.txt +10 -0
  27. google_workspace_suite_mcp-0.3.0/google_workspace_suite_mcp.egg-info/top_level.txt +1 -0
  28. google_workspace_suite_mcp-0.3.0/pyproject.toml +52 -0
  29. google_workspace_suite_mcp-0.3.0/setup.cfg +4 -0
  30. google_workspace_suite_mcp-0.3.0/tests/test_calendar_server.py +305 -0
  31. google_workspace_suite_mcp-0.3.0/tests/test_docs_server.py +439 -0
  32. google_workspace_suite_mcp-0.3.0/tests/test_drive_server.py +412 -0
  33. google_workspace_suite_mcp-0.3.0/tests/test_gmail_server.py +341 -0
  34. google_workspace_suite_mcp-0.3.0/tests/test_integration.py +157 -0
  35. google_workspace_suite_mcp-0.3.0/tests/test_live.py +152 -0
  36. google_workspace_suite_mcp-0.3.0/tests/test_sheets_server.py +1111 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nitai Aharoni
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,151 @@
1
+ Metadata-Version: 2.4
2
+ Name: google-workspace-suite-mcp
3
+ Version: 0.3.0
4
+ Summary: Aligned MCP servers for Gmail, Calendar, Sheets, Docs, and Drive with persistent, multi-account auth
5
+ Author: Nitai Aharoni
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/nitaiaharoni1/google-workspace-mcp
8
+ Project-URL: Repository, https://github.com/nitaiaharoni1/google-workspace-mcp
9
+ Keywords: mcp,google,gmail,calendar,sheets,docs,drive,workspace,claude
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Communications :: Email
18
+ Classifier: Topic :: Office/Business
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: mcp>=1.12
23
+ Requires-Dist: google-auth-core>=0.1.0
24
+ Requires-Dist: gmail-cli-oauth>=1.5.0
25
+ Requires-Dist: google-calendar-cli>=1.6.0
26
+ Requires-Dist: google-api-python-client>=2.0.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7; extra == "dev"
29
+ Requires-Dist: pytest-anyio>=0.0.0; extra == "dev"
30
+ Requires-Dist: anyio>=4; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # google-workspace-mcp
34
+
35
+ Five aligned MCP servers for Google Workspace: **Gmail**, **Calendar**,
36
+ **Sheets**, **Docs**, and **Drive**. They share one credential store and one runtime core, so they behave
37
+ identically and support:
38
+
39
+ - **Persistent auth**: log in once; tokens are reused and access tokens refresh
40
+ silently. Server restarts never re-prompt for consent.
41
+ - **Multiple accounts in parallel**: every tool takes an `account` argument
42
+ (email or alias). Calls for different accounts use separate, cached clients and
43
+ never interfere.
44
+ - **Many operations**: ~36 Gmail tools, ~22 Calendar tools, ~41 Sheets tools (incl. text editing),
45
+ ~25 Docs tools, ~16 Drive tools, plus shared `list_accounts` / `whoami` /
46
+ `auth_status` on every server.
47
+
48
+ ## Architecture
49
+
50
+ ```
51
+ google-auth-core shared ~/.google token store + authorized-service cache
52
+ | (also used by gmail-cli and google-calendar-cli)
53
+ v
54
+ google_workspace_mcp/
55
+ core/ build_server, account resolution + warm-client cache, error
56
+ mapping, the read-only gate, the response envelope, common tools
57
+ gmail/ wraps gmail_cli.api.GmailAPI -> gmail-mcp
58
+ calendar/ wraps google_calendar_cli.api.CalendarAPI -> gcal-mcp
59
+ sheets/ SheetsAPI (Sheets API v4) -> gsheets-mcp
60
+ docs/ DocsAPI (Docs API v1) -> gdocs-mcp
61
+ drive/ DriveAPI (Drive API v3) -> gdrive-mcp
62
+ ```
63
+
64
+ Every tool: takes `account`, resolves it, gets a cached per-account client,
65
+ runs the Google call through shared error mapping, and returns
66
+ `{"ok": true, "account": "<resolved>", "data": ...}`.
67
+
68
+ ## Install
69
+
70
+ ```bash
71
+ pip install google-workspace-suite-mcp
72
+ ```
73
+
74
+ This pulls in the shared `google-auth-core` token store and the
75
+ `gmail-cli-oauth` / `google-calendar-cli` clients automatically, and installs
76
+ the five `*-mcp` console scripts (`gmail-mcp`, `gcal-mcp`, `gsheets-mcp`,
77
+ `gdocs-mcp`, `gdrive-mcp`) onto your PATH.
78
+
79
+ For local development from a clone:
80
+
81
+ ```bash
82
+ pip install -e .[dev]
83
+ ```
84
+
85
+ ## Authenticate (once)
86
+
87
+ Put your OAuth client (Desktop app) at `~/.google/credentials.json`, then:
88
+
89
+ ```bash
90
+ google-auth login you@example.com # opens a browser, writes a unified token
91
+ google-auth alias work you@example.com # optional short alias
92
+ google-auth login you@personal.com # add more accounts
93
+ google-auth list # show accounts, default, aliases
94
+ ```
95
+
96
+ A single login grants Gmail + Calendar + Sheets + Docs + Drive scopes, shared by both the CLIs
97
+ and the MCP servers.
98
+
99
+ ## Register with Claude
100
+
101
+ `claude mcp add` or a `.mcp.json` like:
102
+
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "google-gmail": { "command": "gmail-mcp" },
107
+ "google-calendar": { "command": "gcal-mcp" },
108
+ "google-sheets": { "command": "gsheets-mcp" },
109
+ "google-docs": { "command": "gdocs-mcp" },
110
+ "google-drive": { "command": "gdrive-mcp" }
111
+ }
112
+ }
113
+ ```
114
+
115
+ (On this machine they are registered at user scope with absolute venv paths, so
116
+ they are available in every project.)
117
+
118
+ Restart Claude after editing.
119
+
120
+ ## Multiple accounts
121
+
122
+ Pass `account` to any tool (omit it to use the default):
123
+
124
+ ```
125
+ list_messages(account="work", query="is:unread")
126
+ create_event(account="you@personal.com", summary="Dinner", start_time=..., end_time=...)
127
+ read_range(account="work", spreadsheet_id="...", range="Sheet1!A1:C10")
128
+ ```
129
+
130
+ ## Read-only mode
131
+
132
+ Set `GOOGLE_MCP_READONLY=1` in a server's environment to hide every mutating
133
+ tool (writes, deletes, clears) from that server. Destructive tools are also
134
+ clearly marked in their descriptions.
135
+
136
+ ## Testing
137
+
138
+ ```bash
139
+ pip install -e .[dev]
140
+ pytest # unit, protocol (in-memory), isolation, persistence
141
+ GOOGLE_MCP_LIVE=1 pytest # opt-in live smoke tests (needs a real test account)
142
+ ```
143
+
144
+ ## Notes
145
+
146
+ - Auth is out-of-band: servers are non-interactive token consumers. If a token
147
+ is missing or scope-short, a tool returns an actionable error
148
+ (`Run: google-auth login <account>`) instead of blocking the protocol.
149
+ - The five servers are packaged as one distribution with five console-script
150
+ entry points (a single `pip install`), rather than five separate packages.
151
+ Alignment comes from the shared `core`, not from separate packaging.
@@ -0,0 +1,119 @@
1
+ # google-workspace-mcp
2
+
3
+ Five aligned MCP servers for Google Workspace: **Gmail**, **Calendar**,
4
+ **Sheets**, **Docs**, and **Drive**. They share one credential store and one runtime core, so they behave
5
+ identically and support:
6
+
7
+ - **Persistent auth**: log in once; tokens are reused and access tokens refresh
8
+ silently. Server restarts never re-prompt for consent.
9
+ - **Multiple accounts in parallel**: every tool takes an `account` argument
10
+ (email or alias). Calls for different accounts use separate, cached clients and
11
+ never interfere.
12
+ - **Many operations**: ~36 Gmail tools, ~22 Calendar tools, ~41 Sheets tools (incl. text editing),
13
+ ~25 Docs tools, ~16 Drive tools, plus shared `list_accounts` / `whoami` /
14
+ `auth_status` on every server.
15
+
16
+ ## Architecture
17
+
18
+ ```
19
+ google-auth-core shared ~/.google token store + authorized-service cache
20
+ | (also used by gmail-cli and google-calendar-cli)
21
+ v
22
+ google_workspace_mcp/
23
+ core/ build_server, account resolution + warm-client cache, error
24
+ mapping, the read-only gate, the response envelope, common tools
25
+ gmail/ wraps gmail_cli.api.GmailAPI -> gmail-mcp
26
+ calendar/ wraps google_calendar_cli.api.CalendarAPI -> gcal-mcp
27
+ sheets/ SheetsAPI (Sheets API v4) -> gsheets-mcp
28
+ docs/ DocsAPI (Docs API v1) -> gdocs-mcp
29
+ drive/ DriveAPI (Drive API v3) -> gdrive-mcp
30
+ ```
31
+
32
+ Every tool: takes `account`, resolves it, gets a cached per-account client,
33
+ runs the Google call through shared error mapping, and returns
34
+ `{"ok": true, "account": "<resolved>", "data": ...}`.
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ pip install google-workspace-suite-mcp
40
+ ```
41
+
42
+ This pulls in the shared `google-auth-core` token store and the
43
+ `gmail-cli-oauth` / `google-calendar-cli` clients automatically, and installs
44
+ the five `*-mcp` console scripts (`gmail-mcp`, `gcal-mcp`, `gsheets-mcp`,
45
+ `gdocs-mcp`, `gdrive-mcp`) onto your PATH.
46
+
47
+ For local development from a clone:
48
+
49
+ ```bash
50
+ pip install -e .[dev]
51
+ ```
52
+
53
+ ## Authenticate (once)
54
+
55
+ Put your OAuth client (Desktop app) at `~/.google/credentials.json`, then:
56
+
57
+ ```bash
58
+ google-auth login you@example.com # opens a browser, writes a unified token
59
+ google-auth alias work you@example.com # optional short alias
60
+ google-auth login you@personal.com # add more accounts
61
+ google-auth list # show accounts, default, aliases
62
+ ```
63
+
64
+ A single login grants Gmail + Calendar + Sheets + Docs + Drive scopes, shared by both the CLIs
65
+ and the MCP servers.
66
+
67
+ ## Register with Claude
68
+
69
+ `claude mcp add` or a `.mcp.json` like:
70
+
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "google-gmail": { "command": "gmail-mcp" },
75
+ "google-calendar": { "command": "gcal-mcp" },
76
+ "google-sheets": { "command": "gsheets-mcp" },
77
+ "google-docs": { "command": "gdocs-mcp" },
78
+ "google-drive": { "command": "gdrive-mcp" }
79
+ }
80
+ }
81
+ ```
82
+
83
+ (On this machine they are registered at user scope with absolute venv paths, so
84
+ they are available in every project.)
85
+
86
+ Restart Claude after editing.
87
+
88
+ ## Multiple accounts
89
+
90
+ Pass `account` to any tool (omit it to use the default):
91
+
92
+ ```
93
+ list_messages(account="work", query="is:unread")
94
+ create_event(account="you@personal.com", summary="Dinner", start_time=..., end_time=...)
95
+ read_range(account="work", spreadsheet_id="...", range="Sheet1!A1:C10")
96
+ ```
97
+
98
+ ## Read-only mode
99
+
100
+ Set `GOOGLE_MCP_READONLY=1` in a server's environment to hide every mutating
101
+ tool (writes, deletes, clears) from that server. Destructive tools are also
102
+ clearly marked in their descriptions.
103
+
104
+ ## Testing
105
+
106
+ ```bash
107
+ pip install -e .[dev]
108
+ pytest # unit, protocol (in-memory), isolation, persistence
109
+ GOOGLE_MCP_LIVE=1 pytest # opt-in live smoke tests (needs a real test account)
110
+ ```
111
+
112
+ ## Notes
113
+
114
+ - Auth is out-of-band: servers are non-interactive token consumers. If a token
115
+ is missing or scope-short, a tool returns an actionable error
116
+ (`Run: google-auth login <account>`) instead of blocking the protocol.
117
+ - The five servers are packaged as one distribution with five console-script
118
+ entry points (a single `pip install`), rather than five separate packages.
119
+ Alignment comes from the shared `core`, not from separate packaging.
@@ -0,0 +1,8 @@
1
+ """Google Workspace MCP servers (Gmail, Calendar, Sheets, Docs, Drive).
2
+
3
+ Five aligned MCP servers built on a shared core. Auth, account resolution,
4
+ the response envelope, error mapping, the read-only gate, and the common tools
5
+ (list_accounts / whoami / auth_status) are identical across all five.
6
+ """
7
+
8
+ __version__ = "0.3.0"
@@ -0,0 +1 @@
1
+ """Google Calendar MCP server package."""