feat: implementation vdc write ops - #73
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds opt-in write capabilities (create/update/delete) for Compute Engine data centers to the IONOS Cloud MCP server, introducing a scope-gated registration model plus a two-phase confirmation flow for create/delete to keep destructive actions explicit across eager/lazy/dynamic load modes.
Changes:
- Introduces
IONOS_MCP_TOOL_SCOPEparsing and a centralizedtools.RegisterToolgate that hides write/destructive tools unless explicitly enabled. - Adds two-phase confirmation infrastructure (
tools.ConfirmationStore) and implementscreate_datacenter,update_datacenter,delete_datacenter(with blast-radius preview for delete). - Extends dynamic/lazy modes and the test harness to preserve scope/confirmation behavior and validate write-tool behavior/parity.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scope.go | Adds scope parsing, tool classing, and gated registration helper. |
| tools/scope_test.go | Unit tests for scope parsing/classing/method-name matching/annotations. |
| tools/loader/loader.go | Threads scope + confirmation store through lazy compute loader. |
| tools/loader/loader_test.go | Updates loader tests for new compute loader signature. |
| tools/inputs.go | Adds typed inputs for create/update/delete datacenter tools. |
| tools/helpers.go | Adds ErrorText and IsNotFound helpers for user-facing tool errors and 404 detection. |
| tools/dynamic/search_test.go | Updates dynamic dispatcher tests to enforce scope-based guard instead of “read-only only”. |
| tools/dynamic/dynamic.go | Threads scope into dynamic registration and enforces scope gate in dispatcher call path. |
| tools/dynamic/catalog.go | Catalog now records per-tool mutation class via name-based classification. |
| tools/confirm.go | Implements in-memory, TTL, single-use confirmation token store. |
| tools/confirm_test.go | Unit tests for confirmation token mint/consume semantics, expiry, and concurrency. |
| tools/compute/register.go | Threads scope + confirmation store into compute registration; registers datacenter write tools. |
| tools/compute/datacenter.go | Switches read tools to go through tools.RegisterTool (read-only classification + annotations). |
| tools/compute/datacenter_write.go | Implements create/update/delete datacenter tools + previews and token-confirm flow. |
| test/setup_test.go | Enhances test harness (captures request bodies, adds scope-aware setup). |
| test/live/live_test.go | Updates live wiring to pass scope + confirmation store. |
| test/e2e/main_test.go | Ensures e2e runner strips IONOS_MCP_TOOL_SCOPE from ambient env by default. |
| test/dynamic_test.go | Adds scope-aware dynamic test setup and threads shared confirmation store. |
| test/compute_write_test.go | Adds protocol tests for write tools (two-phase, scope gating, dynamic parity). |
| README.md | Documents “read-only by default” + introduces Write operations section and examples. |
| docs/compute/datacenter.md | Documents new datacenter write tools, scope gating, and confirmation flow. |
| CLAUDE.md | Adds contributor guidance and invariants for scope + write-tool registration. |
| CHANGELOG.md | Adds release notes for opt-in datacenter write ops and confirmation flow. |
| main.go | Resolves scope at startup, builds shared confirmation store, threads both into load modes. |
| .mcp.json | Updates sample MCP config (currently opts into destructive scope). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cavramoniu-ionos
marked this pull request as ready for review
July 21, 2026 10:52
cavramoniu-ionos
requested review from
adeatcu-ionos,
avirtopeanu-ionos,
cristiGuranIonos,
mimihalescu and
rmocanu-ionos
July 21, 2026 10:52
mimihalescu
approved these changes
Jul 23, 2026
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.
Add opt-in write operations for Data Centers (blueprint)
Adds the first write tools to the (previously read-only) IONOS Cloud MCP server. Data Centers are the blueprint for other resources.
Enablement
IONOS_MCP_TOOL_SCOPE, hierarchical:read→ read-onlywrite→ +create_*,update_*destructive→ +delete_*(implieswrite)Tools added
create_datacenter— one DC per call (no batch)update_datacenter— partial (PATCH); location immutabledelete_datacenter— deletes the DC and everything inside itSecurity controls
tools.RegisterTool(server, scope, method, ...)helpertools/listcreate_*/update_*/delete_*(panics at boot on mismatch)readOnlyHint/destructiveHint/idempotentHint)Two-phase confirmation (create + delete)
tools.ConfirmationStore)Known limitation
destructiveTests
build,vet,gofmt,lint(0 issues), unit + in-memory (-race), mocked e2eDocs
Out of scope / follow-ups
readOnlyHinton the other ~117 read tools