refactor: source OAuth proxy from shared bes-mcp-oauth package - #5
Merged
Conversation
Extract the Google OAuth proxy (oauth_proxy.py + auth.py) into the shared bes-mcp-oauth package so BES MCP servers (bes-codebases, tupaia-metadata-mcp, ...) share one implementation. Behaviour is unchanged: mcp_server imports GoogleOAuthProxyProvider from the package, and the two modules are removed here. Verified with uv sync + an import check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the Google OAuth proxy (
rag/oauth_proxy.py+rag/auth.py) into theshared
bes-mcp-oauthpackage (
v0.1.0) so every BES MCP server uses one implementation.mcp_server.pynow importsGoogleOAuthProxyProviderfrom the package, and thetwo modules are removed here. This unblocks
tupaia-metadata-mcp(and futureservers) reusing the same OAuth without copying code.
Net −476 / +14 lines: an added dependency + one import line, minus the two
relocated modules.
Test plan
uv lockresolvesbes-mcp-oauth @ v0.1.0(added; 76 packages).uv sync --no-devinstalls it from the tag.import mcp_server; from bes_mcp_oauth import GoogleOAuthProxyProvider, GoogleTokenVerifier— the provider resolves frombes_mcp_oauth.oauth_proxy, noImportError.Risk / rollback
Low — pure code relocation, no behaviour change; the package contains the same
code verbatim (only
oauth_proxy.py's internal import made package-relative).Rollback: revert this commit (restores the in-repo modules) and redeploy.