You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surface lemonade's existing MCP server — let the GUI3 user see, test, and manage the POST /mcp endpoint that lemond already exposes (tool listing, connection URL copy, health).
MCP client/host in GUI3 — let GUI3 connect to external MCP servers (e.g. filesystem, GitHub, custom tools) and surface their tools in the chat panel alongside lemonade's native tools.
User-facing value: Power users connecting Claude Desktop, Cursor, or other MCP clients to lemonade today have no GUI visibility into what's happening. And users who want to consume external MCP tools from the GUI3 chat have no way to do so — they're limited to the hardcoded lemonade tool set in tools/lemonadeTools.ts.
The chat panel (ChatView.tsx) already executes tool calls via useChatStreaming hook + ChatToolRuntime. This is the natural integration point.
Proposed Implementation
Direction: Both — but phased
Phase
Direction
Server changes needed?
A (POC)
Surface lemonade's own MCP server status in GUI3
❌ No — read-only against existing /mcp
B (POC)
GUI3 as MCP client connecting to external servers
❌ No — frontend HTTP calls to external MCP endpoints
C (post-POC)
Server-side MCP client registry in lemond config
✅ Yes — deferred, requires lemond changes
Phase A — MCP Server Dashboard (frontend-only)
Where it lives: New panel in ConnectView.tsx (which already handles server connection, cloud providers, and marketplace apps) or a dedicated "Integrations" tab.
What it shows:
MCP endpoint URL ({baseUrl}/mcp) with copy button
Protocol version (2025-06-18)
List of 5 exposed tools with descriptions (fetched via tools/list JSON-RPC call to /mcp)
Connection snippet for Claude Desktop / Cursor / other clients
Health indicator (can we reach /mcp?)
Implementation:
// New: prototype/ui-redesign/src/features/mcp/McpServerStatus.tsx// Calls POST /mcp with {"jsonrpc":"2.0","method":"tools/list","id":1}// Renders tool cards with name + description + inputSchema summary
Phase B — MCP Client Host (frontend-only, Streamable HTTP)
Where it lives: New prototype/ui-redesign/src/features/mcp/McpClientManager.tsx + integration into ChatView.tsx's tool runtime.
On connect, GUI3 sends initialize → tools/list to each external server via Streamable HTTP (POST)
Discovered tools are merged into the tool palette visible in chat
When the LLM returns a tool call matching an external MCP tool, GUI3 dispatches tools/call to the appropriate external server
Results flow back into the chat stream
Key architectural points:
Transport: Streamable HTTP only (POST with JSON-RPC body). No stdio — GUI3 runs in a browser/webview, not a shell.
Invariant Request to you for benchmark report #11 (many-clients-one-server): External MCP server config is per-client (localStorage), NOT stored in lemond. Each GUI3 instance can have its own set of connected MCP servers.
Invariant Release v7.0.1 #13 (on-demand desktop): MCP client connections are lazy — only established when the user opens GUI3 and navigates to a chat that uses them.
Auth passthrough: If an external MCP server requires auth, the user provides it in the GUI3 settings panel. LEMONADE_API_KEY applies only to lemonade's own /mcp endpoint.
Phase C — Server-Side Registry (post-POC, requires lemond changes)
Flag for later: if we want lemond itself to act as an MCP client (so CLI users and all GUI clients share the same external tool set), that requires:
New config section in config.json for MCP server registry
lemond connects to external MCP servers on startup
External tools become available via the existing /mcp gateway (tool passthrough)
This is explicitly out of scope for the UI POC but noted here for completeness.
Integration with Existing MCP Tools — Avoiding Duplication
The 5 existing MCP tools (lemonade_*) and the GUI3 lemonadeTools.ts tools serve different consumers:
Consumer
Tool set
Transport
External MCP clients (Claude, Cursor)
lemonade_* via POST /mcp
JSON-RPC 2.0 / Streamable HTTP
GUI3 chat panel (LLM function calling)
lemonadeTools.ts via direct HTTP
OpenAI function-calling format
No duplication risk — they're different protocols for different consumers. The MCP client feature (Phase B) adds a third category: external tools from other MCP servers, surfaced in GUI3's chat.
If in Phase C we ever want GUI3 to use lemonade's own tools through the MCP protocol (instead of direct HTTP), that would be a unification opportunity — but it adds a JSON-RPC hop with no user benefit today.
Client vs. server scope for the POC: Should Phase A (MCP server dashboard) and Phase B (MCP client host) both land in the POC, or should we defer Phase B to post-POC? Phase A is low-risk (read-only); Phase B is more complex but arguably the higher user value.
External MCP server config location: Per invariant Request to you for benchmark report #11, this should be client-local (localStorage). But should we pre-populate a "suggested servers" list (like the marketplace in ConnectView.tsx)? Or keep it fully manual for now?
Auth model for external MCP servers: Plain bearer token per server? Or do we need to support OAuth/PKCE flows that some MCP servers require? For the POC, I'd propose token-only and flag OAuth as Phase C.
Tool conflict resolution: If an external MCP server exposes a tool with the same name as a lemonade native tool (e.g. list_models), what's the precedence? Namespace prefixing (servername/toolname)? Or reject duplicates?
Where in the GUI3 nav: Dedicated "Integrations" / "MCP" view? Or fold into the existing ConnectView which already has server settings + cloud providers + marketplace?
SSE streaming: The current /mcp endpoint is POST-only (no SSE channel — mcp_server.cpp:251 comment says "No SSE channel in this MVP"). For Phase B external servers, should GUI3 support SSE-based MCP transport, or is Streamable HTTP (POST) sufficient for the POC?
@fl0rianr — Would love your thoughts on the approach above, especially the phasing and whether the MCP client host (Phase B) belongs in the POC or should wait. The existing /mcp gateway gives us a solid foundation; the question is how much of the client-side story we tackle now vs. later.
Summary
"MCP support in GUI3" means two things:
POST /mcpendpoint thatlemondalready exposes (tool listing, connection URL copy, health).User-facing value: Power users connecting Claude Desktop, Cursor, or other MCP clients to lemonade today have no GUI visibility into what's happening. And users who want to consume external MCP tools from the GUI3 chat have no way to do so — they're limited to the hardcoded lemonade tool set in
tools/lemonadeTools.ts.Current State — We Are NOT Starting From Zero
Lemonade already ships a full MCP gateway:
src/cpp/server/mcp_server.cpp2025-06-18src/cpp/server/server.cpp:694-698POST /mcp(intentional exception to quad-prefix invariant per AGENTS.md #1)mcp_server.cpp:250-259Allow: POSTheaderserver.cpp:361-367LEMONADE_API_KEYenforcement covers/mcpExposed Tools (5)
lemonade_list_modelslemonade_chatlemonade_transcribe_audiolemonade_generate_imagelemonade_omniGUI3 Existing Tool Infrastructure
GUI3 already has a
tools/directory:prototype/ui-redesign/src/tools/lemonadeTools.ts— OpenAI function-calling tool definitions for model management (list, load, unload, pull, etc.)prototype/ui-redesign/src/tools/omniTools.ts— Omni collection tool routingThe chat panel (
ChatView.tsx) already executes tool calls viauseChatStreaminghook +ChatToolRuntime. This is the natural integration point.Proposed Implementation
Direction: Both — but phased
/mcplemondconfiglemondchangesPhase A — MCP Server Dashboard (frontend-only)
Where it lives: New panel in
ConnectView.tsx(which already handles server connection, cloud providers, and marketplace apps) or a dedicated "Integrations" tab.What it shows:
{baseUrl}/mcp) with copy button2025-06-18)tools/listJSON-RPC call to/mcp)/mcp?)Implementation:
Phase B — MCP Client Host (frontend-only, Streamable HTTP)
Where it lives: New
prototype/ui-redesign/src/features/mcp/McpClientManager.tsx+ integration intoChatView.tsx's tool runtime.How it works:
initialize→tools/listto each external server via Streamable HTTP (POST)tools/callto the appropriate external serverKey architectural points:
lemond. Each GUI3 instance can have its own set of connected MCP servers.LEMONADE_API_KEYapplies only to lemonade's own/mcpendpoint.Integration with existing tool infrastructure:
Phase C — Server-Side Registry (post-POC, requires
lemondchanges)Flag for later: if we want
lemonditself to act as an MCP client (so CLI users and all GUI clients share the same external tool set), that requires:config.jsonfor MCP server registrylemondconnects to external MCP servers on startup/mcpgateway (tool passthrough)This is explicitly out of scope for the UI POC but noted here for completeness.
Integration with Existing MCP Tools — Avoiding Duplication
The 5 existing MCP tools (
lemonade_*) and the GUI3lemonadeTools.tstools serve different consumers:lemonade_*viaPOST /mcplemonadeTools.tsvia direct HTTPNo duplication risk — they're different protocols for different consumers. The MCP client feature (Phase B) adds a third category: external tools from other MCP servers, surfaced in GUI3's chat.
If in Phase C we ever want GUI3 to use lemonade's own tools through the MCP protocol (instead of direct HTTP), that would be a unification opportunity — but it adds a JSON-RPC hop with no user benefit today.
Open Questions for @fl0rianr
Client vs. server scope for the POC: Should Phase A (MCP server dashboard) and Phase B (MCP client host) both land in the POC, or should we defer Phase B to post-POC? Phase A is low-risk (read-only); Phase B is more complex but arguably the higher user value.
External MCP server config location: Per invariant Request to you for benchmark report #11, this should be client-local (localStorage). But should we pre-populate a "suggested servers" list (like the marketplace in
ConnectView.tsx)? Or keep it fully manual for now?Auth model for external MCP servers: Plain bearer token per server? Or do we need to support OAuth/PKCE flows that some MCP servers require? For the POC, I'd propose token-only and flag OAuth as Phase C.
Tool conflict resolution: If an external MCP server exposes a tool with the same name as a lemonade native tool (e.g.
list_models), what's the precedence? Namespace prefixing (servername/toolname)? Or reject duplicates?Where in the GUI3 nav: Dedicated "Integrations" / "MCP" view? Or fold into the existing ConnectView which already has server settings + cloud providers + marketplace?
SSE streaming: The current
/mcpendpoint is POST-only (no SSE channel —mcp_server.cpp:251comment says "No SSE channel in this MVP"). For Phase B external servers, should GUI3 support SSE-based MCP transport, or is Streamable HTTP (POST) sufficient for the POC?@fl0rianr — Would love your thoughts on the approach above, especially the phasing and whether the MCP client host (Phase B) belongs in the POC or should wait. The existing
/mcpgateway gives us a solid foundation; the question is how much of the client-side story we tackle now vs. later.