Skip to content

feat: add OpenAPI 3.1 spec and MCP server binary#225

Open
ZPascal wants to merge 21 commits into
mainfrom
feature/ai-agent-support
Open

feat: add OpenAPI 3.1 spec and MCP server binary#225
ZPascal wants to merge 21 commits into
mainfrom
feature/ai-agent-support

Conversation

@ZPascal

@ZPascal ZPascal commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Static OpenAPI 3.1 spec embedded in binary, served at GET /openapi.json (no auth required)
  • Documents all endpoints: POST /register, POST /update, GET /health, and the admin record CRUD endpoints
  • New cmd/acme-dns-mcp/ binary: stdio-based MCP server wrapping the acme-dns HTTP API as structured tools
  • MCP tools: register_subdomain, update_txt_record, list_dns_records, create_dns_record, update_dns_record, delete_dns_record, health_check
  • Config loaded from ~/.acme-dns-mcp/config.toml or env vars (ACMEDNS_BASE_URL, ACMEDNS_ADMIN_TOKEN, etc.)
  • Credentials never passed as tool arguments — config only
  • .goreleaser.yml updated to build and publish acme-dns-mcp alongside acme-dns

Test Plan

  • go test -race ./... passes
  • go build ./... builds cleanly
  • GET /openapi.json returns valid OpenAPI 3.1 JSON
  • MCP health_check tool returns {"status":"ok"} against a running instance
  • MCP list_dns_records returns {"records":[...]} with admin token configured
  • Missing credentials return {"error":"admin_token not configured"}

ZPascal added 11 commits May 30, 2026 17:18
- feature/dns-api-extended: admin API for full DNS record management
- feature/ai-agent-support: OpenAPI 3.1 spec + MCP server binary
- feature/security-ha: security hardening + active-active HA deployment guide
- dns-api-extended: 7 tasks, TDD, admin CRUD API + DNS integration
- ai-agent-support: 7 tasks, OpenAPI spec + MCP binary
- security-ha: 7 tasks, 5 security fixes + HA deployment guide
Implements adminBearerMiddleware, adminListRecords, adminCreateRecord,
adminUpdateRecord, and adminDeleteRecord HTTP handlers behind Bearer
token auth; adds corresponding tests with DB teardown via t.Cleanup.
@ZPascal ZPascal force-pushed the feature/ai-agent-support branch from 6d4dca2 to ef87060 Compare May 31, 2026 20:18
ZPascal added 2 commits May 31, 2026 22:44
…g, RR validation, DB index

- CORS: restore X-Api-User and X-Api-Key to AllowedHeaders (required by /update endpoint)
- api: normalize record names to FQDN (trailing dot) on create/update/list-filter so DNS
  lookups against q.Name (which always ends with dot) match stored records
- api: normalize type filter to uppercase for case-insensitive GET /admin/records?type=
- api: add probeRR helper — validates record value parses as a real DNS RR before storing,
  preventing values that are silently dropped at serve time
- dns: guard answerManaged against unknown QTYPEs (empty TypeToString result)
- dns: quote TXT and CAA values in RR string so values with spaces parse correctly
- db: add index on dns_records(name, type) to avoid full table scans on every DNS request
@ZPascal ZPascal force-pushed the feature/dns-api-extended branch from e929f6d to c941f89 Compare May 31, 2026 20:45
@ZPascal ZPascal force-pushed the feature/ai-agent-support branch from ef87060 to da3ae59 Compare May 31, 2026 20:45
@ZPascal ZPascal changed the title Feature/ai agent support feat: add OpenAPI 3.1 spec and MCP server binary May 31, 2026
@ZPascal ZPascal force-pushed the feature/dns-api-extended branch 3 times, most recently from c4045a1 to 360a8ae Compare June 25, 2026 17:41
@ZPascal ZPascal force-pushed the feature/dns-api-extended branch 2 times, most recently from a6be757 to 4d70ec0 Compare July 5, 2026 20:55
@ZPascal ZPascal force-pushed the feature/dns-api-extended branch from 4d70ec0 to 14501d8 Compare July 6, 2026 06:02
Base automatically changed from feature/dns-api-extended to main July 6, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant