Repository navigation
feat: add confirmed AdGuard DNS rewrite tools - #177
Merged
TMHSDigital merged 2 commits intoNov 26, 2026
Merged
Conversation
This was referenced Nov 25, 2026
Signed-off-by: Asahi Arataki <[email protected]>
Signed-off-by: Asahi Arataki <[email protected]>
laozhej
force-pushed
the
feat/157-adguard-dns-rewrites
branch
from
November 26, 2026 04:14
c10b2f8 to
3912217
Compare
8 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Add
homelab_adguardRewritesto list local DNS records andhomelab_adguardRewriteSetto add or delete an exact domain/answer pair. The mutation tool requires booleanconfirm, previews the target and request withconfirm: 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/deletewithdomainandanswer.Type
Testing
cd mcp-server && npm run build && npm testpasses: 609 tests passed, 10 live-Pi tests skippedcd mcp-server && npm run typecheckpassespytest tests/ -v --tb=shortpasses: 272 tests passedCoverage 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
Prepared with OpenAI Codex assistance. The commit includes the required DCO sign-off. Version numbers and generated site files are unchanged.