UI : fix SSE transport detection and routing through CORS proxy. Assi… - #24500
Merged
Conversation
…sted-by: Antigravity
allozaur
requested changes
Jun 12, 2026
allozaur
approved these changes
Jun 15, 2026
Contributor
|
@hrpnr please fix linting issues |
hrpnr
force-pushed
the
fix-ui-mcp-sse-routing
branch
from
June 16, 2026 08:11
c4439a2 to
794af40
Compare
Contributor
Author
|
@allozaur could you re-review? just fixed linting issues. |
allozaur
approved these changes
Jun 16, 2026
allozaur
approved these changes
Jun 17, 2026
Contributor
|
@ServeurpersoCom please check this when u have a moment 😄 |
|
Hello @hrpnr I have installed duckduckgo-mcp-server When I run it with transport sse. It does not work. Can you confirm how does fix apply or I am doing something wrong. llama.cpp server. |
Contributor
Author
|
Hi @engrtipusultan , i use DDGS from https://github.com/deedy5/ddgs 1. Install dependencies (one-time, ) pip install -U ddgs[mcp] mcp-proxy2. Start mcp-proxy wrapping ddgs & "path\to\mcp-proxy.exe" `
--port 8000 `
--allow-origin "http://localhost:8080" `
-- "path\to\ddgs.exe" mcp3. Start llama-server (pointing to the same 8080 or other preferred port) 4. In the UI:
|
adrianhoehne
pushed a commit
to adrianhoehne/llama.cpp
that referenced
this pull request
Jul 5, 2026
ggml-org#24500) * UI : fix SSE transport detection and routing through CORS proxy. Assisted-by: Antigravity * ui : replace magic strings with constants in MCP transport handling
zommiommy
pushed a commit
to zommiommy/llama.cpp
that referenced
this pull request
Aug 18, 2026
ggml-org#24500) * UI : fix SSE transport detection and routing through CORS proxy. Assisted-by: Antigravity * ui : replace magic strings with constants in MCP transport handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


DuckDuckGo Search (DDGS) MCP Integration Walkthrough
This document summarizes the changes made to enable connecting the
ddgsMCP server to thellama.cppWeb UI using SSE transport over the CORS proxy.1. What was accomplished
We successfully configured the
ddgsMCP server to run over SSE transport and integrated it with thellama.cppWeb UI. The Web UI can now connect to the MCP server throughllama-server's built-in CORS proxy, discover tools, and execute queries.2. Why changes were required
Standard Stdio Transport vs. Browser Constraints
ddgs mcpruns onstdiotransport by default. However, the browser-based Web UI cannot communicate with local processes via stdio and requires HTTP-based transports (SSE / StreamableHTTP).ddgsas an SSE server exposed it athttp://127.0.0.1:8000/sse.Transport Selection Bug
StreamableHTTPClientTransport. The fallback block forSSEClientTransportwas never executed since theStreamableHTTPClientTransportconstructor does not throw synchronous network errors.Relative Endpoint Resolution Bug over CORS Proxy
http://localhost:8080/cors-proxy?url=...)./messages/), the SDK resolved this relative path against the proxy URL, mapping it to the local origin (http://localhost:8080/messages/) instead of wrapping the target through the CORS proxy. This resulted in404 Not Founderrors fromllama-server.3. How it was implemented
Step 1: SSE Transport Detection
We modified detectMcpTransportFromUrl to classify URLs ending with
/sse,/sse/, or containing/sse?asMCPTransportType.SSE:Step 2: Explicit SSE Client Transport Instantiation
We updated createTransport to explicitly check for
MCPTransportType.SSEand returnSSEClientTransportinstead of falling through:Step 3: Fetch Interceptor & CORS Proxy URL Rewrite
We added URL rewrite logic at the beginning of the custom
fetchhandler inside createDiagnosticFetch. If proxy routing is active and an outgoing request erroneously targets the local origin without/cors-proxy, the interceptor reconstructs the destination relative to the original MCP server and routes it through the CORS proxy:Step 4: UI Packaging
We compiled the changes with:
cd tools/ui npm run buildThis wrote the production static bundle to
tools/ui/dist, enablingllama-serverto serve it using the--path tools/ui/distflag.Requirements