Merge branch 'main' of https://github.com/taylorwilsdon/google_workspace_mcp into feature/add-host-argument

This commit is contained in:
Taylor Wilsdon
2026-02-01 11:06:04 -05:00
7 changed files with 142 additions and 27 deletions

11
main.py
View File

@@ -125,6 +125,11 @@ def main():
default="stdio",
help="Transport mode: stdio (default) or streamable-http",
)
parser.add_argument(
"--read-only",
action="store_true",
help="Run in read-only mode - requests only read-only scopes and disables tools requiring write permissions",
)
args = parser.parse_args()
# Set port and base URI once for reuse throughout the function
@@ -146,6 +151,8 @@ def main():
safe_print(f" 🔗 URL: {display_url}")
safe_print(f" 🔐 OAuth Callback: {display_url}/oauth2callback")
safe_print(f" 👤 Mode: {'Single-user' if args.single_user else 'Multi-user'}")
if args.read_only:
safe_print(" 🔒 Read-Only: Enabled")
safe_print(f" 🐍 Python: {sys.version.split()[0]}")
safe_print("")
@@ -258,9 +265,11 @@ def main():
wrap_server_tool_method(server)
from auth.scopes import set_enabled_tools
from auth.scopes import set_enabled_tools, set_read_only
set_enabled_tools(list(tools_to_import))
if args.read_only:
set_read_only(True)
safe_print(
f"🛠️ Loading {len(tools_to_import)} tool module{'s' if len(tools_to_import) != 1 else ''}:"