Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"run",
"-i",
"--rm",
"--entrypoint",
"torproxy",
"hapheus/torproxy:latest",
"mcp"
]
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.7.7] — 2026-11-13

### Fixed
- **mcp**: Support standalone stdio MCP mode (`mcp` / `torproxy mcp`) directly in `docker/start.sh` with daemon logs routed to `stderr`, and remove `--entrypoint torproxy` from `.mcp.json`, `smithery.yaml`, and `docs/mcp.md` (#147, #148)

## [2.7.6] — 2026-11-12

### Changed
Expand Down Expand Up @@ -248,7 +253,8 @@ Sprint 1 security & contract correctness release.

---

[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.6...HEAD
[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.7...HEAD
[2.7.7]: https://github.com/hapheus/torproxy/compare/v2.7.6...v2.7.7
[2.7.6]: https://github.com/hapheus/torproxy/compare/v2.7.5...v2.7.6
[2.7.5]: https://github.com/hapheus/torproxy/compare/v2.7.4...v2.7.5
[2.7.4]: https://github.com/hapheus/torproxy/compare/v2.7.3...v2.7.4
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG PYTHON_VERSION=3.14

LABEL org.opencontainers.image.title="torproxy" \
org.opencontainers.image.description="A minimal HTTP proxy routed through Tor" \
org.opencontainers.image.version="2.7.6" \
org.opencontainers.image.version="2.7.7" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/hapheus/torproxy" \
org.opencontainers.image.url="https://github.com/hapheus/torproxy" \
Expand Down
12 changes: 12 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
set -Eeuo pipefail

mcp_mode=0
if [ "${1:-}" = "mcp" ] || { [ "${1:-}" = "torproxy" ] && [ "${2:-}" = "mcp" ]; }; then
mcp_mode=1
# Preserve original stdout on FD 3 for JSON-RPC while routing all daemon logs to stderr.
exec 3>&1 1>&2
fi

validate_configuration() {
python3 -m torproxy.runtime.configure --check
}
Expand Down Expand Up @@ -39,6 +46,11 @@ su tor -s /bin/sh -c 'chmod 0750 /var/lib/tor' 2>/dev/null || true
su privoxy -s /bin/sh -c 'exec privoxy --no-daemon /tmp/privoxy.config' &
privoxy_pid=$!

if [ "$mcp_mode" -eq 1 ]; then
su torproxy -s /bin/sh -c 'exec torproxy mcp' >&3 3>&-
exit $?
fi

su torproxy -s /bin/sh -c 'exec python3 -m torproxy' &
api_pid=$!

Expand Down
2 changes: 1 addition & 1 deletion docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The repository includes a root-level `.mcp.json` automatically detected by Curso
"mcpServers": {
"torproxy": {
"command": "docker",
"args": ["run", "-i", "--rm", "--entrypoint", "torproxy", "hapheus/torproxy:latest", "mcp"]
"args": ["run", "-i", "--rm", "hapheus/torproxy:latest", "mcp"]
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ If an upgraded image exhibits unexpected behavior in your environment:

## 6. Release Notes

### 2.7.7 (Standalone stdio MCP mode in container entrypoint)

- **Standalone Stdio MCP Container Mode (#147, PR #148):** Updated `docker/start.sh` to detect `mcp` or `torproxy mcp` arguments, route setup/Tor/Privoxy logs to `stderr` while keeping `stdout` strictly for JSON-RPC, and launch `torproxy mcp` with Tor and Privoxy running in the background. Removed `--entrypoint torproxy` from `.mcp.json`, `smithery.yaml`, and `docs/mcp.md`.

### 2.7.6 (Developer Experience, Behavioral Psychology & Documentation Optimization)

- **Documentation & DX Optimization (#144, #145):** Restructured `README.md`, `DOCKERHUB.md`, and `/docs` using developer psychology, cognitive load reduction (Hick's Law), and progressive disclosure. Added instant 2-step verification, zero-clone `docker run` quickstarts, honest boundaries ("When to use / when not to use"), explicit fail-closed guarantees, and rapid-navigation matrices across `docs/api.md` and `docs/configuration.md`.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "torproxy"
version = "2.7.6"
version = "2.7.7"
description = "A minimal HTTP and SOCKS5 proxy routed through the Tor network with local REST control API"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"name": "io.github.hapheus/torproxy",
"title": "torproxy",
"description": "Tor HTTP and SOCKS5 proxy with REST API and built-in MCP server.",
"version": "2.7.6",
"version": "2.7.7",
"repository": {
"url": "https://github.com/hapheus/torproxy",
"source": "github"
},
"packages": [
{
"registryType": "oci",
"identifier": "docker.io/hapheus/torproxy:2.7.6",
"identifier": "docker.io/hapheus/torproxy:2.7.7",
"transport": {
"type": "stdio"
},
Expand Down
2 changes: 0 additions & 2 deletions smithery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ startCommand:
"run",
"-i",
"--rm",
"--entrypoint",
"torproxy",
...(config?.torproxyApiToken ? ["-e", `TORPROXY_API_TOKEN=${config.torproxyApiToken}`] : []),
"hapheus/torproxy:latest",
"mcp"
Expand Down
11 changes: 8 additions & 3 deletions tests/unit/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ def test_mcp_auto_discovery_manifests_contract(self):
"run",
"-i",
"--rm",
"--entrypoint",
"torproxy",
"hapheus/torproxy:latest",
"mcp",
]
Expand All @@ -357,7 +355,14 @@ def test_mcp_auto_discovery_manifests_contract(self):
assert "configSchema:" in smithery_content
assert "commandFunction:" in smithery_content
assert "hapheus/torproxy:latest" in smithery_content
assert "--entrypoint" in smithery_content
assert "--entrypoint" not in smithery_content

def test_start_script_supports_mcp_standalone_mode(self):
start_sh_path = os.path.join(DOCKER_DIR, "start.sh")
with open(start_sh_path, "r", encoding="utf-8") as f:
start_sh = f.read()
assert "torproxy mcp" in start_sh
assert "mcp" in start_sh

def test_compiled_artifacts_ignored_everywhere(self):
# ISSUE-16: no .pyc/__pycache__ may leak into the repo or the image.
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading