-
Notifications
You must be signed in to change notification settings - Fork 305
feat(mcp): make emdash catalog entry a dynamic/lazy URL resolver #1645
Description
Background
The emdash catalog entry in src/shared/mcp/catalog.ts currently hardcodes port 17823 in its MCP URL (http://127.0.0.1:17823/mcp).
This is a known intentional limitation introduced in PR #1642: catalog.ts is static shared code that runs in the renderer process without access to Electron IPC, so it cannot call mcp:getServerInfo at definition time to resolve the actual runtime port.
The actual runtime URL is always shown in Settings → Integrations → MCP Server, and the docs direct users to copy it from there.
Problem
When the server binds to a fallback port (e.g. 17824–17827 or an ephemeral port), the hardcoded catalog URL (http://127.0.0.1:17823/mcp) becomes incorrect and will silently generate broken server configs for users who use the catalog entry directly without checking Settings.
Proposed Solution
Make the emdash catalog entry a dynamic/lazy URL resolver that:
- Calls
mcp:getServerInfo(or an equivalent) at the time the entry is rendered/applied. - Constructs the URL from the actual runtime port.
- Falls back to
http://127.0.0.1:17823/mcpwhen the server is not yet running or the info is unavailable.
This requires broader changes to how catalog entries are rendered (currently they expect static config objects), so it is deferred to a future iteration.