Skip to content

feat: --read-only flag to disable write tools#28

Merged
kskarthik merged 2 commits intomainfrom
disable-components
Mar 17, 2026
Merged

feat: --read-only flag to disable write tools#28
kskarthik merged 2 commits intomainfrom
disable-components

Conversation

@kskarthik
Copy link
Copy Markdown
Collaborator

@kskarthik kskarthik commented Mar 13, 2026

Introduces a new --read-only command-line flag. When set to this flag, disables all tools that can modify bug states, ensuring the server operates in a read-only capacity.

Introduces a new `--read-only` command-line flag. When set to true, this
flag disables all tools that can modify bug states, ensuring the server
operates in a read-only capacity.
@kskarthik
Copy link
Copy Markdown
Collaborator Author

@lemenkov JFYI

This feature filters the methods which modify a bug via tool tags property. In case, you want to add more tools which alter bugs, please keep that in mind.

Also, this feature overlaps with the MCP_BUGZILLA_DISABLED_METHODS

currently, my thought is:

  1. check if MCP_BUGZILLA_DISABLED_METHODS  is set,
  2. if yes, do not call the disable_write_components function

This way it is simpler and easier for user & us to maintain. don't let the user mix both options

@kskarthik
Copy link
Copy Markdown
Collaborator Author

Surprisingly, having both options does not have any side effects in the program.

Maybe we can allow it side by side. Let me test it further,

@lemenkov
Copy link
Copy Markdown
Contributor

Both methods looks good (env-var and cli switch). Although MCP_BUGZILLA_DISABLED_METHODS looks more fine-grained I really don't see a reason to selectively disable any RO-methods. From my understanding disabling RW-methods makes much more sense in some configurations while selecting RO-metholds doesn't add up. But anyway I'm fine with both approaches.

@kskarthik
Copy link
Copy Markdown
Collaborator Author

The --read-only flag disables the RW tools only. MCP_BUGZILLA_DISABLED_METHODS can also do that, but each tool must be defined as a list

The `cli_args` are now stored directly as an argparse.Namespace object,
simplifying access to individual arguments and improving type hinting.

The README has been updated to reflect this change and clarify the
interaction between the `--read-only` flag and
`MCP_BUGZILLA_DISABLED_METHODS`.
@kskarthik kskarthik merged commit 3eecc2d into main Mar 17, 2026
4 checks passed
@kskarthik kskarthik deleted the disable-components branch March 17, 2026 15:36
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.

2 participants