-
Notifications
You must be signed in to change notification settings - Fork 41
add a mechanism to disable tools from the config #63
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
Conversation
|
||
const DEFAULT_COMMENT = "Added by Atlas MCP"; | ||
|
||
export class CreateAccessListTool extends AtlasToolBase { | ||
protected name = "atlas-create-access-list"; | ||
protected description = "Allow Ip/CIDR ranges to access your MongoDB Atlas clusters."; | ||
protected operationType: OperationType = "create"; |
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.
@@ -74,6 +76,12 @@ function getEnvConfig(): Partial<UserConfig> { | |||
return; | |||
} | |||
|
|||
// Try to parse an array of values | |||
if (value.indexOf(",") !== -1) { | |||
obj[currentField] = value.split(",").map((v) => v.trim()); |
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.
if this supports an array anyways we could just always do the split without the indexOf
check
have we seen this pattern before? are there other MCP servers that allow disabling tools? |
Yes, there's a handful of database-focused servers I've seen implement some form of protection against destructive operations. E.g. mcp-server-mysql has env variables such as I think this is ultimately important to instil confidence in users, especially with some agents being fairly opaque with what they're doing. I know most allow you to disable tools one-by-one, but with server updates, you run the risk of letting a destructive tool sneak in and wreak havoc on your data. |
@nirinchev I was thinking here, what if all tools declared a list of tags instead of one category? this way we could have something like disableTools |
Right now we're kind of there, but with the caveat that all tools have exactly 2 "tags" - the category and the operation type. Therefore if a user specifies |
That works for me, just make sure to have a category for the main tools, could be 'tools', 'driver' or 'server'. At least we would be consistent. |
What would be in the |
Maybe |
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.
it works for me, just make sure to leave documentation on README.md otherwise it will be difficult for people to find out how to use these values
Allows disabling of tools by category, operation type, or name. Example config:
or as command line args:
Fixes #54