Skip to content

feat(mcp): make emdash catalog entry a dynamic/lazy URL resolver #1645

@coderabbitai

Description

@coderabbitai

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:

  1. Calls mcp:getServerInfo (or an equivalent) at the time the entry is rendered/applied.
  2. Constructs the URL from the actual runtime port.
  3. Falls back to http://127.0.0.1:17823/mcp when 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.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions