Skip to content

feat: ONTAP MCP server should support read-only mode#4

Merged
cgrinds merged 1 commit into
mainfrom
cbg-ro
Feb 2, 2026
Merged

feat: ONTAP MCP server should support read-only mode#4
cgrinds merged 1 commit into
mainfrom
cbg-ro

Conversation

@cgrinds

@cgrinds cgrinds commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 30, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReadOnly boolean 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.

Comment thread server/server.go
Comment on lines 28 to +30
InspectTraffic bool
IsTest bool
Port int

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
InspectTraffic bool
IsTest bool
Port int
Port int
InspectTraffic bool
IsTest bool

Copilot uses AI. Check for mistakes.
Comment thread server/server.go
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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it easier to handle it in addTool itself if that avoids this readOnly check in multiple places?

@cgrinds cgrinds merged commit b2497ee into main Feb 2, 2026
7 of 8 checks passed
@cgrinds cgrinds deleted the cbg-ro branch February 2, 2026 13:31
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.

4 participants