Skip to content
3 changes: 3 additions & 0 deletions cmd/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var logger = setupLogger()
type Globals struct {
LogLevel string `enum:"debug,info,warn,error" default:"info" env:"LOG_LEVEL" help:"Log level, one of: ${enum}"`
ConfigPath string `name:"config" default:"ontap.yaml" env:"ONTAP_MCP_CONFIG" help:"ONTAP-MCP config path"`
ToolMode string `enum:"legacy,multiplex,both" default:"legacy" env:"TOOL_MODE" help:"ONTAP-MCP tool mode, one of: ${enum}"`
}
Comment thread
Hardikl marked this conversation as resolved.

type CLI struct {
Expand Down Expand Up @@ -44,6 +45,7 @@ func (a *StartCmd) Run(cli *CLI) error {
if err != nil {
return fmt.Errorf("failed to read config path=%s err=%w", cli.ConfigPath, err)
}
logger.Debug("tool mode", slog.String("tool_mode", cli.ToolMode))

opts := server.Options{
Host: cli.Start.Host,
Expand All @@ -52,6 +54,7 @@ func (a *StartCmd) Run(cli *CLI) error {
ReadOnly: cli.Start.ReadOnly,
Stateless: cli.Start.Stateless,
JSONResponse: cli.Start.JSONResponse,
ToolMode: cli.ToolMode,
}

app, err := server.NewApp(cfg, opts, logger)
Expand Down
26 changes: 24 additions & 2 deletions descriptions/descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@ const ListClusters = `List all ONTAP clusters registered in the server configura
USE THIS FIRST: Always call this before any other tool to discover valid cluster names.`

const CreateVolume = `Create a volume on a cluster by cluster name.`
const DeleteVolume = `Delete a volume on a cluster by cluster name.`
const UpdateVolume = `Update volume name, size, state, nfs export policy of volume on a cluster by cluster name.`
const DeleteVolume = `Delete a volume on a cluster by cluster name.`
const ModifyVolume = `Update or delete a volume on a cluster by cluster name.`

const CreateSnapshot = `Create a snapshot of a volume on a cluster by cluster name.`
const DeleteSnapshot = `Delete a snapshot of a volume on a cluster by cluster name.`
const RestoreSnapshot = `Restore a volume to a snapshot on a cluster by cluster name.`
const ModifySnapshot = `Restore or delete a snapshot of a volume on a cluster by cluster name.`

const CreateSnapshotPolicy = `Create a snapshot policy on a cluster by cluster name.`
const UpdateSnapshotPolicy = `Update a snapshot policy comment and enable/disable snapshot policy on a cluster by cluster name.`
const DeleteSnapshotPolicy = `Delete a snapshot policy on a cluster by cluster name.`
const ModifySnapshotPolicy = `Update or delete a snapshot policy on a cluster by cluster name.`
const CreateSchedule = `Create a cron schedule on a cluster by cluster name. Ex: 5 1 * * *, this cron expression indicates schedule would be triggered at 01:05 AM for every day`

const AddScheduleInSnapshotPolicy = `Add a schedule entry to an existing snapshot policy on a cluster by cluster name.`
const UpdateScheduleInSnapshotPolicy = `Update a schedule entry within an existing snapshot policy by specifying the snapshot count or SnapMirror label on a cluster, identified by its cluster name. At least one of the following parameters—snapshot count or SnapMirror label—must be provided.`
const RemoveScheduleInSnapshotPolicy = `Remove a schedule entry from an existing snapshot policy on a cluster by cluster name.`
const ModifyScheduleInSnapshotPolicy = `Update or remove a schedule entry in an existing snapshot policy on a cluster by cluster name.`

const ListQoSPolicies = `List QoS policies from an ONTAP cluster — includes both SVM-scoped and cluster-scoped (admin SVM) policies.

Expand All @@ -65,74 +69,90 @@ Units:
const CreateQoSPolicy = `Create a QoS policy on a cluster by cluster name.`
const UpdateQoSPolicy = `Update a QoS policy name, max throughput iops, min throughput iops, expected iops, peak iops and absolute min iops on a cluster by cluster name.`
const DeleteQoSPolicy = `Delete a QoS policy on a cluster by cluster name.`
const ModifyQoSPolicy = `Update or delete a QoS policy on a cluster by cluster name.`

const CreateNFSExportPolicy = `Create NFS Export policies on a cluster by cluster name.`
const UpdateNFSExportPolicy = `Update NFS Export policies name, client match, read only rules, read write rules on a cluster by cluster name.`
const DeleteNFSExportPolicy = `Delete NFS Export policies on a cluster by cluster name.`
const ModifyNFSExportPolicy = `Update or delete NFS Export policies on a cluster by cluster name.`
const CreateNFSExportPolicyRules = `Create NFS Export policies rules on a cluster by cluster name.`
const UpdateNFSExportPolicyRules = `Update NFS Export policies rules with client match, read only rules, read write rules on a cluster by cluster name.`
const DeleteNFSExportPolicyRules = `Delete NFS Export policies rules on a cluster by cluster name.`
const ModifyNFSExportPoliciesRule = `Update or delete NFS Export policies rules on a cluster by cluster name.`

const CreateCIFSShare = `Create CIFS share on a cluster by cluster name.`
const UpdateCIFSShare = `Update CIFS share path on a cluster by cluster name.`
const DeleteCIFSShare = `Delete CIFS share on a cluster by cluster name.`
const ModifyCIFSShare = `Update or delete a CIFS share on a cluster by cluster name.`

const CreateNFSService = `Create (enable) NFS service on an SVM. Allows configuring NFSv3, NFSv4.0, and NFSv4.1 protocol versions.`
const UpdateNFSService = `Update NFS service on an SVM. Toggle protocol versions (NFSv3, NFSv4.0, NFSv4.1) or enable/disable the service.`
const DeleteNFSService = `Delete (disable) NFS service on an SVM.`
const ModifyNFSService = `Update or delete NFS service on an SVM.`

const CreateCIFSService = `Create (enable) CIFS/SMB service on an SVM by joining an Active Directory domain. Requires AD domain FQDN, admin credentials, and a CIFS server name (NetBIOS name).`
const UpdateCIFSService = `Update CIFS/SMB service on an SVM. Can rename the CIFS server.`
const DeleteCIFSService = `Delete (disable) CIFS/SMB service on an SVM. Unjoins the Active Directory domain.`
const ModifyCIFSService = `Update or delete CIFS/SMB service on an SVM.`

const CreateDNS = `Configure DNS on an SVM. Required before joining Active Directory or resolving hostnames.`
const DeleteDNS = `Remove DNS configuration from an SVM.`

const CreateQtree = `Create Qtree on a cluster by cluster name.`
const UpdateQtree = `Update Qtree name on a cluster by cluster name.`
const DeleteQtree = `Delete Qtree on a cluster by cluster name.`
const ModifyQtree = `Update or delete Qtree on a cluster by cluster name.`

const CreateNVMeService = `Create NVMe service on a cluster by cluster name.`
const UpdateNVMeService = `Update NVMe service admin state on a cluster by cluster name.`
const DeleteNVMeService = `Delete NVMe service on a cluster by cluster name.`
const ModifyNVMeService = `Update or delete NVMe service on a cluster by cluster name.`

const CreateIscsiService = `Create iSCSI service on a cluster by cluster name.`
const UpdateIscsiService = `Update iSCSI service admin state on a cluster by cluster name.`
const DeleteIscsiService = `Delete iSCSI service on a cluster by cluster name.`
const ModifyIscsiService = `Update or delete iSCSI service on a cluster by cluster name.`

const CreateNetworkIPInterface = `Create Network IP interface on a cluster by cluster name.`
const UpdateNetworkIPInterface = `Update Network IP interface with auto revert enable/disable and service policy name on a cluster by cluster name.`
const DeleteNetworkIPInterface = `Delete Network IP interface on a cluster by cluster name.`
const ModifyNetworkIPInterface = `Update or delete Network IP interface on a cluster by cluster name.`

const CreateNVMeSubsystem = `Create NVMe subsystem on a cluster by cluster name.`
const UpdateNVMeSubsystem = `Update NVMe subsystem comment on a cluster by cluster name.`
const DeleteNVMeSubsystem = `Delete NVMe subsystem on a cluster by cluster name.`
const ModifyNVMeSubsystem = `Update or delete NVMe subsystem on a cluster by cluster name.`

const AddNVMeSubsystemHost = `Add a host NQN to an NVMe subsystem on a cluster by cluster name.`
const RemoveNVMeSubsystemHost = `Remove a host NQN from an NVMe subsystem on a cluster by cluster name.`

const CreateNVMeNamespace = `Create NVMe namespace on a cluster by cluster name.`
const UpdateNVMeNamespace = `Update NVMe namespace total provisioned size on a cluster by cluster name.`
const DeleteNVMeNamespace = `Delete NVMe namespace on a cluster by cluster name.`
const ModifyNVMeNamespace = `Update or delete NVMe namespace on a cluster by cluster name.`

const CreateNVMeSubsystemMap = `Create NVMe subsystem map on a cluster by cluster name.`
const DeleteNVMeSubsystemMap = `Delete NVMe subsystem map on a cluster by cluster name.`

const CreateLUN = `Create a LUN on a specified volume and SVM with a given size and OS type.`
const UpdateLUN = `Update a LUN: resize, rename, or toggle enable/disable state (online/offline).`
const DeleteLUN = `Delete a LUN from a specified volume and SVM.`
const ModifyLUN = `Update or delete a LUN from a specified volume and SVM.`

const CreateFCPService = `Create FCP service on a cluster by cluster name.`
const UpdateFCPService = `Update FCP service admin state on a cluster by cluster name.`
const DeleteFCPService = `Delete FCP service on a cluster by cluster name.`
const ModifyFCPService = `Update or delete FCP service on a cluster by cluster name.`

const CreateFCInterface = `Create FC interface on a cluster by cluster name.`
const UpdateFCInterface = `Update FC interface admin state, name of the FC port and node on which the FC port is located on a cluster by cluster name.`
const DeleteFCInterface = `Delete FC interface on a cluster by cluster name.`
const ModifyFCInterface = `Update or delete FC interface on a cluster by cluster name.`

const CreateIGroup = `Create an igroup (initiator group) on a cluster by cluster name.`
const UpdateIGroup = `Update an igroup name, comment, host operating system on a cluster by cluster name.`
const DeleteIGroup = `Delete an igroup on a cluster by cluster name.`
const ModifyIGroup = `Update or delete an igroup on a cluster by cluster name.`
const AddIGroupInitiator = `Add an initiator to an igroup on a cluster by cluster name.`
const RemoveIGroupInitiator = `Remove an initiator from an igroup on a cluster by cluster name.`

Expand All @@ -142,8 +162,9 @@ const DeleteLunMap = `Delete a LUN map on a cluster by cluster name. Removes the
const CreateSnapMirror = `Create a SnapMirror relationship on a cluster by cluster name.`
const UpdateSnapMirror = `Update a SnapMirror relationship on a cluster by cluster name. Supports updating the snapmirror policy, snapmirror relationship state and transfer schedule of an existing relationship identified by its destination SVM and volume.`
const DeleteSnapMirror = `Delete a SnapMirror relationship on a cluster by cluster name. Identifies the relationship by destination SVM and volume names.`
const ModifySnapMirror = `Update or delete a SnapMirror relationship on a cluster by cluster name. Identifies the relationship by destination SVM and volume names.`
const InitializeSnapMirror = `Initialize a SnapMirror relationship on a cluster by cluster name. Starts the baseline transfer from source to destination. Identifies the relationship by destination SVM and volume names.`
const UpdateSnapMirrorTransfer = `Trigger a SnapMirror update transfer on a cluster by cluster name. Transfers new data from source to destination to bring the relationship up to date. Identifies the relationship by destination SVM and volume names.`
const UpdateSnapMirrorTransfer = `Trigger a SnapMirror transfer initialize or update on a cluster by cluster name. Transfers new data from source to destination to bring the relationship up to date. Identifies the relationship by destination SVM and volume names.`
const BreakSnapMirror = `Break a SnapMirror relationship on a cluster by cluster name. Sets the relationship state to broken_off, making the destination volume read-write. Identifies the relationship by destination SVM and volume names.`
const ResyncSnapMirror = `Resync a SnapMirror relationship on a cluster by cluster name. Re-establishes replication by setting the state back to snapmirrored. Identifies the relationship by destination SVM and volume names.`
Comment thread
Hardikl marked this conversation as resolved.

Expand All @@ -160,6 +181,7 @@ Pass cluster_name to automatically filter out fields and filters not available i
const CreateSVM = `Create an SVM on a cluster by cluster name.`
const UpdateSVM = `Update an SVM name, comment, or SVM state on a cluster by cluster name.`
const DeleteSVM = `Delete an SVM on a cluster by cluster name.`
const ModifySVM = `Update or delete an SVM on a cluster by cluster name.`
const DeleteSVMPeer = `Delete an SVM peer on a cluster by cluster name and local SVM name. The peer relationship UUID is looked up internally using the svm.name filter.`

const OntapGet = `Execute a read-only GET against any ONTAP REST endpoint.
Expand Down
13 changes: 7 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@ This displays all available environment variables with descriptions, authenticat

Some commonly used flags:

| Flag | Description |
|---|---|
| `--read-only` | Disable all mutating operations. Only read-only tools are registered. |
| `--stateless` | Disable mcp-session-id header validation. Required when deploying behind proxies or gateways that do not preserve session headers, e.g. on-premises data gateways. |
| `--json-response` | Respond with application/json instead of text/event-stream. Required when deploying behind proxies or gateways that do not relay SSE/chunked responses, e.g. on-premises data gateways. |
| `--inspect-traffic` | Log all MCP HTTP request and response bodies for debugging. |
| Flag | Description |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--read-only` | Disable all mutating operations. Only read-only tools are registered. |
| `--stateless` | Disable mcp-session-id header validation. Required when deploying behind proxies or gateways that do not preserve session headers, e.g. on-premises data gateways. |
| `--json-response` | Respond with application/json instead of text/event-stream. Required when deploying behind proxies or gateways that do not relay SSE/chunked responses, e.g. on-premises data gateways. |
| `--inspect-traffic` | Log all MCP HTTP request and response bodies for debugging. |
| `--tool-mode` | Control which mutating tool naming convention is exposed. One of `legacy` (default - separate `update_*`/`delete_*` tools), `multiplex` (combined `modify_*` tools), or `both` (registers both conventions). Can also be set via the `TOOL_MODE` environment variable. <br/> **Note:** `tool-mode` with value `multiplex` would reduce MCP tool count |

## Next Steps

Expand Down
60 changes: 59 additions & 1 deletion docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ To respond with `application/json` instead of `text/event-stream` (e.g. behind g
- `update_cifs_share`
- `delete_cifs_share`

## CIFS Service Management

- `create_cifs_service`
- `update_cifs_service`
- `delete_cifs_service`

## NFS Service Management

- `create_nfs_service`
- `update_nfs_service`
- `delete_nfs_service`

## NFS Export Policy Management

- `create_nfs_export_policies`
Expand Down Expand Up @@ -75,6 +87,15 @@ To respond with `application/json` instead of `text/event-stream` (e.g. behind g
- `update_svm`
- `delete_svm`

## SVM Peer Management

- `delete_svm_peer`

## DNS Management

- `create_dns`
- `delete_dns`

## Qtree Management

- `create_qtree`
Expand Down Expand Up @@ -133,4 +154,41 @@ To respond with `application/json` instead of `text/event-stream` (e.g. behind g

## Multi-Cluster Management

- `list_registered_clusters`
- `list_registered_clusters`

# Tool Mode

The ONTAP MCP server exposes mutating tools in two naming conventions, controlled by the `--tool-mode` flag (default: `legacy`; env: `TOOL_MODE`):

| Mode | Description |
|-------------|-------------------------------------------------------------------------------------------------------|
| `legacy` | Registers separate `update_*` and `delete_*` tools for each resource type. This is the default. |
| `multiplex` | Registers a single `modify_*` tool per resource type that handles both update and delete in one call. |
| `both` | Registers both conventions simultaneously. |

Tool mode only controls whether the per-resource `update_*`/`delete_*` tools and/or the multiplexed `modify_*` tools are registered. All `create_*` tools are registered regardless of tool mode.

## Modify tools (available in `multiplex` or `both` mode)

- `modify_volume`
- `modify_snapshot_policy`
- `modify_schedule_in_snapshot_policy`
- `modify_qos_policy`
- `modify_nfs_export_policies`
- `modify_nfs_export_policies_rules`
- `modify_svm`
- `modify_cifs_share`
- `modify_nfs_service`
- `modify_cifs_service`
- `modify_qtree`
- `modify_nvme_service`
- `modify_iscsi_service`
- `modify_lun`
- `modify_network_ip_interface`
- `modify_nvme_subsystem`
- `modify_nvme_namespace`
- `modify_fcp_service`
- `modify_fc_interface`
- `modify_igroup`
- `modify_snapmirror`
- `modify_snapshot`
Loading
Loading