MCPJam / MCPJam/inspector

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

Open
#1,435 3 comments 0 reactions 1 assignee Claimed by @matteo8p View on GitHub
bug
Dominant language
TypeScript
Stars
2.2k
Forks
283
Avg merge
11h 47m
Merged PRs (30d)
737

Description

# 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.