
DNS MCP Server
io.github.mclose由 GitHub 帳號 mclose 發布v1.3.4更新於 Oct 24, 2026
Real-time DNS security analysis — DNSSEC, email auth, and RDAP. Built for SOC investigations.
概覽
一個 DNS 安全分析伺服器,讓助理對網域執行 DNSSEC、郵件認證、信譽與註冊資訊查詢。
- 可以做什麼
- 透過 DoH 執行多種記錄類型的 DNS 查詢,可選用戶端子網提示,並偵測遞迴解析器是否遭竄改。從 IANA 根開始驗證 DNSSEC 信任鏈,分析 NSEC/NSEC3 不存在證明。稽核郵件認證:SPF、DMARC、DKIM 選擇器、DANE 與 TLSA 記錄。對照 DNS 黑名單檢查 IP 與網域信譽,查詢 ASN 與 BGP 資訊,辨識 fast-flux 輪換。透過 RDAP 取得網域註冊資料,並讀取或重設工作階段內的工具呼叫統計。
- 適用情境
- 適合資安分析師與 SOC 調查,需要在對話中完成網域安全態勢檢查、釣魚郵件研判,或 DNSSEC 與郵件認證稽核。也適合事件應變時的臨時 DNS 偵察。
- 執行需求
- 以本機 Docker 容器透過 stdio 執行,但 README 描述的是 Streamable HTTP 部署,需要 Docker、Pocket ID 或其他 OIDC 提供者、TLS 反向代理與網域名稱。需在 .env 中設定 POCKET_ID_BASE_URL、POCKET_ID_API_KEY 與 SERVER_URL。需要對外連線 DNS-over-HTTPS 與 RDAP。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 DNS MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
DNS MCP Server
Real-time DNS security analysis for AI assistants via MCP. Gives your assistant the ability to investigate domains the way a practitioner would — DNSSEC chain validation, email authentication posture, and registration intelligence — without leaving your chat session.
Built by a cybersecurity professional for SOC investigation workflows. Not a toy — the same queries you would run at the command line, accessible through any MCP-compatible assistant in real time.
Architecture (2.0.0)
dns-mcp is a Streamable HTTP MCP server with OAuth via Pocket
ID. Tool implementations are thin wrappers around the
dns_tool Python library, which
owns all DNS logic. The server itself is ~430 lines of code: auth bootstrap,
tool registration, and prompt loading.
Three benefits over the previous stdio-only architecture:
- Network-accessible — hosted MCP servers can serve any client, not just ones that can spawn a local subprocess.
- OAuth-protected — bearer JWTs verified against Pocket ID JWKS; per-user
identity available to tools via
whoami. - Library-first —
dns_toolis published independently and reusable. The same code powers a CLI, this MCP server, and (eventually) a REST API.
The old stdio architecture lives at server.py.legacy for porting reference.
The remote branch (mcp-shim Go bridge) is deprecated.
Tools
dns-mcp 2.0.0 currently exposes 19 tools. Ten additional tools from the
1.x stdio architecture are pending port into dns_tool — see
Open work.
Meta
DNS
Email security
Threat intelligence
Registration
Observability
Downstream consumers (e.g. ~/projects/yahoo batch forensics) call
session_stats as the final tool in each investigation to record which
DNS tools were consulted; an empty stats dict indicates a "cold read"
where the analyst LLM produced a verdict without DNS verification.
Tool descriptors
All 19 tools use Pydantic Field for parameter descriptors. The LLM sees:
- Per-parameter descriptions explaining what the parameter means
Literal[...]enums for record types and protocols (no string-guessing)- Regex patterns validating FQDN syntax, IPv4 dotted-quad, DKIM selector format
- Length and range constraints (port 1–65535, FQDN max 253 chars, etc.)
Constraints are advertised in the tool descriptor JSON Schema and enforced at
the MCP boundary by FastMCP — invalid input is rejected before dns_tool is
called. See src/dns_mcp/server.py for the type alias definitions.
Analyst Prompts
Four analyst prompt templates ship with the server. Any MCP-compatible client that supports prompts can list and invoke them.
Prompt invocation requires client-side UI support. Claude Code surfaces them
as /mcp__dns-mcp__<prompt_name>. Claude.ai web exposes prompts via the
slash-command picker. Use tools ad-hoc in clients that do not support prompts.
Example
Ask your assistant: "Check the email security posture of example.com"
The assistant calls check_spf, check_dmarc, check_dane in sequence and
returns a complete analysis:
No copy-pasting dig commands. No tab-switching. One question.
Quick Start
Prerequisites
- Docker
- A Pocket ID instance (or any OIDC provider supporting Dynamic Client Registration)
- A reverse proxy with TLS termination (Caddy, nginx, etc.)
- A domain name pointing at your reverse proxy
1. Pocket ID
Mint an admin API key in Pocket ID's UI: Settings → API Keys → Create new
key. Name it dns-mcp so you can revoke just this service if needed. Copy
the key value (it is shown once).
2. .env
3. Deploy
The image installs dns_tool as a versioned dependency (URL-pinned in
pyproject.toml); make build is also available for direct development.
4. Reverse proxy
The container listens on port 8000 (HTTP). Front it with TLS termination:
If you use mclose/gateway (the Caddy +
DNS-01 setup that serves dns-mcp.lab.deflationhollow.net), drop a
conf.d/dns-mcp.conf matching the existing pattern.
5. Connect
Add https://dns-mcp.example.com/mcp as a connector in your MCP client. The
OAuth flow runs once on first connect — Claude.ai redirects to Pocket ID, you
authenticate, the server creates a DCR client on your Pocket ID instance, and
returns a JWT. Subsequent tool calls send that JWT as a bearer token; the
server verifies against Pocket ID JWKS.
Open work
Eleven tools from the 1.x stdio architecture are not yet ported into
dns_tool and are therefore not registered in 2.0.0:
check_caa(with CNAME chain tracing and wildcard delegation detection)check_zone_transfer(AXFR enumeration)check_bimi,check_mta_sts,check_smtp_tlsrptcheck_ct_logs(Certificate Transparency log enumeration via crt.sh)timestamp_converter,reverse_dnsenumerate_dkim_selectors,dns_dig_style,dns_query_dot
Reference implementations live in server.py.legacy. Each port involves
moving the function into the appropriate dns_tool module
(dns_tool.email, dns_tool.intel, etc.), adding tests on the library
side, and registering a one-line wrapper in src/dns_mcp/server.py.
File structure
Day-to-day
Security
- No shell execution — all DNS via
dns_tool(dnspython internally), RDAP viarequests - OAuth bearer JWT verification against Pocket ID JWKS on every tool call
- Pydantic
Fieldconstraints enforced at MCP boundary — invalid input rejected before reachingdns_tool - Non-root container user (
claude, uid 1000) - SPF recursion limit enforced (RFC 7208)
- RDAP: 10s timeout, max 3 redirects
License
MIT
來源:README.md,提交 e6e6cde
工具
0版本歷史
1- v1.3.4最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。