Skip to content

[BUG] Electron server port is hardcoded and not configurable via environment variable #1435

@Skylertodd

Description

@Skylertodd

Issue

When running https://docs.mcpjam.com/installation#start-with-custom-port
npx @mcpjam/inspector@latest --port 4000
The port used by the MCPJam Inspector's internal server is hardcoded to 6274 when running in Electron (see src/main.ts). This prevents users from configuring or overriding the port via an environment variable or command line flag, which is inconsistent with the server behavior outside Electron.

How to reproduce

  1. Run the MCPJam Inspector Electron app locally (development or packaged build).
  2. Observe that the server always starts on port 6274, regardless of SERVER_PORT or similar environment variables.
  3. Attempting to change the port via env or CLI does not affect Electron's embedded server.

Expected Behavior

Users should be able to configure the MCPJam Inspector server port via an environment variable (e.g., SERVER_PORT or ELECTRON_PORT) when running in Electron, consistent with non-Electron usage.

Platform

  • Electron app (all OSes)

Additional Context

This affects running multiple MCPJam servers, port conflicts with other local software, and developer flexibility. Ideally, MCPJam should allow the port to be set with an env variable inside Electron, rather than hardcoding it in the entrypoint. See also the workaround of patching src/main.ts or reverse proxying, but these are not user-friendly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions