Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a read-only mode feature to the ONTAP MCP server that restricts operations to non-mutating calls only. When enabled, the server will only register tools for listing/querying operations while excluding all create, update, and delete operations.
Changes:
- Added
ReadOnlyboolean field to the server options - Conditionally registered mutating tools based on the read-only mode setting
- Added command-line flag to enable read-only mode
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/server.go | Added ReadOnly field to Options struct, conditional tool registration logic, and logging for read-only mode |
| cmd/cmds.go | Added ReadOnly command-line flag and passed it through to server options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| InspectTraffic bool | ||
| IsTest bool | ||
| Port int |
There was a problem hiding this comment.
The fields in the Options struct are not consistently ordered. Consider organizing them alphabetically or grouping related fields together (e.g., Host and Port together) for better maintainability.
| InspectTraffic bool | |
| IsTest bool | |
| Port int | |
| Port int | |
| InspectTraffic bool | |
| IsTest bool |
| addTool(server, "create_volume", descriptions.CreateVolume, a.CreateVolume) | ||
| addTool(server, "update_volume", descriptions.UpdateVolume, a.UpdateVolume) | ||
| addTool(server, "delete_volume", descriptions.DeleteVolume, a.DeleteVolume) | ||
| if !a.options.ReadOnly { |
There was a problem hiding this comment.
Is it easier to handle it in addTool itself if that avoids this readOnly check in multiple places?
No description provided.