Skip to content

feat: configurable listen port/host and proxy auto-start#21

Open
Arkptz wants to merge 1 commit into
snapspecter:mainfrom
Arkptz:feat/configurable-port-env-autostart
Open

feat: configurable listen port/host and proxy auto-start#21
Arkptz wants to merge 1 commit into
snapspecter:mainfrom
Arkptz:feat/configurable-port-env-autostart

Conversation

@Arkptz

@Arkptz Arkptz commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds CLI flags and environment variables to configure the proxy listen
address and to auto-start the proxy on server boot, instead of requiring
a start_proxy tool call.

Changes

  • --port / MITMPROXY_PORT — proxy listen port (default 8080)
  • --host / MITMPROXY_HOST — proxy listen host (default 127.0.0.1)
  • --auto-start / MITMPROXY_AUTO_START — start the proxy immediately on
    startup via a FastMCP lifespan, stopped cleanly on shutdown
  • start_proxy(port=None) now falls back to the configured default port, so a
    single configured port is honored whether the proxy is started lazily (tool
    call) or eagerly (auto-start)

Motivation

Running multiple MCP server instances side by side requires pinning each to its
own listen port and bringing the proxy up without an explicit tool call. Keeping
the default port in one place means start_proxy and auto-start always agree, so
any client pointed at the configured port connects regardless of how the proxy
was started.

Testing

  • Auto-start binds the configured port and honors --dump-file
  • Clean shutdown releases the port
  • Existing start_proxy behavior unchanged when a port is passed explicitly

Notes

  • Version bumped 0.6.1 → 0.7.0
  • All new settings are opt-in; default behavior (lazy start on 8080) is unchanged

Add --port/--host (MITMPROXY_PORT/MITMPROXY_HOST) and --auto-start
(MITMPROXY_AUTO_START) so the proxy can bind a chosen port and come up
on server startup instead of waiting for the start_proxy tool call.
start_proxy() now falls back to the configured default port when called
without one, so a wrapper can pin a per-agent port that the browser also
targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant