When configuring tool servers via the web UI, trailing slashes are stripped from all URLs—including MCP servers. For MCP servers, the trailing slash can be significant: some servers (e.g., Bitrix24) require a specific path format, and removing the slash causes a 301 redirect that loses authentication headers, resulting in a 400 Bad Request error.
Changes
Only strip trailing slashes for openapi type tool servers (where path construction appends specific endpoints like /openapi.json). MCP server URLs are used as-is by the MCP client and should preserve the user's exact input.
Before
https://api.example.com/mcp/ → https://api.example.com/mcp (slash removed)
→ 301 Moved Permanently → loses auth headers → 400 Bad Request
After
https://api.example.com/mcp/ → https://api.example.com/mcp/ (preserved)
→ 200 OK
🔄 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-webui/pull/21338
**Author:** [@shtse8](https://github.com/shtse8)
**Created:** 2/12/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/mcp-preserve-trailing-slash`
---
### 📝 Commits (1)
- [`98b8290`](https://github.com/open-webui/open-webui/commit/98b8290d5b6196d48414fefc03b4b5cc5baabaee) fix: preserve trailing slash in MCP server URLs
### 📊 Changes
**1 file changed** (+4 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/AddToolServerModal.svelte` (+4 -2)
</details>
### 📄 Description
## Summary
When configuring tool servers via the web UI, trailing slashes are stripped from all URLs—including MCP servers. For MCP servers, the trailing slash can be significant: some servers (e.g., Bitrix24) require a specific path format, and removing the slash causes a **301 redirect** that loses authentication headers, resulting in a **400 Bad Request** error.
## Changes
Only strip trailing slashes for `openapi` type tool servers (where path construction appends specific endpoints like `/openapi.json`). MCP server URLs are used as-is by the MCP client and should preserve the user's exact input.
### Before
```
https://api.example.com/mcp/ → https://api.example.com/mcp (slash removed)
→ 301 Moved Permanently → loses auth headers → 400 Bad Request
```
### After
```
https://api.example.com/mcp/ → https://api.example.com/mcp/ (preserved)
→ 200 OK
```
Fixes #21179
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21338
Author: @shtse8
Created: 2/12/2026
Status: ❌ Closed
Base:
main← Head:fix/mcp-preserve-trailing-slash📝 Commits (1)
98b8290fix: preserve trailing slash in MCP server URLs📊 Changes
1 file changed (+4 additions, -2 deletions)
View changed files
📝
src/lib/components/AddToolServerModal.svelte(+4 -2)📄 Description
Summary
When configuring tool servers via the web UI, trailing slashes are stripped from all URLs—including MCP servers. For MCP servers, the trailing slash can be significant: some servers (e.g., Bitrix24) require a specific path format, and removing the slash causes a 301 redirect that loses authentication headers, resulting in a 400 Bad Request error.
Changes
Only strip trailing slashes for
openapitype tool servers (where path construction appends specific endpoints like/openapi.json). MCP server URLs are used as-is by the MCP client and should preserve the user's exact input.Before
After
Fixes #21179
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.