mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #116] fix: mcp command always sends empty Authorization header, causing 401 on all tool calls #126
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#126
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/116
Author: @Varshith-JV-1410
Created: 4/23/2026
Status: 🔄 Open
Base:
main← Head:fix/mcp-empty-auth-header-issue-115📝 Commits (2)
89f666dfix: mcp command sends empty Authorization header (#115)8fa2930docs: add MCP server section to README📊 Changes
4 files changed (+54 additions, -1 deletions)
View changed files
📝
.gitignore(+3 -0)➖
.python-version(+0 -1)📝
README.md(+31 -0)📝
open_terminal/cli.py(+20 -0)📄 Description
Summary
Fixes Bug 1 from #115: the
mcpcommand always sent an emptyAuthorization: Bearerheader, causing every internal FastAPI tool call to return 401.Root Cause
env.pycapturesAPI_KEYat module-import time. ThemcpCLI command had no--api-keyoption and never setOPEN_TERMINAL_API_KEYin the environment before importingmcp_server, soAPI_KEYwas always"".The
runcommand works correctly because it explicitly setsos.environ["OPEN_TERMINAL_API_KEY"]before anything reads it. Themcpcommand had no equivalent step.Fix
--api-key/OPEN_TERMINAL_API_KEYClick option to themcpcommand, mirroring theruncommand._FILEDocker secret → config file.os.environ["OPEN_TERMINAL_API_KEY"]before the deferredfrom open_terminal.mcp_server import mcpsoenv.pycaptures the correct value at import time.Testing
Verified locally on Windows:
All MCP tool calls succeed with exit code 0.
Authorization: Bearer 12345678confirmed in the httpx client headers.Also works via env var and config file.
Closes #115 (Bug 1)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.