mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #201] feat: stdio MCP tool servers need an env variables field in the UI (branch with fix available) #120
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @paoloviviani on GitHub (Jul 29, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/201
Description
Stdio MCP tool servers typically need environment variables for
authentication (e.g.
MAIL_TOKENfor@infomaniak/mcp-server-mail,GITHUB_TOKENfor the GitHub MCP server). The backend already supports aper-server
envdict end-to-end (CreateToolServerRequest.env,update_tool_server,MCPClient.connect_stdio(..., env, cwd)), but theAdmin → Tool Servers dialog only renders Command / Arguments / Working
Directory for
mcp_stdioservers — there is no way to enter env varsfrom the UI.
Environment
npx -y @infomaniak/mcp-server-mail(needsMAIL_TOKEN)Steps to reproduce
ikmail, commandnpx, arguments-y @infomaniak/mcp-server-mail. Note there is no env field.The server's own stderr (
Please set MAIL_TOKEN environment variable)never reaches the log or the response, so the failure is opaque.
Workarounds that do NOT work
(
Environment=MAIL_TOKEN=...in the systemd unit): the MCP Python SDKdeliberately restricts the environment a stdio child inherits to
HOME LOGNAME PATH SHELL TERM USERplus whatever is inserver.env(seemcp/client/stdio/__init__.py,get_default_environment()/env={**get_default_environment(), **server.env}).cptr's own process env is discarded, so the child never sees it.
envdirectly into the config store: works until you openthe server again in the UI and hit Save — the form always submits the
full record and, having no env field, writes
env: null, silentlywiping the value.
Expected behavior
The stdio tool server form exposes an environment variables field that
round-trips
envthrough create/edit/save, like the existing Headersfield does for HTTP servers.
Fix available
I implemented this on my fork, branch
feat/stdio-mcp-env(commit
22d96e7):Contents:
cptr/frontend/src/lib/components/Admin/ToolServers.svelte: newformEnvstate + JSON textarea on the stdio form (mirrors the Headersfield UX), JSON-object validation with a dedicated toast,
envincludedin the create/update payload so saves no longer null it out.
toolServers.env/toolServers.envHint/toolServers.envInvalid.accept
env.Verified: Prettier clean,
vite buildsucceeds,svelte-checkshows nonew diagnostics over the existing baseline, and an end-to-end verify
against
@infomaniak/mcp-server-mailwithMAIL_TOKENentered throughthe new field succeeds (20 tools listed).
(I could not open a pull request from the fork, so opening this issue
instead — happy to adjust or rebase if a maintainer wants to pick the
branch up, or to open the PR differently if preferred.)
Related
would have made this much easier to diagnose
@owui-terminator[bot] commented on GitHub (Jul 29, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #64 MCP STDIO Support
This is the foundational MCP stdio support issue and directly overlaps with the stdio tool-server workflow this bug report extends. The new issue is specifically about completing the stdio UI by adding env var support on top of the existing stdio backend/UI work.
by Classic298
🟣 #62 MCP optional extra not installed in Docker image — MCP tool servers fail silently out of the box
This issue is about MCP tool servers failing silently during Verify, which matches the user-visible symptom described here (generic 400 / opaque failure). While the root cause differs, it is closely related because both concern diagnosing stdio/MCP verify failures and improving usability.
by root-hal9000
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@tjbck commented on GitHub (Jul 31, 2026):
Addressed!