Skip to content

tools/ui: Respect configured MCP transport instead of always using Streamable HTTP#97

Open
joydolma wants to merge 3 commits into
PrismML-Eng:prismfrom
joydolma:feature/mcp
Open

tools/ui: Respect configured MCP transport instead of always using Streamable HTTP#97
joydolma wants to merge 3 commits into
PrismML-Eng:prismfrom
joydolma:feature/mcp

Conversation

@joydolma

Copy link
Copy Markdown

Summary

This PR fixes MCP transport selection in the UI by respecting the configured
transport type instead of always defaulting to Streamable HTTP.

This restores compatibility with legacy SSE-based MCP servers while preserving
support for newer Streamable HTTP servers.

Changes

  • Respect the configured MCP transport type.
  • Improve legacy SSE transport detection.
  • Improve transport selection logic.
  • Preserve compatibility with existing Streamable HTTP servers.

Motivation

Some MCP servers (including existing third-party implementations) still expose
the legacy SSE transport. The current behavior always prefers Streamable HTTP,
which prevents successful connections to those servers even when SSE is
explicitly configured.

This change allows the configured transport to be used while maintaining
compatibility with both transport implementations.

Compatibility

This change has been verified with:

  • PrismML Streamable HTTP MCP servers
  • Legacy SSE MCP servers
  • Nuke MCP
  • ComfyUI MCP
  • MCP Bridge (personal)

The goal is to preserve compatibility with both transport implementations
without changing the default behavior for Streamable HTTP servers.

Testing

Tested successfully with:

  • Nuke MCP
  • ComfyUI MCP
  • MCP Bridge (personal)

Verified tool discovery and execution with both legacy SSE and Streamable HTTP
servers.

@joydolma joydolma changed the title tools/ui: Respect configured MCP transport and improve SSE compatibilityFix legacy SSE transport detection and transport selection tools/ui: Respect configured MCP transport instead of always using Streamable HTTP Jul 21, 2026
@khosravipasha

Copy link
Copy Markdown
Collaborator

Thanks for the PR, will take a closer look. Is this somethign related to our fork? Or should it be more in the main llama.cpp. Does not seem to be touching our part of code (our main addition is mianly the kernels for 1-bit and ternary models, and few experiments features kv-cache 4-bit and dspark.)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MCP transport selection to support legacy SSE servers while retaining Streamable HTTP defaults.

Changes:

  • Detects SSE transport from endpoint URLs.
  • Creates the transport specified by the MCP configuration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tools/ui/src/lib/utils/mcp.ts Adds SSE URL detection.
tools/ui/src/lib/services/mcp.service.ts Selects configured SSE or Streamable HTTP transport.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/ui/src/lib/utils/mcp.ts Outdated
Comment thread tools/ui/src/lib/services/mcp.service.ts
Comment thread tools/ui/src/lib/services/mcp.service.ts
@joydolma

Copy link
Copy Markdown
Author

Thanks for the PR, will take a closer look. Is this somethign related to our fork? Or should it be more in the main llama.cpp. Does not seem to be touching our part of code (our main addition is mianly the kernels for 1-bit and ternary models, and few experiments features kv-cache 4-bit and dspark.)

Thanks for taking a look!

You're right—this isn't related to Prism's inference/runtime additions. It affects the MCP client in the bundled UI.

While testing with Nuke MCP, ComfyUI MCP, and my own MCP Bridge, I found that the configured transport wasn't being respected. Even when SSE was explicitly configured, the client always created a Streamable HTTP transport, which prevented legacy SSE MCP servers from connecting.

I've updated the implementation based on the review feedback, added regression tests, and all unit tests are now passing.

If you think this is better suited for upstream llama.cpp, I'm happy to submit it there instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants