diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index bad416c34c..41c39fff52 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -30,7 +30,7 @@ class ExtendedChainlitAPI extends ChainlitAPI { headers?: Record ) { // Assumes the backend expects { clientType, name, url } - return fetch(`${this.httpEndpoint}mcp`, { + return fetch(new URL("mcp", this.httpEndpoint.endsWith("/") ? this.httpEndpoint : `${this.httpEndpoint}/`), { method: 'POST', headers: { 'Content-Type': 'application/json',