dehashed-mcp
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., "@dehashed-mcpsearch for breaches involving my email"
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.
dehashed-mcp
An MCP (Model Context Protocol) server that wraps the DeHashed breach-data API and exposes every available endpoint as an MCP tool — with server-side API key management, structured Docker logging, and a pluggable RBAC/ABAC authorization engine that enforces access control at the individual tool call level.
Key design decisions
Concern | Decision |
API key | Held exclusively in the server process (env var). Never passed to or returned by any tool. |
Transport | Not decided here — wire stdio, HTTP/SSE, or a gRPC proxy on top. |
MCP auth | Not decided here — add bearer token / OAuth / mTLS at the transport layer. |
Tool-level authz | RBAC + ABAC via a hot-reloadable YAML policy file. Per-tool, per-tenant, per-domain-scope, per-page-size. |
Logging | structlog → JSON → stdout/stderr → |
Related MCP server: fluidattacks-mcp
Project layout
dehashed-mcp/
├── src/dehashed_mcp/
│ ├── __init__.py
│ ├── main.py # FastMCP app + entrypoint
│ ├── config.py # Pydantic Settings (reads env vars)
│ ├── client.py # Async DeHashed HTTP client
│ ├── models.py # Request/response Pydantic models
│ ├── tools.py # All 17 MCP tool definitions
│ ├── authz.py # RBAC/ABAC engine
│ └── logging_config.py # structlog → Docker logs
├── config/
│ └── policy.yaml # Default authorization policy
├── tests/
│ ├── conftest.py
│ ├── test_authz.py
│ ├── test_client.py
│ └── test_models.py
├── Dockerfile
├── docker-compose.yml
├── docker-entrypoint.sh
├── pyproject.toml
└── .env.exampleQuick start
1. Configure
cp .env.example .env
# Edit .env — set DEHASHED_API_KEY at minimum2. Build and run (stdio — Claude Desktop / any MCP host)
docker compose build
docker compose run --rm -i dehashed-mcp3. Run with HTTP/SSE transport
MCP_TRANSPORT=http docker compose up
# Server listens on http://localhost:80004. View logs
docker logs -f dehashed-mcp
# Output is newline-delimited JSONEnvironment variables
Variable | Required | Default | Description |
| yes | — | Your DeHashed API key |
| only for v1 | — | Account email (V1 Basic Auth only) |
| no |
|
|
| no |
| API base URL |
| no |
|
|
| no |
|
|
| no |
| HTTP listen port (http transport only) |
| no |
| Path to policy file |
| no |
| Reject unknown tenants when |
Available tools (17)
Tool | Description | Tags |
| Raw query string search | read, raw_query |
| Field + value + match mode | read |
| Email exact search | read |
| Username contains search | read |
| Plaintext password exact search | read, sensitive |
| Hash exact search | read, sensitive |
| IP address exact search | read |
| Name contains search | read |
| VIN exact search | read |
| Address contains search | read |
| Phone contains search | read |
| Domain contains search | read |
| Breach/database name search | read |
| License plate exact search | read |
| Cryptocurrency address exact search | read |
| Retrieve remaining API credits | read, account |
| Auto-paginate and aggregate | read, bulk, raw_query |
Query match modes (search_by_field, search)
Mode | Syntax | Notes |
|
| Default loose match |
|
| Quoted exact match |
|
| ⚠ Reported broken in V2 (May 2025) |
|
|
|
Authorization — RBAC/ABAC policy
Tool-level authorization is enforced before any DeHashed API call. The policy is a YAML file (config/policy.yaml) that can be hot-mounted into the container.
Policy structure
tenants:
<tenant_id>:
roles:
<role_name>:
allow: [<tool_name>, ...] # or ["*"] for all tools
deny: [<tool_name>, ...] # always wins over allow
resource_scopes:
domains: [acme.com, ...] # restrict domain/email tools
attributes:
max_page_size: 500 # cap the `size` param
max_pages: 3 # cap paginate_all max_pages
default: # fallback (strict_tenant=false only)
roles: ...CallerContext injection
The MCP metadata dict passed with each tool call is the contract between your transport/auth layer and the authz engine:
# What your transport layer injects into _meta:
{
"tenant": "acme",
"roles": ["analyst"],
"attributes": {} # optional per-call ABAC overrides
}At the transport layer (bearer token, OAuth, mTLS, API key validation), you decode the identity and populate this dict before the tool handler runs. The server enforces it on every call.
Hot-reload policy
Send SIGUSR1 or call authz.get_policy().reload() to reload the policy file without restarting the server.
Transport configuration
This server is transport-agnostic. Choose your transport at deploy time:
stdio (default)
Best for Claude Desktop integration:
{
"mcpServers": {
"dehashed": {
"command": "docker",
"args": ["run", "--rm", "-i",
"-e", "DEHASHED_API_KEY=xxx",
"dehashed-mcp:latest"]
}
}
}HTTP / SSE
Run with MCP_TRANSPORT=http. The FastMCP app is also exported as an ASGI app object for direct uvicorn/gunicorn use:
uvicorn dehashed_mcp.main:app --host 0.0.0.0 --port 8000Add your auth middleware (bearer token validation, OAuth introspection, etc.) as ASGI middleware on top.
gRPC
Put a gRPC-to-HTTP/2 transcoding proxy (e.g., Envoy, grpc-gateway) in front of the HTTP transport.
Development
# Install with dev extras
pip install -e ".[dev,http]"
# Run tests
pytest
# Lint
ruff check src tests
black --check src tests
mypy srcLogging
All log output is newline-delimited JSON sent to stdout. Docker captures it via the configured log driver (json-file by default in docker-compose.yml).
docker logs dehashed-mcp | jq .Example log line:
{
"event": "dehashed.search.ok",
"total": 42,
"returned": 100,
"balance": 95,
"service": "dehashed-mcp",
"version": "0.1.0",
"level": "info",
"timestamp": "2025-03-09T12:00:00.000Z"
}API keys, passwords, and tokens are automatically redacted from all log lines by the _redact_api_key processor in logging_config.py.
Credits and depletion
Each tool call that hits the DeHashed API costs 1 credit. paginate_all costs 1 credit per page. Monitor balance via get_balance or by watching the balance field in search results logged at INFO level. Policy max_pages attributes help prevent runaway credit consumption.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Free MCP server: 32 security & developer API tools -- WHOIS, DNS, CVE checks, IP reputation.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that provides integration with the Have I Been Pwned API to check if your accounts or passwords have been compromised in data breaches.42MIT

fluidattacks-mcpofficial
FlicenseNot gradedqualityDmaintenanceMCP server that provides tools for interacting with the Fluidattacks API-- 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.5682 npmISC
- AlicenseCqualityCmaintenanceAn educational MCP server exposing shell command execution (PowerShell and sh) and a benign tool for learning about MCP tools, resources, and security risks like tool poisoning.33MIT