Skip to content

fix: import mcp json streamable http configs#367

Open
fancyboi999 wants to merge 1 commit intonetease-youdao:mainfrom
fancyboi999:fix/351-mcp-json-streamable-http
Open

fix: import mcp json streamable http configs#367
fancyboi999 wants to merge 1 commit intonetease-youdao:mainfrom
fancyboi999:fix/351-mcp-json-streamable-http

Conversation

@fancyboi999
Copy link
Copy Markdown

Summary

  • import userData/mcp.json into the existing SQLite-backed MCP store at startup
  • normalize external streamable_http configs into LobsterAI's internal http transport
  • clarify the MCP form so SSE and Streamable HTTP are clearly distinguished in the UI

Root Cause

Issue #351 mixed together two separate gaps:

  • LobsterAI did not read external mcp.json files at all, so dropping a file into the app data directory never surfaced servers in the UI
  • the app internally uses http for streamable HTTP MCP transport, but external configs commonly use streamable_http, and the UI did not make that distinction obvious enough

Solution

  • add a startup sync layer that reads mcp.json, validates entries, maps streamable_http/streamable-http to http, and writes imported entries into mcp_servers
  • mark imported entries with source metadata so subsequent syncs can update/remove only mcp.json-managed records without overriding manually configured servers
  • add regression coverage for mcp.json import behavior and alias normalization
  • update transport labels/hints in the MCP form to steer remote HTTP MCP users to Streamable HTTP

Validation

  • npx -p node@24 -p npm@11 -c "npm run compile:electron"
  • npx -p node@24 -c "node --test tests/mcpJsonSync.test.mjs tests/coworkOpenAICompatProxy.sseBoundary.test.mjs tests/coworkOpenAICompatProxy.responses.test.mjs"
  • npx -p node@24 -c "./node_modules/.bin/eslint src/main/mcpJsonSync.ts src/main/mcpStore.ts src/main/main.ts src/renderer/components/mcp/McpServerFormModal.tsx src/renderer/services/i18n.ts tests/mcpJsonSync.test.mjs"
  • npx -p node@24 -p npm@11 -c "npm run build"
  • manually verified a local test MCP service reproduces the 406 Not Acceptable response when the client only accepts text/event-stream, and succeeds when the client accepts both application/json, text/event-stream
  • manually verified mcp.json import turns a streamable_http entry into internal transportType: "http"

Notes

  • full npm run lint -- --quiet still reports pre-existing unrelated lint errors in src/main/im/nimGateway.ts and src/main/im/xiaomifengGateway.ts

Closes #351

@github-actions
Copy link
Copy Markdown

This pull request has been inactive for 30 days. It will be automatically closed in 14 days unless there is new activity.

If you're still working on this, please leave a comment or push new commits to keep it open. Thank you!

@github-actions github-actions Bot added the stale label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

无法支持远程MCP http MCP

1 participant