Repository navigation
feat(mcp): integrated Model Context Protocol (MCP) server on port 2501 - #123
Conversation
- Implement zero-dependency Model Context Protocol (MCP) server using Python standard library - Provide dual transport: HTTP/SSE on port 2501 and Stdio via 'torproxy mcp' - Expose tools: torproxy_fetch, torproxy_status, torproxy_get_ip, torproxy_reconnect, torproxy_connect, torproxy_disconnect, torproxy_health, torproxy_diagnostics - Expose resources: torproxy://status and torproxy://metrics - Full test suite with 390 passing unit tests and >88% coverage - Add client examples and complete documentation in docs/mcp.md and README.md Closes #122
MustermenschAlex
left a comment
There was a problem hiding this comment.
Clean architecture and strict adherence to the zero-dependency contract. Excellent test coverage (88.24%) across protocol, stdio, and SSE transports, with clean AST validation. The addition of torproxy_fetch cleanly empowers agents without introducing external dependencies. Approved.
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
Solid async queue and daemon thread handling in the SSE server. Nice touch catching BrokenPipeError / ConnectionResetError on socket disconnects so the server stays completely quiet. Looks bulletproof to me, ship it.
majorungustl
left a comment
There was a problem hiding this comment.
Loving torproxy_fetch – that saves people tons of hacking around with curl in container networks. Stdio mode works like a charm for Claude Desktop too without messing with port forwards. Looks ready to roll.
…nary and container tests - Add MCP stdio and SSE port 2501 checks to tests/integration/verify_container.sh - Add live canary verification step testing torproxy_fetch against check.torproject.org - Ensure runner host IP leak detection and IsTor confirmation in live canary
e38f9ee
MustermenschAlex
left a comment
There was a problem hiding this comment.
Canary live verification for torproxy_fetch and container smoke test integration verified. Excellent addition. Approved.
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
Canary checks for torproxy_fetch look great. Leak-free and clean. Approved.
majorungustl
left a comment
There was a problem hiding this comment.
Verified the canary test update with check.torproject.org. Good to merge once CI finishes. Approved.
35ecc4a
MustermenschAlex
left a comment
There was a problem hiding this comment.
CodeQL empty-except comment addressed cleanly. Approved.
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
CodeQL finding fixed. Looks clean. Approved.
majorungustl
left a comment
There was a problem hiding this comment.
Addressed the CodeQL bot comment, all good. Approved.
- Bump package version to 2.6.0 in pyproject.toml and Dockerfile - Update uv.lock - Document v2.6.0 in docs/releases.md and CHANGELOG.md
7c8afac
MustermenschAlex
left a comment
There was a problem hiding this comment.
Release bump to 2.6.0 and release notes verified. Approved.
kuenstlichedummheit-sys
left a comment
There was a problem hiding this comment.
Bump to 2.6.0 is good to go. Approved.
majorungustl
left a comment
There was a problem hiding this comment.
v2.6.0 release looks solid. Approved.
Summary
Implements an integrated, zero-dependency Model Context Protocol (MCP) server on port 2501 with dual-transport support (HTTP/SSE and Stdio) and native
torproxy_fetchfor autonomous AI agents (Claude Desktop, Cursor, Antigravity, LLM pipelines).Closes #122
Key Features & Deliverables
Zero-Dependency Core:
http.server,json,threading,queue,urllib).Dual-Transport Support:
GET /sse) and JSON-RPC dispatch (POST /messages?sessionId=...). Configurable viaTORPROXY_MCP_PORTandTORPROXY_MCP_ENABLED.torproxy mcp): Spawns via CLI /docker exec -i torproxy torproxy mcpfor Claude Desktop or local agents without exposing host ports.Orchestration Tools & Resources:
torproxy_fetch: Execute HTTP/HTTPS or.onionrequests strictly routed through Tor with zero host setup.torproxy_status: Real-time Tor bootstrap, egress IP, and GeoIP metadata.torproxy_get_ip: Verified egress IP.torproxy_reconnect: Trigger new identity (SIGNAL NEWNYM) with optional country/strict enforcement.torproxy_connect/torproxy_disconnect: Network toggle.torproxy_health/torproxy_diagnostics: Automated operational health checks.torproxy://status(live JSON) andtorproxy://metrics(Prometheus metrics).100% Backward Compatibility:
TORPROXY_MCP_ENABLED=false.Comprehensive Documentation & Examples:
Verification & Quality Gates
test_architecture.py, zero AST violations)ruff check&ruff format --check, 0 errors)mypy, strict, 0 errors in 27 source files)shellcheck&bash -n)