221B
221B is a local MCP server for OSINT research that gives AI clients tools for web, username, domain, archive, and optional API-backed investigations.
Search the web with keyless metasearch or optional Brave API, up to 20 results.
Search usernames with locally installed Sherlock, using light, dev, or complete depth and optional site overrides.
Inspect public HTML/text pages to extract text, links, and email addresses.
Look up DNS records and RDAP registration data for domains.
Find Wayback Machine captures of exact URLs, deduplicated by digest.
Export saved evidence record IDs as JSON or Markdown.
Optionally use Shodan to look up recorded services for an IP and search Shodan's indexed services.
Optionally use urlscan to passively search observations, submit public URLs for scanning, and retrieve results by UUID.
Manage local configuration, credentials, and evidence via init/doctor, with OS keychain and Docker secret support.
Enables web search through the Brave Search API as an optional search provider, returning results with source URLs and timestamps.
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., "@221B inspect https://example.org and summarize the page"
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.
221B
A local MCP server for OSINT research. Give your AI client tools to find public profiles, search the web, inspect pages, and export findings with sources and timestamps. No API keys required by default.
Quick start
Requires Git and Python 3.11+.
On macOS or Linux:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install '.[sherlock]'
221b-mcp doctorOn Windows:
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install ".[sherlock]"
.\.venv\Scripts\221b-mcp.exe doctorThe sherlock extra enables username searches. Skip it with pip install . if you only
need the other tools.
Add a stdio server to your MCP client. For clients using mcpServers JSON:
{
"mcpServers": {
"221b": {
"command": "/absolute/path/to/221B-MCP/.venv/bin/221b-mcp",
"args": ["serve"]
}
}
}Replace the path with your installation. Your client starts the server; there is no web UI or HTTP endpoint. Try asking: “Use 221B to inspect https://example.org.”
Related MCP server: wrg-mcp-server
Tools
Tool | What it does |
| Keyless metasearch through DDGS, or optional Brave API search |
| Find candidate accounts using locally installed Sherlock |
| Extract text, links, and email addresses from public HTML/text pages |
| Look up DNS records and available RDAP registration data |
| Retrieve recorded services for a public IP using an optional Shodan key |
| Search Shodan's indexed services using native query filters |
| Passively search existing urlscan observations using native queries |
| Actively submit a public URL and wait up to 60 seconds for results |
| Retrieve a previously submitted urlscan result by UUID |
| Find Wayback captures of an exact URL |
| Export saved evidence IDs as JSON or Markdown |
Username searches accept depth: light (default, 20 curated sites), dev
(developer platforms), or complete (all available Sherlock sites, including adult
sites, with upstream exclusions). An explicit sites list overrides the preset.
Allow a client tool timeout above 600 seconds for complete scans.
Results include source URLs, retrieval timestamps, and status information. Username matches do not prove identity. Coverage varies, sites can block requests, and page inspection does not render JavaScript.
Configuration and data
Run 221b-mcp init to select Brave and save its key in macOS Keychain, Windows
Credential Manager, or Linux Secret Service. Linux needs an available Secret Service
session. Setup fails if the OS store cannot save and read back the key.
For containers, set BRAVE_API_KEY_FILE to a mounted UTF-8 file containing the key.
Credential precedence is secret file → BRAVE_API_KEY environment → OS store.
Choose provider="brave" on a call, or set MCP_221B_SEARCH_PROVIDER=brave; a key alone does not switch providers.
Shodan
Run 221b-mcp init and choose to configure Shodan, or supply SHODAN_API_KEY_FILE
or SHODAN_API_KEY. Precedence is secret file → environment → OS store, using
a separate credential from Brave. Shodan is optional and independent of the web-search
provider. doctor reports local credential status without making an API call or checking
your subscription. Restart your MCP client after installing the updated server.
Examples of tool arguments:
lookup_shodan_host(ip="8.8.8.8")
search_shodan(query='org:"Example" port:443', limit=10, page=1)Host lookup returns general host information and up to 100 recorded services. Search
returns service observations, so an IP can appear more than once for different services.
limit accepts 1–100 (default 10); page starts at 1. Each search fetches exactly one
Shodan page of up to 100 services and then applies the output limit. A smaller limit does
not reduce API credit usage. Results report the total matches and any omitted page results.
Search requires suitable account access and can consume query credits, including for filtered queries and later pages; see the Shodan API documentation. There is no automatic pagination or retry. Both tools read existing Shodan observations; they do not initiate scans. Observation timestamps are separate from retrieval timestamps, and recorded ports do not establish current reachability. Banner excerpts are limited to 2,000 characters with truncation indicated. Responses retain the shared 2 MB HTTP limit.
urlscan
Run 221b-mcp init to store a urlscan API key, or supply URLSCAN_API_KEY_FILE or
URLSCAN_API_KEY. Precedence is secret file → environment → OS store. All urlscan
tools require a key. Searching is passive; submitting a URL starts an active third-party
browser scan and consumes submission quota.
Submissions default to visibility="unlisted". Unlisted scans are not shown in public
search results but remain visible to vetted urlscan Pro users. Public scans are globally
discoverable, while private scan availability and retention depend on the account. Never
submit URLs containing credentials, private data, or sensitive query parameters.
Examples:
search_urlscan(query="domain:example.org", limit=10)
submit_urlscan(url="https://example.org", visibility="unlisted")
get_urlscan_result(scan_id="0e37e828-a9d9-45c0-ac50-1ca579b86c72")221b-mcp doctor shows configuration, evidence, and log paths. OS-store presence is
reported from setup metadata, without unlocking or verifying the store. Override them with
MCP_221B_CONFIG, MCP_221B_DATA_DIR, and MCP_221B_LOG_DIR. Evidence is kept until
manually removed. Operational logs omit query contents and keys; external sources still
receive requests, and results are returned to your AI client.
Docker
With Docker running, build and check the image:
docker build -t 221b-mcp .
docker run --rm 221b-mcp doctorFor an MCP client, use docker as the command with these arguments:
run --rm -i -v 221b-data:/data 221b-mcpUse -i without -t. The container runs as a non-root user; the named volume preserves
evidence and logs. Rebuild the image after code changes.
For Brave, mount a secret read-only and pass its path (never bake it into the image):
docker run --rm -i -v 221b-data:/data \
--mount type=bind,src=/absolute/path/brave-key,dst=/run/secrets/brave,readonly \
-e BRAVE_API_KEY_FILE=/run/secrets/brave \
-e MCP_221B_SEARCH_PROVIDER=brave 221b-mcpThe file must be readable by container UID 10001. Mounted files are not encrypted by
221B; protect the host file or use your deployment's secret manager. secrets/ is excluded
from Git and Docker builds. Host OS credentials are not automatically shared with containers.
For Shodan, use the same mounted-secret pattern:
docker run --rm -i -v 221b-data:/data \
--mount type=bind,src=/absolute/path/shodan-key,dst=/run/secrets/shodan,readonly \
-e SHODAN_API_KEY_FILE=/run/secrets/shodan 221b-mcpFor urlscan, mount its key in the same way:
docker run --rm -i -v 221b-data:/data \
--mount type=bind,src=/absolute/path/urlscan-key,dst=/run/secrets/urlscan,readonly \
-e URLSCAN_API_KEY_FILE=/run/secrets/urlscan 221b-mcpDevelopment
python -m pip install -e '.[dev,sherlock]'
ruff check .
ruff format --check .
pytest -qserver.py owns the lifecycle, tools.py defines the public tools, and
tool_handlers/ holds their implementations. runtime.py connects handlers to shared
services. Tests cover handlers and a real local MCP handshake without live web requests.
License
MIT. See LICENSE.
Available Tools
8 toolsexport_findingsA
Export 1–100 existing evidence record IDs to a new local JSON or Markdown file.
Inputs: record_ids (required), format.
inspect_pageA
Fetch a public HTML/text page and extract text, links and emails. No browser rendering.
Inputs: url (required).
lookup_domainA
Look up A, AAAA, MX, NS and TXT DNS records, plus available RDAP registration data.
Inputs: domain (required).
lookup_shodan_hostA
Retrieve Shodan's recorded services for a public IP. Requires a Shodan API key.
Returns up to 100 services and bounded banner excerpts. Observations are not live checks.
Inputs: ip (required).
search_archivesA
Find Wayback captures of an exact URL, deduplicated by digest. At most 100 captures.
Inputs: url (required), limit.
search_shodanA
Search Shodan's indexed services using native filters. Requires a Shodan API key.
May consume query credits. Fetches one explicit page of up to 100 services; limit (1–100) caps returned evidence, not credit usage. No automatic pagination or retries.
Inputs: query (required), page, limit.
search_usernameA
Find candidate accounts with local Sherlock.
depth: light (default) checks 20 curated popular sites; dev checks developer platforms; complete requests all available sites, including adult sites, with a 10-minute deadline. Upstream false-positive exclusions apply. Explicit sites override the preset's selection. Requires the sherlock package extra. A match does not establish the owner's identity.
Inputs: username (required), depth, sites.
search_webB
Find public mentions; defaults to keyless metasearch. Max 20 results.
Supports search operators where the selected engines support them. Optional provider='brave' uses the Brave API and requires a key. Omit provider to use the configured default.
Inputs: query (required), limit, provider.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource and action: username search, web search, page inspection, DNS/RDAP lookup, archive lookup, evidence export, and two clearly separated Shodan operations. Even search_shodan vs lookup_shodan_host are easy to distinguish by indexed search vs. host-by-IP.
All tool names follow a consistent lower_snake_case verb_noun pattern. search_* indicates discovery-style tools, lookup_* indicates point lookups, and inspect_page/export_findings map one clear action to one clear object.
Eight tools is a well-scoped size for an OSINT investigation toolkit. Each tool adds a distinct source or capability, and there is no apparent bloat or thinness in the set.
The core investigation workflow is well covered: find subjects, search web and archives, inspect pages and domains, enrich with Shodan, and export evidence. Minor gaps remain around direct evidence record management and browser-level page inspection, but agents can work around them using the provided tools.
Maintenance
Related MCP Connectors
Web search API and MCP server for developers building AI agents.
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
Hosted MCP server for live public-data APIs and Skills for AI agents.
Zero-log MCP server with 49 tools for AI guardrails, secret scanning, MCP linting & EU compliance.
491
Related MCP Servers
- AlicenseDqualityDmaintenanceA comprehensive MCP server providing tools for IP, domain, email, and image-based open-source intelligence. It integrates services like Shodan, VirusTotal, and HaveIBeenPwned to facilitate advanced security research and data gathering.56108 npmISC
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes a 60+ tool security and threat-intel stack to AI agents, enabling secret scanning, Sigma rule generation, ransomware lookup, OSINT, and deep research.1MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that exposes multiple OSINT tools to AI assistants like Claude, enabling sophisticated reconnaissance and information gathering tasks using industry-standard OSINT tools.249MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server providing 15 OSINT tools over free, public sources for AI agents, enabling domain reconnaissance, subdomain discovery, DNS lookups, host profiling, CVE search, and more without API keys.MIT