feat: add environment variable support for MCP connection strings#131
Conversation
Summary by CodeRabbit
WalkthroughA new method, Changes
Sequence Diagram(s)sequenceDiagram
participant Main
participant Config
participant Env
Main->>Config: ReadKeys()
Main->>Config: ReadMCPKeys()
Config->>Env: Lookup env variables for MCP clients
Env-->>Config: Return values or errors
Config-->>Main: Return success or error
Main->>Main: Log warning if error
Poem
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
transports/bifrost-http/lib/config.go(2 hunks)transports/bifrost-http/main.go(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
transports/bifrost-http/lib/config.go (1)
core/schemas/mcp.go (1)
MCPConfig(6-9)
🔇 Additional comments (2)
transports/bifrost-http/lib/config.go (1)
7-7: LGTM - Import addition is appropriate.The
fmtimport is correctly added to support the error formatting in the newReadMCPKeys()method.transports/bifrost-http/main.go (1)
158-160: LGTM - Clean integration following established patterns.The integration of
ReadMCPKeys()is well-implemented:
- Correctly placed after
account.ReadKeys()- Uses appropriate warning-level logging for non-fatal errors
- Allows the application to continue running even if MCP environment variables are missing
- Follows the same error handling pattern as the account key processing above
# Add environment variable support for MCP connection strings This PR adds functionality to read environment variables for MCP connection strings in the Bifrost HTTP transport. The implementation: - Adds a new `ReadMCPKeys()` method to the `BifrostHTTPConfig` struct - Allows connection strings prefixed with "env." to be replaced with values from environment variables - Processes each MCP client configuration and updates connection strings accordingly - Returns appropriate error messages when required environment variables are missing - Integrates the new functionality in the main application flow This enhancement provides a more secure way to handle sensitive connection information by keeping it out of configuration files.

Add environment variable support for MCP connection strings
This PR adds functionality to read environment variables for MCP connection strings in the Bifrost HTTP transport. The implementation:
ReadMCPKeys()method to theBifrostHTTPConfigstructThis enhancement provides a more secure way to handle sensitive connection information by keeping it out of configuration files.