-
Notifications
You must be signed in to change notification settings - Fork 225
Disable mutating tools in read-only mode #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable mutating tools in read-only mode #114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @diksipav 👍 can we please also add some tests for each of these to validate that the errors are thrown in read only mode?
Hey @gregnr it seems to me that for Or to not write full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diksipav I think there is no need for e2e tests in this case, let's just stick to unit. The logic is pretty straightforward and probably not worth the cost of running through a real LLM.
The tests you've added to server.test.ts
look good.
Looks good @diksipav 👍 you can ignore the failed E2E tests since these are just due to the missing API key. We'll merge this soon. |
I was wondering why it is not possible to still apply a migration in read-only mode with confirmation, while limiting read-only in execute SQL. It's kind of annoying because I want to use a migration system with MCP, but it's not possible in the read-only mode. |
Thanks again @diksipav and sorry for the long delay. Merging! |
What kind of change does this PR introduce?
Improvement: #112
What is the current behavior?
Read-only mode executes SQL as a read-only Postgres user (
execute_sql
tool), andapply_migration
tool is disabled in read-only mode.What is the new behavior?
Alongside
execute_sql
andapply_migration
all other mutating tools are disabled in read-only mode.