clever-window-69122
10/27/2025, 5:41 AMGET /secrets, which returns the secret names and metadata (but not the actual values).
I’m trying to figure out how these secrets can be made available to MCP servers that OpenHands connects to — for example, I have some LLM API keys saved as secrets, and I’d like to pass them as parameters to MCP tools so that they can use the user’s custom API keys.
Right now, it seems those secrets aren’t accessible for the MCP context. Is there a recommended pattern or feature to support this use case?
Thanks!wooden-umbrella-84098
10/27/2025, 1:07 PMclever-window-69122
10/27/2025, 4:44 PM@mcp.tool()
def tool1(azure_openai_key: str = None):
...
The intent is that when OpenHands invokes this tool, the azure_openai_key parameter should be automatically populated using the corresponding secret stored in OpenHands (which I’ve already added through the “Secrets” UI).
However, what seems to be happening is that the key either gets masked or isn’t fully passed through to the MCP process — meaning my MCP server receives a truncated or hidden version of the key (e.g., sk-****abcd), which results in connection/authentication errors when the tool tries to use it.
So my question is:
What’s the correct or recommended way for a custom MCP server to access these secrets when its tools depend on them?
Ideally, I’d like to be able to use the secrets that are already configured in OpenHands, rather than hardcoding or duplicating them in the MCP server environment. But right now, it looks like the MCP process doesn’t receive the actual unmasked secret value at runtime.wooden-umbrella-84098
10/27/2025, 5:25 PMwooden-umbrella-84098
10/27/2025, 5:26 PMclever-window-69122
10/27/2025, 5:49 PMwooden-umbrella-84098
10/27/2025, 6:43 PMwooden-umbrella-84098
10/27/2025, 6:43 PMwooden-umbrella-84098
10/27/2025, 6:43 PMcurl -H "Authorization: $GITHUB_TOKEN", it works just finewooden-umbrella-84098
10/27/2025, 6:43 PMecho $GITHUB_TOKEN to see what the token is, so it can manually pass it to the tool call. And we mask it in that case to prevent leaking it to the LLMwooden-umbrella-84098
10/27/2025, 6:44 PMwooden-umbrella-84098
10/27/2025, 6:44 PMstaging-key and prod-keywooden-umbrella-84098
10/27/2025, 6:44 PMclever-window-69122
10/27/2025, 8:06 PM.txt or .json files within the workspace environment, but when the agent itself tries to read them, that’s when the masking kicks in and the real values aren’t accessible.
I get that this isn’t supported today, but I'm curious if there are any plans for a “user-provided secret passthrough” — something that would let MCP tools securely use per-user credentials without embedding them directly?wooden-umbrella-84098
10/27/2025, 9:10 PMwooden-umbrella-84098
10/27/2025, 9:10 PMwooden-umbrella-84098
10/27/2025, 9:10 PMwooden-umbrella-84098
10/27/2025, 9:10 PMwooden-umbrella-84098
10/27/2025, 9:10 PMclever-window-69122
10/27/2025, 9:12 PMwooden-umbrella-84098
10/27/2025, 9:15 PMwooden-umbrella-84098
10/27/2025, 9:15 PMwooden-umbrella-84098
10/27/2025, 9:15 PMclever-window-69122
10/27/2025, 9:20 PMwooden-umbrella-84098
10/27/2025, 9:23 PMwooden-umbrella-84098
10/27/2025, 9:23 PMenvwooden-umbrella-84098
10/27/2025, 9:24 PMwooden-umbrella-84098
10/27/2025, 9:25 PMclever-window-69122
10/27/2025, 9:28 PM