# torproxy

This MCP server for Claude Code connects an AI agent to a Tor proxy. The agent can route requests through Tor and select an exit country.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7 repo stars
- Author: hapheus
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hapheus/torproxy
- Updated: 2026-11-13
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/torproxy

## What it does

torproxy combines Tor HTTP and SOCKS5 proxies with a REST API and an MCP server. Agents connect through MCP; the REST API can request a new Tor circuit and set the exit-node country.

Setup requires Docker and a value for `TORPROXY_API_TOKEN`. The command starts `docker.io/hapheus/torproxy:2.7.7` as a stdio container. Proxy and API ports bind to `127.0.0.1` by default, but they do not require authentication, so they should not be exposed to untrusted networks.

## Requirements
- Needs: Docker
- Environment variables: `TORPROXY_API_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env TORPROXY_API_TOKEN=<TORPROXY_API_TOKEN> --transport stdio torproxy -- docker run -i --rm -e TORPROXY_API_TOKEN docker.io/hapheus/torproxy:2.7.7
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add torproxy --env TORPROXY_API_TOKEN=<TORPROXY_API_TOKEN> -- docker run -i --rm -e TORPROXY_API_TOKEN docker.io/hapheus/torproxy:2.7.7
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "torproxy": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "TORPROXY_API_TOKEN",
                "docker.io/hapheus/torproxy:2.7.7"
            ],
            "env": {
                "TORPROXY_API_TOKEN": "<TORPROXY_API_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "torproxy": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "TORPROXY_API_TOKEN",
                "docker.io/hapheus/torproxy:2.7.7"
            ],
            "env": {
                "TORPROXY_API_TOKEN": "<TORPROXY_API_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TORPROXY_API_TOKEN=<TORPROXY_API_TOKEN> torproxy docker run -i --rm -e TORPROXY_API_TOKEN docker.io/hapheus/torproxy:2.7.7
```
Replace <…> with your own values

## When to use it
- route an agent's requests through Tor
- switch the Tor exit country when reconnecting
- check a localized site through an exit node in another country
- send a container's traffic through Tor without changing application code

## Example prompts
- Send a request to this site through Tor.
- Reconnect Tor using a German exit node.
- Check how this site appears through Tor from another country.

## Similar
- [Context7](https://affpapa.org/en/nevibecode/mcp/context7.md) — MCP server · 5563 installs
- [Search Google Flights](https://affpapa.org/en/nevibecode/mcp/search-google-flights.md) — MCP server · 2595 installs
- [Math-MCP](https://affpapa.org/en/nevibecode/mcp/math-mcp.md) — MCP server · 5958 installs
- [pipeworx gateway](https://affpapa.org/en/nevibecode/mcp/pipeworx-gateway.md) — MCP server · 419019 installs
- [SparkForge](https://affpapa.org/en/nevibecode/mcp/sparkforge.md) — MCP server · 219896 installs
- [OpenWebSearch](https://affpapa.org/en/nevibecode/mcp/openwebsearch.md) — MCP server · 494 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
