Keep the sensor.
Own the records.
Install & run.
Run locally with zero outside dependencies. You can run the OnionLens sensor on your own computer or server with Python 3.10 or newer. Install OnionLens from PyPI in a virtual environment. It uses only the Python standard library at runtime, with zero phone-home telemetry.
python3 -m venv .venv . .venv/bin/activate pip install onionlens onionlens serve --channel clearnet --db observatory.sqlite3 # In a second terminal, from the same folder . .venv/bin/activate onionlens summary --db observatory.sqlite3
Offline install. Download the wheel above, check its SHA-256 hash against SHA256SUMS.txt, and run python -m pip install onionlens-0.1.4-py3-none-any.whl from its folder.
Package and command names
Since version 0.1.2 the package and CLI command are named onionlens. Older scripts using the onion_observatory Python import or the cepatreaza and onion-observatory CLI commands continue to work unchanged.
Local evaluation versus production. The built-in onionlens serve command runs a local evaluation server on 127.0.0.1:8787. For a live site, wrap your web app and run it behind a production WSGI server such as Gunicorn.
Wrap a WSGI application.
Add three routes without touching your existing pages. If you already have a Python web app (such as Flask or Django), wrap its WSGI object with Sensor. Your existing pages and streaming responses pass through unchanged, while the wrapper logs hits into your local SQLite file and adds three endpoints under /_oo/:
from onion_observatory import Sensor
# Your existing WSGI application
application = Sensor(
application,
db="observatory.sqlite3",
channel="onion",
)What the three routes do. /_oo/probe serves a document with a fresh one-time canary token. /_oo/demo serves a document whose token is pre-tagged as a demo. /_oo/callback receives returned tokens and links them back to the fetch that created them. Always set channel="onion" or channel="clearnet" from your own listener config (run a dedicated loopback port for Tor) because incoming Host and forwarding headers can be faked by visitors.
Connect a local Tor service.
Forward Tor port 80 to your local listener. To put your local server on a .onion address, configure the Tor daemon on your machine to forward incoming Tor connections to 127.0.0.1:8787:
# torrc HiddenServiceDir /var/lib/tor/onionlens/ HiddenServicePort 80 127.0.0.1:8787
Keep your onion key private and permanent. When Tor starts, it generates your service key and writes your 56-character .onion hostname into that folder. Back up that folder to keep the same onion address over time, and use --channel onion only on a local port that can solely be reached through Tor. Follow the Tor Project setup guide for folder permissions and service management.
Three real, read-only tools.
Connect an MCP client over HTTP. If you are testing an AI agent that speaks the Model Context Protocol (MCP), point it straight at this site’s live tools. Use /demo/mcp for testing and demos so your calls are tagged as a demonstration, or /mcp for normal production use. Both endpoints speak stateless Streamable HTTP with plain JSON replies (protocol versions 2025-03-26 and 2025-06-18), with no API key or persistent SSE stream required.
| Tool | Result |
|---|---|
validate_ | Unpacks a 56-character v3 .onion address (32-byte key, two-byte SHA3-256 checksum, version 3) and verifies its checksum offline |
list_ | Returns official Tor Project setup guides and test endpoints as JSON |
retrieval_ | Returns the fixed test document (keyword moss, number 42, Unicode sample) for transport checks |
Send an initialize request first, then list or call tools with both application/json and text/event-stream in your Accept header. These hosted MCP tools live on onionlens.org; they are separate from the downloadable Python package. Connection manifest · MCP quickstart.
# 1. Initialize the client.
curl -sS https://onionlens.org/demo/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
"protocolVersion":"2025-06-18","capabilities":{},
"clientInfo":{"name":"my-test","version":"1.0"}}}'
# 2. Discover the available tools.
curl -sS https://onionlens.org/demo/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
# 3. Retrieve the known specimen.
curl -sS https://onionlens.org/demo/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
"name":"retrieval_fixture","arguments":{}}}'Collection boundaries.
The downloadable Python package saves everything on your own machine in a local SQLite file: timestamp, URL path, HTTP method, user-agent string, and token callbacks. It never sends telemetry anywhere and never records IP addresses, query strings, request bodies, cookies, or login headers.
This hosted site (onionlens.org) uses a private PostgreSQL database and embeds canary notes in nine places across HTML, text, and JSON responses. On normal HTTPS it sees the visitor’s IP; over Tor, visitor IPs are invisible. Full logs are never public. Read the full step-by-step methodology and privacy policy.
Nine canary placements on the hosted site. On onionlens.org, canary notes appear in HTML comments, hidden text, image alt text, robots.txt, llms.txt, .well-known manifests, API JSON, API error messages, and runbook pages. The downloadable archive includes the MIT licence, README, and test suite.