loading…
Search for a command to run...
loading…
Enables secure access to Tor/onion services with content filtering and safety guardrails for AI assistants.
Enables secure access to Tor/onion services with content filtering and safety guardrails for AI assistants.
A Model Context Protocol (MCP) server that provides secure access to Tor/onion services with built-in content filtering and safety guardrails. This server allows AI assistants like Claude to safely browse .onion sites and access content through the Tor network while maintaining strong safety protections.
Tor Browser or Tor Service must be running on your system
127.0.0.1:9150 (Tor Browser) or 127.0.0.1:9050 (Tor service)Python 3.8+ is required
git clone <your-repo-url>
cd tor-mcp-server
pip install -r requirements.txt
Create your configuration file (see Configuration section below)
Run the server:
python tor_mcp_server.py
Create a tor_config.json file in the same directory as the server script. Here's the default configuration:
{
"tor_settings": {
"socks_port": 9150,
"host": "127.0.0.1",
"timeout_seconds": 60,
"connect_timeout_seconds": 30
},
"content_filtering": {
"enabled": true,
"blocked_keywords": [
"\\bchild abuse\\b",
"\\bdrug dealer\\b",
"\\bhuman trafficking\\b"
],
"warning_keywords": [
"ransomware",
"malware",
"stolen data"
],
"blocked_domains": [],
"blocked_url_patterns": [
".*porn.*",
".*adult.*"
],
"allowed_domains": [],
"enable_content_redaction": true,
"max_content_length": 100000
},
"server_settings": {
"server_name": "tor-access",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0",
"max_redirects": 5
}
}
socks_port: Port for Tor SOCKS proxy (9150 for Tor Browser, 9050 for Tor service)host: Host address for Tor proxy (usually 127.0.0.1)timeout_seconds: Total request timeoutconnect_timeout_seconds: Connection establishment timeoutenabled: Enable/disable content filteringblocked_keywords: Keywords that will block content entirely (supports regex)warning_keywords: Keywords that will show warnings but allow contentblocked_domains: Domain names to block completelyblocked_url_patterns: URL patterns to block (regex supported)allowed_domains: Whitelist of allowed domains (empty = allow all except blocked)enable_content_redaction: Automatically redact sensitive info (emails, SSNs, etc.)max_content_length: Maximum content length to displayThe server provides four main tools:
tor_connectTest your Tor connection and verify it's working properly.
Usage:
{
"tool": "tor_connect",
"arguments": {}
}
Returns: Connection status, your real IP vs Tor exit IP
tor_fetchFetch content from onion services or regular websites through Tor.
Usage:
{
"tool": "tor_fetch",
"arguments": {
"url": "http://example.onion",
"timeout": 30
}
}
Parameters:
url (required): The onion service URL or regular URL to fetchtimeout (optional): Request timeout in seconds (default: 30)tor_statusCheck if Tor service is running and accessible.
Usage:
{
"tool": "tor_status",
"arguments": {}
}
tor_configure_filtersDynamically configure content filtering settings.
Usage:
{
"tool": "tor_configure_filters",
"arguments": {
"action": "add_blocked_keyword",
"value": "malicious_term"
}
}
Actions:
add_blocked_keyword / remove_blocked_keywordadd_warning_keyword / remove_warning_keyword add_blocked_domain / remove_blocked_domainlist_filters: Show current filter configurationreload_config: Reload configuration from fileThis tool is designed for:
Not intended for:
requirements.txt:"Tor connection failed"
"Content blocked"
blocked_keywords or blocked_domains in configtor_configure_filters to modify filters"Request timed out"
Run with verbose logging:
PYTHONPATH=. python tor_mcp_server.py --verbose
Contributions are welcome! Please:
This tool is for legitimate security research and privacy purposes only. The authors are not responsible for misuse. Always comply with applicable laws and use responsibly.
Need help? Open an issue on GitHub or check the troubleshooting section above.
Run in your terminal:
claude mcp add tor-mcp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.