Skip to content

Conversation

@SamInTheShell
Copy link

I had Claude make these changes to support permissions for MCP tool calls. There are some MCP servers I use that I just can't trust an AI to call freely.

@rekram1-node
Copy link
Collaborator

rekram1-node commented Oct 22, 2025

Hey thanks for PR, one note tho:
This is a duplicate of an existing PR, also I already left feedback on the other to outline how we should approach it:
#3258

@SamInTheShell
Copy link
Author

@rekram1-node I made updates based on the feedback over in that issue as well as catching some of the files that weren't modified in my initial commit. Not sure if you want to wait on that issue or just iterate something in. How would you like to proceed?

@SamInTheShell SamInTheShell changed the title Add MCP tool permissions Add granular tool permissions Oct 22, 2025
Comment on lines 23 to 26
// Ensure required fields exist and have correct types
return 'edit' in data &&
'bash' in data &&
(typeof data.bash === 'string' || typeof data.bash === 'object');
Copy link
Collaborator

Choose a reason for hiding this comment

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

You shouldn't need to do this, you should be able to leave it as it was but add a catchall for the undefined permissions

Copy link
Collaborator

Choose a reason for hiding this comment

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

example:

agent: z
.object({
plan: Agent.optional(),
build: Agent.optional(),
general: Agent.optional(),
})
.catchall(Agent)

And after cleaning this up it should allow you to not have to have the type assertions in some of the other places

Copy link
Author

Choose a reason for hiding this comment

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

I'll follow up on this over the weekend. Typescript isn't really a language I'm strong in, but I'll make the changes for this.

Copy link
Author

@SamInTheShell SamInTheShell Oct 24, 2025

Choose a reason for hiding this comment

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

I had Claude make the updates, they passed the typecheck and commit hooks. I wont be able to actually test till the weekend. Figured I'd just get the changes in so it's at least available for now.

My suspicion is that it's change for the bash permissions fallback was erroneous as well.

Copy link
Author

Choose a reason for hiding this comment

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

@rekram1-node I did testing last night and this morning. The changes work. I only changed the part where it had a fallback permission for bash, I think defaults should already be handled in agents.ts

Let me know if anything else needs some work.

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