Tor MCP Proxy
A Tor-backed MCP server for private web access, including .onion sites, with tools for fetching, searching, downloading, and analyzing web content.
Fetch HTTP(S) or .onion pages through Tor, returning extracted text or raw HTML; supports GET/POST/PUT/PATCH and sticky sessions (same circuit + cookies) via
session_id.Check the public Tor exit IP seen by destinations.
Search the web via DuckDuckGo's .onion service entirely inside Tor, returning titles, URLs, and snippets.
Download documents, images, archives, or data files through Tor into
TOR_DOWNLOAD_DIR, never overwriting existing files.Extract links from HTML offline, optionally filtering to
.onionlinks and grouping/deduplicating by host.Summarize HTML offline: title, description, headings, link counts, forms, and meta tags.
Provides privacy/security features: Tor-routed DNS, per-call circuits, SSRF protection, size limits, and sandboxed downloads; it does not execute JavaScript or solve CAPTCHAs.
Provides a search tool that queries DuckDuckGo through its .onion service, enabling anonymous web searches without leaving the Tor network.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tor MCP Proxy search DuckDuckGo's onion site for secure email providers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
English · Español
Tor MCP Proxy — Navegación web por Tor para agentes IA vía MCP
Dale a tu agente IA acceso a la web sin revelar tu IP. Servidor MCP open source que permite a Claude Code, Claude Desktop, Cursor, OpenCode y cualquier cliente compatible con Model Context Protocol navegar a través de Tor, incluidos los servicios
.onion. Usa un circuito nuevo en cada llamada, no tiene fugas de DNS y reintenta solo cuando un nodo de salida está bloqueado.
Tags: mcp-server · tor · onion · privacy · socks5 · ai-agents · claude-code · cursor · opencode · web-scraping · self-hosted
💡 Por qué existe
Los agentes IA navegan con tu IP. Así, cada sitio que consultan sabe quién eres, y muchos bloquean o limitan las peticiones automatizadas. Tor MCP Proxy resuelve esto con tres ideas simples:
Tu IP nunca sale. Todo el tráfico pasa por Tor, incluida la resolución DNS. No hay ninguna ruta directa de respaldo.
Un circuito nuevo en cada llamada. Cada tool usa una identidad SOCKS distinta, y Tor le asigna su propio nodo de salida, así que las llamadas no se pueden vincular entre sí. Si un nodo está bloqueado, se reintenta con otro.
Acceso a
.onionsin configuración extra. Funciona con servicios ocultos v3, también los que usan certificados autofirmados.
Related MCP server: sicry
⚡ Quickstart (3 comandos)
brew install tor && brew services start tor # o: sudo apt install tor
git clone https://github.com/GermaniU/tor-mcp-proxy.git && cd tor-mcp-proxy && npm ci
claude mcp add tor-proxy --scope user -- node "$PWD/index.js"Requiere Node.js 22.23.4+, 24.22.1+ o 26.12.1+ y Tor escuchando en 127.0.0.1:9050. Para otros clientes, consulta docs/CLIENTS.md. Para otros sistemas operativos, consulta docs/INSTALL.md.
🔍 Diagnóstico
Este comando verifica Node.js, que Tor escuche, que el tráfico realmente salga por Tor y que cada llamada use un circuito distinto:
npm run doctor🛠 Tools MCP expuestas
Tool | Red | Para qué |
| Tor | Descarga una página (HTTP(S) o |
| Tor | Muestra la IP que ven los sitios, es decir, la del nodo de salida. |
| Tor | Busca en DuckDuckGo a través de su servicio |
| Tor | Guarda un documento, imagen o archivo comprimido en el directorio de descargas. Nunca sobrescribe archivos. |
| — | Lista los enlaces de un HTML; por defecto, solo los |
| — | Resume un HTML: título, encabezados, enlaces, formularios y metadatos. |
Los parámetros y ejemplos de uso de cada tool están en docs/CLIENTS.md.
🎯 Alcance actual
Tor MCP Proxy es deliberadamente pequeño. Hace una cosa bien: traer contenido web por Tor para un agente. No es un navegador ni un crawler.
Lo que SÍ hace
✅ Envía cada petición por Tor, con la resolución DNS incluida.
✅ Usa un circuito independiente por llamada y reintenta con otro nodo de salida si recibe 403, 429 o 5xx.
✅ Accede a servicios
.onionv3, también con HTTPS autofirmado.✅ Mantiene sesiones con cookies separadas por dominio para logins y formularios.
✅ Descarga archivos dentro de un directorio aislado (sandbox).
✅ Incluye protección SSRF y límites de tamaño en todas las respuestas.
Lo que NO hace (todavía)
❌ No ejecuta JavaScript. Las páginas que se construyen en el navegador devuelven poco texto.
❌ No es Tor Browser. El User-Agent es el de Tor Browser, pero la huella TLS es la de Node.js. Lee
SECURITY.md.❌ No elige país de salida. Tor asigna los nodos de salida al azar.
❌ No es rápido. Cuenta con 2–10 s por petición.
❌ No resuelve CAPTCHAs ni evade bloqueos deliberados.
Si necesitas algo de la lista del NO, abre un issue con un caso de uso real.
🔌 Conectar tu cliente
Tienes la configuración lista para copiar en docs/CLIENTS.md:
🟦 Claude Code:
claude mcp add tor-proxy --scope user -- node /ruta/a/tor-mcp-proxy/index.js🟫 Claude Desktop:
claude_desktop_config.json🟧 Cursor: Settings → MCP Servers
🟪 OpenCode:
opencode.json
Hay snippets listos en examples/.
⚙️ Configuración
Todo es opcional y se configura con variables de entorno. Estas son las más usadas:
Variable | Default | Para qué |
|
| Dirección del proxy de Tor. |
|
| El único directorio donde escribe |
|
| Cuántas veces reintentar con un circuito nuevo. |
| (desactivado) | Log de auditoría en formato JSONL. ⚠️ Registra URLs y búsquedas. |
La lista completa está en docs/INSTALL.md.
🧪 Smoke test contra Tor real
npm run smokeEste comando arranca el servidor por stdio, como lo haría un cliente MCP, y prueba las tools contra la red real:
check_exit_ip;fetch_pagesobre check.torproject.org y sobre el.onionde DuckDuckGo;search_onion.
🧱 Arquitectura (vertical slice)
┌─ tu agente (Claude Code / Cursor / OpenCode / …) ─┐
│ │ MCP stdio │
└───────────┼───────────────────────────────────────┘
▼
┌──────────────────┐ lib/features/<tool>/ ← una carpeta por tool
│ tor-mcp-proxy │ lib/shared/ ← red, HTML, MCP (sin estado global)
│ (Node.js) │ lib/app/ ← config + inyección de dependencias
└────────┬─────────┘
│ SOCKS5 (un circuito por llamada)
▼
┌──────────────────┐ ┌───────────────┐
│ Tor (local) │ ─────▶ │ nodo de salida │ ─────▶ sitio web / .onion
└──────────────────┘ └───────────────┘Cada tool vive en su propia carpeta (lib/features/<tool>/). Para añadir una tool basta crear una carpeta y añadir una línea en lib/features/index.js. Un test de arquitectura impide que las capas se mezclen.
El detalle técnico está en docs/ARCHITECTURE.md.
🔒 Seguridad y privacidad
Sin fugas de DNS. Los hostnames los resuelve Tor, nunca tu resolver local.
Cookies separadas por dominio en las sesiones, con
tough-cookiey la Public Suffix List.Las redirecciones no pueden sacarte de
.onionhacia clearnet.Descargas aisladas en
TOR_DOWNLOAD_DIR: no sobrescriben archivos y rechazan rutas.., archivos ocultos y symlinks.Protección SSRF: rechaza IPs privadas, loopback y de metadata de nubes.
El modelo de amenazas completo, con lo que este proxy no protege, está en SECURITY.md. Si encuentras una vulnerabilidad, repórtala de forma privada desde la pestaña Security del repo.
🤝 Contribuye
Tor MCP Proxy es MIT y sin trampas. PRs, issues y forks son bienvenidos.
Reglas (resumen):
Primero la privacidad. No se acepta ningún cambio que envíe tráfico o DNS fuera de Tor.
Clean Code · SOLID · KISS · YAGNI · Vertical slice · Tests primero. No se aceptan PRs sin tests.
Identificadores en inglés, commits en español. Usa Conventional Commits (
feat:,fix:,docs:, …).Una tool nueva = una carpeta nueva. No toques slices existentes salvo para corregir un bug.
DIP: las features usan
context.weby nunca importanundici. Lo verificatest/architecture.test.js.
El detalle completo está en CONTRIBUTING.md.
# Setup local de desarrollo (no necesita Tor)
npm ci
npm run lint # ESLint
npm run check # sintaxis de todos los archivos
npm test # unit + integración + protocolo MCP, ~2 s, sin red🩹 Troubleshooting
Could not connect to the Tor SOCKS5 proxy
Tor no está corriendo o escucha en otro puerto. Ejecuta
npm run doctor. Tor Browser usa el puerto9150; para usarlo, defineTOR_SOCKS5=socks5://127.0.0.1:9150.
HTTP 403 … (still failing after 4 attempts on independent Tor circuits)
El sitio bloquea a todos los nodos de salida de Tor. No es un bug: muchos sitios lo hacen. Busca el mismo contenido en otra fuente o en su versión
.onion.
Request timed out
La red Tor está lenta o el circuito es malo. Reintenta, o sube
TOR_REQUEST_TIMEOUT_MS(máximo 120000).
La página devuelve muy poco texto
Seguramente se construye con JavaScript en el navegador. Prueba con
raw: truepara ver el HTML real, o busca una versión sin JS del sitio.
download_file dice A file already exists
Es intencional: nunca se sobrescribe un archivo. Usa otro
output_path.
📚 Documentación
docs/INSTALL.md: instalación detallada, todas las variables y troubleshooting extendido.docs/CLIENTS.md: configuración por cliente y referencia de las tools.docs/ARCHITECTURE.md: decisiones técnicas y sus motivos.SECURITY.md: modelo de amenazas y cómo reportar vulnerabilidades.CONTRIBUTING.md: disciplinas, flujo de trabajo y cómo añadir una tool.CHANGELOG.md: historial de cambios.
📄 Licencia
MIT. Basado en DataImpulse-MCP (MIT) de Gentleman Programming.
Hecho por @GermaniU. Si te ha servido, una ⭐ ayuda a que más gente lo encuentre. Si algo se rompe, abre un issue y lo arreglamos.
Available Tools
6 toolscheck_exit_ipCheck Exit IPA
Return the public IP address that destinations see (the Tor exit node of a fresh circuit).
Inputs: no named parameters.
download_fileDownload FileA
Download a document, image, archive or data file through Tor into the server's download directory (TOR_DOWNLOAD_DIR). output_path is relative to that directory; existing files are never overwritten.
Inputs: url (required), output_path (required).
extract_linksExtract LinksA
Extract links from HTML (no network access). By default only .onion links are returned; set filter_onion: false for all links. Pass base_url to resolve relative links. Results are deduplicated and grouped by host.
Inputs: html (required), base_url, filter_onion.
fetch_pageFetch PageA
Fetch an HTTP(S) or .onion page through Tor and return its text (or raw HTML). Supports GET/POST/PUT/PATCH and sticky sessions (same circuit + cookies) via session_id.
Inputs: url (required), raw, body, method, +2 more.
page_metadataPage MetadataA
Summarise HTML (no network access): title, description, headings (H1/H2/H3), link counts (internal/external/.onion), forms and meta tags.
Inputs: html (required), url.
search_onionSearch via DuckDuckGo onionA
Search the web through DuckDuckGo's .onion service, entirely inside Tor. Returns titles, URLs and snippets; results may include both clearnet and .onion sites.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools target distinct actions: fetching pages, checking exit IP, searching onions, downloading files, extracting links, and summarizing metadata. The main overlap is between fetch_page and download_file, since both retrieve remote content, though download_file has a clear local-save distinction. Offline analysis tools extract_links and page_metadata are also related but produce different outputs.
Five of six tool names follow a clear verb_noun snake_case pattern: fetch_page, check_exit_ip, search_onion, download_file, extract_links. page_metadata deviates by using a noun phrase rather than a verb, but the overall convention remains readable and mostly consistent.
Six tools is well-scoped for a Tor proxy server, covering fetching, searching, downloading, link extraction, metadata extraction, and exit IP checking. Each tool has a clear place and there is no obvious redundancy or bloat.
The surface covers the core Tor browsing lifecycle: fetch pages, search onion services, download files, parse HTML offline, and verify exit IP. Minor gaps exist, such as no explicit session/cookie clearing or circuit rotation tool, but agents can largely work around these using existing capabilities.
Related MCP Connectors
Tor gateway for AI agents: fetch URLs and rotate circuits through Tor, Bitcoin-settled.
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Scrape, crawl and search the web for AI agents via MCP.
Route HTTP requests through the Tor network. Rotating exit IPs, .onion support, no body logging.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure access to Tor/onion services with content filtering and safety guardrails for AI assistants.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access Tor hidden services and the dark web through tools for search, fetch, and analysis over Tor.20MIT
- AlicenseNot gradedqualityDmaintenanceRoutes HTTP requests through the Tor network, enabling anonymous web fetching, exit IP checks, circuit renewal, and site reachability checks from MCP-compatible agents like Claude Desktop and Cursor.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to route HTTP requests through the Tor network, providing anonymity and access to .onion services. Includes tools for fetching URLs, checking exit IP, and forcing new Tor circuits.MIT