feat: add FastMCP OAuthProxy support for remote MCP server#33
Open
feat: add FastMCP OAuthProxy support for remote MCP server#33
Conversation
Adds support for running okta-mcp-server as a remote HTTP server using FastMCP's OAuthProxy, enabling browser-based Okta SSO authentication instead of device auth flow. This allows deployment as a shared service (e.g., in Docker/Kubernetes) where users authenticate via browser redirect. Changes: - server.py: Add OAuthProxy with OktaIntrospectionVerifier for streamable-http transport mode - client.py: Dual-mode auth — keyring for stdio, Bearer token from MCP auth context for HTTP mode - Dockerfile: Default to streamable-http transport, expose port 8000 - .env.example: Document new env vars (MCP_TRANSPORT, MCP_SERVER_URL, OKTA_CLIENT_SECRET) - pyproject.toml: Switch from mcp[cli] to fastmcp>=3.0.0, add httpx Closes okta#13 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
533e00f to
2648bd6
Compare
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
Adds support for running
okta-mcp-serveras a remote HTTP server using FastMCP's OAuthProxy, enabling browser-based Okta SSO authentication. This allows deployment as a shared service (e.g. Docker/Kubernetes) where users authenticate via browser redirect instead of the device auth flow.stdio(existing CLI behavior) andstreamable-http(new remote mode), controlled viaMCP_TRANSPORTenv var/oauth2/v1/authorizeand/oauth2/v1/tokenendpointsOktaIntrospectionVerifiervalidates opaque Okta access tokens via the/oauth2/v1/introspectendpointstreamable-httptransport with port 8000 exposedFiles changed
server.pyOktaIntrospectionVerifier, transport-aware lifespanclient.pyget_okta_client()— keyring vs Bearer tokenpyproject.tomlmcp[cli]→fastmcp>=3.0.0, addhttpxDockerfileMCP_TRANSPORT=streamable-http,EXPOSE 8000.env.exampleMCP_TRANSPORT,MCP_SERVER_URL,OKTA_CLIENT_SECRETTest plan
stdiomode still works unchangedMCP_TRANSPORT=streamable-httpwith Okta OAuth app configured/oauth2/v1/introspectstreamable-httptransportCloses #13
🤖 Generated with Claude Code