-
Notifications
You must be signed in to change notification settings - Fork 464
fix: respect account selection in MCP server and CLI --account flag #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@googleworkspace/cli": patch | ||
| --- | ||
|
|
||
| Fix multi-account selection: MCP server now respects `GOOGLE_WORKSPACE_CLI_ACCOUNT` env var (#221), and `--account` flag before service name no longer causes parse errors (#181) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -814,7 +814,8 @@ async fn execute_mcp_method( | |
| }; | ||
|
|
||
| let scopes: Vec<&str> = crate::select_scope(&method.scopes).into_iter().collect(); | ||
| let (token, auth_method) = match crate::auth::get_token(&scopes, None).await { | ||
| let account = std::env::var("GOOGLE_WORKSPACE_CLI_ACCOUNT").ok(); | ||
| let (token, auth_method) = match crate::auth::get_token(&scopes, account.as_deref()).await { | ||
|
Comment on lines
+817
to
+818
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly makes the MCP server respect the Currently, if a user runs For A potential solution would involve:
Without this, the behavior of the |
||
| Ok(t) => (Some(t), crate::executor::AuthMethod::OAuth), | ||
| Err(e) => { | ||
| eprintln!( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.