Hello,
i have explored a bit the dynamic tool example but it seems that tool are like a "global" concept where i can add and remove tool based on "something".
So if i understand correctly the usage is rather limited, as i can basically enable or disable a tool based on a certain condition, but not on who is executing the call.
Now, if i have a user that connect with a oauth set of grant, it will be cool to filter the tool based on his role/permission set.
At the moment what happen is that i have 2 tool toolA -> all toolB -> user with a specific grant
when user a user not form group B connect, he can ask the question that trigger the tool and then get an exception "you can't use tool b". wouldn't be better to disable the tool so the agent don't even try to invoke it? save token, allow fallback for other tool/agent_logic to be executed?
Another option is to split mcp server based on the "grant" but seems a lot of 'partitioning' that sometimes isn't even necessary and create duplication (Same request model, same db, some logic etc etc)
Apologize for my english, hope my suggestion is clear enough (reasonable or not, it's another matter)
Comment From: ilayaperumalg
Hi @matteo-rama, Thanks for creating the issue.
On MCP tooling, we have recently introduced custom MCP tool filtering by having a custom implementation of McpToolFilter
. Please read here for more information on this. Does this help solving your case?
Comment From: matteo-rama
it's actually intresting, do you have a full example where i can see how to use in conjuncton with McpConnectionInfo?
i guess i should add some meta data on mcconnectioninfo somehow inside servlet filter, but autowire doesn't make much sense to me at this point isn't it?
how should i get it into a servlet filter, to populate it with some useful insight to do later the check?
thanks