Repository navigation
fix(mcp): support standalone stdio MCP mode in container entrypoint - #148
Conversation
MustermenschAlex
left a comment
There was a problem hiding this comment.
Clean, minimal fix! Preserving the JSON-RPC stdout stream on FD 3 while routing setup and daemon logs to stderr in docker/start.sh is very neat, and keeping both .mcp.json, smithery.yaml, docs/mcp.md, and tests/unit/test_contracts.py in sync keeps our contract tests solid. ❤️
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
Nice catch on the FD 3 trick and closing 3>&- before exec torproxy mcp so no extra descriptor leaks into the child process. Also good that su torproxy isn't exec'd directly in start.sh, so the EXIT trap still fires and cleans up Tor/Privoxy on stdin EOF. LGTM!
majorungustl
left a comment
There was a problem hiding this comment.
Yeah, dropping the --entrypoint hack makes way more sense. Having docker run -i --rm hapheus/torproxy:latest mcp actually spin up Tor and Privoxy under the hood without barfing logs onto stdout is how it should've worked out of the box. Super minimal diff too, ship it!
e2e991c
MustermenschAlex
left a comment
There was a problem hiding this comment.
Version bump to 2.7.7 is properly synchronized across pyproject.toml, uv.lock, docker/Dockerfile, server.json, docs/releases.md, and CHANGELOG.md (including the comparison link). All contracts still hold cleanly. ❤️
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
Changelog comparison link and server.json OCI tag 2.7.7 look solid. No regressions on the FD 3 / start.sh path—re-approved!
majorungustl
left a comment
There was a problem hiding this comment.
Changelog link is in, all 11 CI checks are green, and the 2.7.7 bump is ready to go. Ship it!
Summary
mcportorproxy mcparguments indocker/start.shto run in standalone stdio MCP mode.exec 3>&1 1>&2) while keeping FD 3 clean for JSON-RPC ontorproxy mcpstdout.--entrypoint torproxyfrom.mcp.json,smithery.yaml, anddocs/mcp.mdso Tor and Privoxy start automatically alongside the stdio MCP server.tests/unit/test_contracts.py.Closes #147
Verification
uv run pytest tests/unit/ -v --cov=torproxy --cov-fail-under=85: 400 passed (87.24% coverage)bash -n docker/*.sh tests/integration/*.sh && shellcheck docker/*.sh tests/integration/*.sh: passeduv run ruff check . && uv run ruff format --check . && uv run mypy: passeddocker build -f docker/Dockerfile -t torproxy:mcp-test .) + end-to-end stdio smoke test (initialize,tools/list,torproxy_status): exited 0 with pure JSON-RPC on stdout and Tor connecting.