Skip to content

fix(serve): wire --host/--port to FastMCP settings for SSE container reachability (R89-94f)#45

Merged
WRG-11 merged 1 commit into
mainfrom
session/F-r89-94f-namespace-transfer
May 29, 2026
Merged

fix(serve): wire --host/--port to FastMCP settings for SSE container reachability (R89-94f)#45
WRG-11 merged 1 commit into
mainfrom
session/F-r89-94f-namespace-transfer

Conversation

@WRG-11
Copy link
Copy Markdown
Owner

@WRG-11 WRG-11 commented May 29, 2026

Summary

Root cause (A-proven 2026-05-30): instinct serve --transport sse bound to 127.0.0.1:8000 (FastMCP default), making the container unreachable externally → Glama build health check failed.

The --host / --port CLI args were parsed but silently dropped: FastMCP.run() does not accept host/port kwargs; they must be set via server.settings.* before calling run().

Changes:

  • src/instinct/cli.py: wire args.hostserver.settings.host and args.portserver.settings.port for sse/streamable-http transports (not stdio, which has no network socket)
  • Dockerfile: CMD gains --host 0.0.0.0 --port 8000 (aligns with EXPOSE 8000)
  • tests/test_cli_extended.py: two regression tests — SSE wires settings, stdio does not

Note: Phase 1 (namespace metadata yakuphanycl→WRG-11) and Phase 2 (server.json) were already completed in upstream commits. This PR is Phase 3 only.

Operator-gated follow-ups

  • MCP Registry re-publish under io.github.WRG-11/instinct (server.json already updated upstream; needs operator OAuth)
  • PyPI release 1.4.2+ to propagate pyproject.toml URL changes

Test plan

  • pytest tests/ -q185 passed
  • ruff check src/instinct/cli.py tests/test_cli_extended.py → clean
  • Acceptance: docker build && docker run -p 8001:8000 → log shows 0.0.0.0:8000 not 127.0.0.1:8000 + curl http://127.0.0.1:8001/sse 200/SSE-stream

…-http

FastMCP.run() does not accept host/port kwargs; the CLI arguments were parsed
but silently dropped → container bound 127.0.0.1:8000 (unreachable externally).
Now server.settings.host/port are set before server.run() for network transports.
Dockerfile CMD gains --host 0.0.0.0 --port 8000 to expose the container port.
Two regression tests added: SSE wires args, stdio does not.
@WRG-11 WRG-11 merged commit e9a1ddd into main May 29, 2026
12 checks passed
@WRG-11 WRG-11 deleted the session/F-r89-94f-namespace-transfer branch May 29, 2026 23:58
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