[PR #1783] [CLOSED] web: add persistent chats and MCP management #3671

Closed
opened 2026-11-07 15:29:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1783
Author: @VykosX
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: web-ui-mcp-conversations


📝 Commits (1)

  • f13b1f2 web: add persistent chats and MCP management

📊 Changes

7 files changed (+1581 additions, -20 deletions)

View changed files

📝 .gitignore (+1 -0)
➕ serve/local_ui.py (+244 -0)
📝 serve/server.py (+101 -0)
➕ serve/test_local_ui.py (+166 -0)
📝 serve/web/app.css (+444 -0)
📝 serve/web/app.js (+533 -15)
📝 serve/web/index.html (+92 -5)

📄 Description

Summary

Adds a native-feeling persistence and MCP-management layer to Strata's existing Web UI without changing the inference engine or model-specific defaults.

What changed

  • Persist Web UI conversations as JSON under conversations/, with a docked conversation list, switching, New Chat creating a new conversation instead of clearing history, and delete confirmation.
  • Add a dedicated MCP tab between Monitor and About.
  • Manage any number of MCP servers using either transport Strata already supports:
    • Streamable HTTP via url.
    • stdio via command, JSON args, optional cwd, and JSON env.
  • Show per-server connection state, transport, and enumerated tools.
  • Add exact context usage through Strata's current template/tokenizer path, displayed as a semi-circular used/total gauge.
  • Add dependency-free syntax highlighting for fenced code blocks while preserving the existing Markdown renderer and Strata styling.

MCP configuration safety

The UI is a frontend for Strata's existing MCP backend rather than a parallel protocol implementation.

  • HTTP header values and stdio environment values are never returned to the browser.
  • Hidden HTTP headers are preserved only while the URL is unchanged.
  • Hidden stdio env values are preserved only while command/args/cwd are unchanged; changing the launch identity drops them instead of silently forwarding credentials to a different process.
  • Editing/removing one named server leaves the others untouched.
  • stdio is explicitly described as starting a local process with the user's rights.
  • Changes are persisted to the current run config and take effect after restarting Strata.

Conversation persistence

  • UUID-backed IDs are validated before becoming paths.
  • Writes use a unique temporary file followed by atomic replace.
  • Conversation files are capped at 64 MiB.
  • /conversations/ is gitignored.
  • The existing browser-local chat remains only as a fallback/migration path.

Context meter

/context-count runs the current OpenAI-shaped Web UI history through Strata's own conversion/template/tokenizer path, including MCP tool schemas when enabled. The displayed count is therefore the actual prompt shape Strata will send, not a character estimate.

Validation

Clean worktree based on current origin/main:

  • serve.test_local_ui: 9/9 passed
  • serve.test_server: 271/271 passed
  • serve.test_mcp: 25/25 passed
  • serve.test_runconfig: 9/9 passed
  • node --check serve/web/app.js: passed
  • Python compile checks: passed
  • git diff --check: passed

A live acceptance test also added a stdio server beside an existing HTTP server, verified both were listed together, confirmed secret env values were not returned to the browser, verified the preserve/drop rules across edits, removed only the temporary server, and confirmed the original server remained unchanged.

Screenshots

Persistent conversations, syntax highlighting, and context gauge

Multiple MCP servers using HTTP and stdio


🔄 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/Niko1221/Strata/pull/1783 **Author:** [@VykosX](https://github.com/VykosX) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `web-ui-mcp-conversations` --- ### 📝 Commits (1) - [`f13b1f2`](https://github.com/Niko1221/Strata/commit/f13b1f22665737cda662923acf54869d8b3bd070) web: add persistent chats and MCP management ### 📊 Changes **7 files changed** (+1581 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) ➕ `serve/local_ui.py` (+244 -0) 📝 `serve/server.py` (+101 -0) ➕ `serve/test_local_ui.py` (+166 -0) 📝 `serve/web/app.css` (+444 -0) 📝 `serve/web/app.js` (+533 -15) 📝 `serve/web/index.html` (+92 -5) </details> ### 📄 Description ## Summary Adds a native-feeling persistence and MCP-management layer to Strata's existing Web UI without changing the inference engine or model-specific defaults. ## What changed - Persist Web UI conversations as JSON under `conversations/`, with a docked conversation list, switching, New Chat creating a new conversation instead of clearing history, and delete confirmation. - Add a dedicated **MCP** tab between Monitor and About. - Manage any number of MCP servers using either transport Strata already supports: - Streamable HTTP via `url`. - stdio via `command`, JSON `args`, optional `cwd`, and JSON `env`. - Show per-server connection state, transport, and enumerated tools. - Add exact context usage through Strata's current template/tokenizer path, displayed as a semi-circular used/total gauge. - Add dependency-free syntax highlighting for fenced code blocks while preserving the existing Markdown renderer and Strata styling. ### MCP configuration safety The UI is a frontend for Strata's existing MCP backend rather than a parallel protocol implementation. - HTTP header values and stdio environment values are never returned to the browser. - Hidden HTTP headers are preserved only while the URL is unchanged. - Hidden stdio env values are preserved only while command/args/cwd are unchanged; changing the launch identity drops them instead of silently forwarding credentials to a different process. - Editing/removing one named server leaves the others untouched. - stdio is explicitly described as starting a local process with the user's rights. - Changes are persisted to the current run config and take effect after restarting Strata. ### Conversation persistence - UUID-backed IDs are validated before becoming paths. - Writes use a unique temporary file followed by atomic replace. - Conversation files are capped at 64 MiB. - `/conversations/` is gitignored. - The existing browser-local chat remains only as a fallback/migration path. ### Context meter `/context-count` runs the current OpenAI-shaped Web UI history through Strata's own conversion/template/tokenizer path, including MCP tool schemas when enabled. The displayed count is therefore the actual prompt shape Strata will send, not a character estimate. ## Validation Clean worktree based on current `origin/main`: - `serve.test_local_ui`: **9/9 passed** - `serve.test_server`: **271/271 passed** - `serve.test_mcp`: **25/25 passed** - `serve.test_runconfig`: **9/9 passed** - `node --check serve/web/app.js`: passed - Python compile checks: passed - `git diff --check`: passed A live acceptance test also added a stdio server beside an existing HTTP server, verified both were listed together, confirmed secret env values were not returned to the browser, verified the preserve/drop rules across edits, removed only the temporary server, and confirmed the original server remained unchanged. ## Screenshots ![Persistent conversations, syntax highlighting, and context gauge](https://raw.githubusercontent.com/VykosX/Strata/pr-assets/screenshots/PR_CHAT.png) ![Multiple MCP servers using HTTP and stdio](https://raw.githubusercontent.com/VykosX/Strata/pr-assets/screenshots/PR_MCP.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:57 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3671
No description provided.