Skip to content

feat: add confirmed AdGuard DNS rewrite tools - #177

Merged
TMHSDigital merged 2 commits into
TMHSDigital:mainfrom
laozhej:feat/157-adguard-dns-rewrites
Nov 26, 2026
Merged

TMHSDigital merged 2 commits into
TMHSDigital:mainfrom
laozhej:feat/157-adguard-dns-rewrites

Conversation

@laozhej

@laozhej laozhej commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Add homelab_adguardRewrites to list local DNS records and homelab_adguardRewriteSet to add or delete an exact domain/answer pair. The mutation tool requires boolean confirm, previews the target and request with confirm: false, and accepts validated ASCII hostnames, leading wildcard domains, IPv4, IPv6, and CNAME answers.

Both tools reuse per-node AdGuard credentials and port settings. Rewrite lists reject malformed/truncated output. The DNS management skill now uses these tools, and the registry, catalogs, security documentation, and tool counts are updated.

The shared AdGuard auth helper now quotes credentials containing apostrophes safely; confirmation previews also mask those quoted credentials. The new tools mask credentials in error and dry-run output.

Why

Fixes #157. Local DNS rewrites previously required a free-form command or manual configuration. Requests follow AdGuard Home's official OpenAPI definitions: GET /control/rewrite/list, POST /control/rewrite/add, and POST /control/rewrite/delete with domain and answer.

Type

  • New MCP tool
  • New skill
  • New rule
  • Bug fix
  • Documentation
  • Other

Testing

  • cd mcp-server && npm run build && npm test passes: 609 tests passed, 10 live-Pi tests skipped
  • cd mcp-server && npm run typecheck passes
  • pytest tests/ -v --tb=short passes: 272 tests passed
  • Tested against a live Pi (not available; no live DNS service modified)

Coverage includes IPv4/IPv6/CNAME and wildcard validation, invalid names and shell metacharacters, list parsing/overflow, exact add/delete payloads, node-specific credentials/ports, both confirmation paths, authentication errors, and dry-run masking. A stubbed local curl shell verifies credential quoting. The two credential regressions fail with the original helpers and pass after the fix. Tests ran on macOS with Node 22.23.0.

Checklist

  • No secrets or credentials committed
  • CHANGELOG.md updated
  • README.md updated (if adding tools/skills/rules)
  • CLAUDE.md updated (if adding tools/skills/rules)

Prepared with OpenAI Codex assistance. The commit includes the required DCO sign-off. Version numbers and generated site files are unchanged.

@laozhej
laozhej force-pushed the feat/157-adguard-dns-rewrites branch from c10b2f8 to 3912217 Compare November 26, 2026 04:14
@TMHSDigital
TMHSDigital merged commit 9185b22 into TMHSDigital:main Nov 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation mcp skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AdGuard local DNS rewrite tools (list, add, delete)

2 participants