Add Bonjour/mDNS service discovery for app-server

Open 💬 0 comments Opened May 13, 2026 by PanicIsReal

What variant of Codex are you using?

App / app-server

What feature would you like to see?

I would like Codex app-server to optionally advertise itself over Bonjour/mDNS when it starts, so local apps can discover an available app-server instance without hard-coded ports, manual configuration, or port scanning.

A first version could publish a service such as _codex-app-server._tcp.local with conservative TXT metadata, for example:

  • protocol/API version
  • app-server variant or surface
  • instance ID
  • whether authentication/capability negotiation is required

The advertised metadata should avoid secrets. Discovery should only help clients find the server endpoint; the normal app-server authorization and handshake rules should still decide whether a discovered client can actually connect or perform actions.

Problem

Apps that integrate with app-server currently need an out-of-band way to find it. That usually means one of:

  • asking the user to configure a host and port
  • relying on a fixed or remembered port
  • scanning ports locally
  • maintaining per-surface launch coordination

That creates unnecessary friction for companion apps, native desktop integrations, IDE extensions, and other local clients that should be able to attach to a running Codex app-server instance when the user has already started one.

Proposed behavior

When app-server starts, it could register a Bonjour/mDNS service for the active listener. Clients could browse for the service, inspect the TXT metadata, and then connect using the existing app-server protocol.

Suggested guardrails:

  • keep existing bind-address defaults unchanged
  • make advertisement configurable, or start as opt-in if that is safer
  • advertise only endpoints the app-server is already intentionally serving
  • do not publish tokens, session IDs, thread IDs, user IDs, or paths in TXT records
  • require the existing authentication/capability handshake after discovery
  • withdraw the service promptly when app-server shuts down or changes listener state

Concrete use case

A native app wants to connect to Codex app-server after the user launches Codex. Today the native app has to know how that app-server was launched and which port it selected. With Bonjour/mDNS, the app can discover the running instance, present the discovered server to the user if needed, and then connect through the normal app-server flow.

This would also make multi-app integrations less brittle when ports change between launches or when multiple Codex surfaces exist on the same machine/network.

Additional information

I searched existing issues for Bonjour, mDNS, and app-server discovery before opening this and did not find a matching feature request.

This request is only for service discovery. It is not a request to weaken app-server authorization or expose private state over the local network.

View original on GitHub ↗