[PR #120] fix: mcp stdio transport crashes with unexpected 'host' keyword argument #129

Open
opened 2026-10-18 21:11:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-terminal/pull/120
Author: @Heliopause0916
Created: 5/5/2026
Status: 🔄 Open

Base: main ← Head: fix/mcp-empty-auth-header-issue-115


📝 Commits (3)

  • 89f666d fix: mcp command sends empty Authorization header (#115)
  • 214d0a4 fix(cli): skip host/port resolution for stdio transport in MCP command
  • 16dbe8b fix(mcp): allow stdio transport without explicit API key

📊 Changes

3 files changed (+79 additions, -3 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 README.md (+31 -0)
📝 open_terminal/cli.py (+45 -3)

📄 Description

Fixes Bug 2 from #115 — stdio transport crashes with TypeError: TransportMixin.run_stdio_async() got an unexpected keyword argument 'host'

This is a follow-up fix to PR #116, which addressed the empty Authorization header issue but left the stdio transport crash unresolved.

Problem

When running open-terminal mcp --transport stdio, the command crashes with:

TypeError: TransportMixin.run_stdio_async() got an unexpected keyword argument 'host'

Root cause: The mcp_server.run() call unconditionally passes host and port arguments regardless of the transport type. FastMCP's stdio transport does not accept these parameters.

# Before: Always passes host/port
mcp_server.run(transport=transport, host=host, port=port)

Solution

Conditionally pass host and port only for non-stdio transports:

# Only resolve host/port for non-stdio transport modes
if transport != "stdio":
    host = host or cfg.get("host", "0.0.0.0")
    port = port if port is not None else cfg.get("port", 8000)

# ... (API key resolution logic) ...

# Conditionally call run() with appropriate parameters
if transport == "stdio":
    mcp_server.run(transport="stdio")
else:
    mcp_server.run(transport=transport, host=host, port=port)

Testing

Verified on Windows:

# stdio transport - now works correctly
open-terminal mcp --transport stdio --api-key test123

# streamable-http transport - still works as expected  
open-terminal mcp --transport streamable-http --host 0.0.0.0 --port 9000 --api-key test123
  • Fixes #115 (Bug 2 - stdio transport crash)
  • Builds on #116 which fixed Bug 1 (empty Authorization header)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-terminal/pull/120 **Author:** [@Heliopause0916](https://github.com/Heliopause0916) **Created:** 5/5/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/mcp-empty-auth-header-issue-115` --- ### 📝 Commits (3) - [`89f666d`](https://github.com/open-webui/open-terminal/commit/89f666d15d46bb99de2d8a27e174784d4b78a2b5) fix: mcp command sends empty Authorization header (#115) - [`214d0a4`](https://github.com/open-webui/open-terminal/commit/214d0a47426a70424ba6496e1c4368673ad75599) fix(cli): skip host/port resolution for stdio transport in MCP command - [`16dbe8b`](https://github.com/open-webui/open-terminal/commit/16dbe8be3debcee3d590608b967558323f35c711) fix(mcp): allow stdio transport without explicit API key ### 📊 Changes **3 files changed** (+79 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `README.md` (+31 -0) 📝 `open_terminal/cli.py` (+45 -3) </details> ### 📄 Description Fixes **Bug 2** from #115 — stdio transport crashes with `TypeError: TransportMixin.run_stdio_async() got an unexpected keyword argument 'host'` This is a follow-up fix to PR #116, which addressed the empty Authorization header issue but left the stdio transport crash unresolved. ## Problem When running `open-terminal mcp --transport stdio`, the command crashes with: ``` TypeError: TransportMixin.run_stdio_async() got an unexpected keyword argument 'host' ``` **Root cause**: The `mcp_server.run()` call unconditionally passes `host` and `port` arguments regardless of the transport type. FastMCP's stdio transport does not accept these parameters. ```python # Before: Always passes host/port mcp_server.run(transport=transport, host=host, port=port) ``` ## Solution Conditionally pass `host` and `port` only for non-stdio transports: ```python # Only resolve host/port for non-stdio transport modes if transport != "stdio": host = host or cfg.get("host", "0.0.0.0") port = port if port is not None else cfg.get("port", 8000) # ... (API key resolution logic) ... # Conditionally call run() with appropriate parameters if transport == "stdio": mcp_server.run(transport="stdio") else: mcp_server.run(transport=transport, host=host, port=port) ``` ## Testing Verified on Windows: ```bash # stdio transport - now works correctly open-terminal mcp --transport stdio --api-key test123 # streamable-http transport - still works as expected open-terminal mcp --transport streamable-http --host 0.0.0.0 --port 9000 --api-key test123 ``` ## Related - Fixes #115 (Bug 2 - stdio transport crash) - Builds on #116 which fixed Bug 1 (empty Authorization header) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/open-terminal#129
No description provided.