[PR #181] [MERGED] auth: verify MCP HTTP clients against the API key #154

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

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-terminal/pull/181
Author: @Classic298
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @tjbck

Base: main ← Head: fix/mcp-http-auth


📝 Commits (1)

  • b5abc9c auth: verify MCP HTTP clients against the API key

📊 Changes

2 files changed (+17 additions, -2 deletions)

View changed files

📝 open_terminal/mcp_server.py (+16 -1)
📝 pyproject.toml (+1 -1)

📄 Description

The MCP server now gates its HTTP transports with a token verifier that requires the connecting client to present the API key, compared with hmac.compare_digest to match the FastAPI layer. The stdio transport is local and does not pass through the HTTP auth layer, so it keeps working unchanged.

Raises the mcp extra's fastmcp floor to >=4.0.0, where the auth= verifier API used here is available (2.x exposed a different auth surface).

Verified against fastmcp 4.0.5 on the streamable-http transport: a client with no token and a client with a wrong token are both rejected, a client presenting the API key gets the full tool set, and stdio continues to list tools with no client token.


🔄 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/181 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 9/23/2026 **Status:** ✅ Merged **Merged:** 9/23/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/mcp-http-auth` --- ### 📝 Commits (1) - [`b5abc9c`](https://github.com/open-webui/open-terminal/commit/b5abc9cf29a4a4e8ee7abccc8961a3120f7bd271) auth: verify MCP HTTP clients against the API key ### 📊 Changes **2 files changed** (+17 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `open_terminal/mcp_server.py` (+16 -1) 📝 `pyproject.toml` (+1 -1) </details> ### 📄 Description The MCP server now gates its HTTP transports with a token verifier that requires the connecting client to present the API key, compared with `hmac.compare_digest` to match the FastAPI layer. The stdio transport is local and does not pass through the HTTP auth layer, so it keeps working unchanged. Raises the `mcp` extra's fastmcp floor to `>=4.0.0`, where the `auth=` verifier API used here is available (2.x exposed a different auth surface). Verified against fastmcp 4.0.5 on the `streamable-http` transport: a client with no token and a client with a wrong token are both rejected, a client presenting the API key gets the full tool set, and `stdio` continues to list tools with no client token. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:11:18 +00:00
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#154
No description provided.