Skip to content

feat: SaaS handling of MCP/SDK#1358

Open
mfortman11 wants to merge 4 commits intorelease-saas-0.1from
mcp-ibm
Open

feat: SaaS handling of MCP/SDK#1358
mfortman11 wants to merge 4 commits intorelease-saas-0.1from
mcp-ibm

Conversation

@mfortman11
Copy link
Copy Markdown
Contributor

@mfortman11 mfortman11 commented Apr 8, 2026

This pull request introduces support for IBM authentication as an alternative to API key authentication throughout the OpenRAG codebase. It updates configuration handling, client instantiation, and authentication logic to enable seamless use of IBM credentials when the IBM_AUTH_ENABLED environment variable is set. The changes ensure that API key requirements are relaxed when IBM authentication is available, and headers are constructed dynamically based on the authentication method in use.

Authentication logic updates:

  • The authentication dependency in src/dependencies.py now accepts IBM authentication via the X-IBM-LH-Credentials and Authorization: Bearer <jwt> headers when IBM_AUTH_ENABLED is set, constructing the User object accordingly.

Configuration and client improvements:

  • The Config class in sdks/mcp/src/openrag_mcp/config.py no longer requires an API key if IBM authentication is enabled, and dynamically builds headers to include the API key only when present. [1] [2]
  • The get_openrag_client function now instantiates the OpenRAGClient with the API key from the config, supporting cases where the API key may be absent due to IBM authentication.
  • The OpenRAGClient in sdks/python/openrag_sdk/client.py no longer raises an error if the API key is missing, and its headers property only adds the X-API-Key header when an API key is available, supporting IBM authentication scenarios. [1] [2]

@github-actions github-actions bot added community backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) labels Apr 8, 2026
@github-actions github-actions bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Apr 8, 2026
def __init__(self):
self.openrag_url = os.environ.get("OPENRAG_URL", "http://localhost:3000")
self.api_key = os.environ.get("OPENRAG_API_KEY")
ibm_auth_enabled = _parse_bool("IBM_AUTH_ENABLED", False)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the tricky part since MCP app / pip install would not know about IBM Auth.
how about we handle it wrt to keys/ variables provided.
lets connect async on it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the X-USERNAME etc?

@github-actions github-actions bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) community enhancement 🔵 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants