You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, MCPServerStdio doesn't provide a mechanism to filter which tools are exposed from a given MCP Server. This means all tools from the server are always available, which may not be desirable in cases where we want to limit tool access for security or simplicity reasons.
Current Implementation
The current MCPServerStdio initialization only allows for basic configuration:
# Only expose specific tools from the MCP serverserver=MCPServerStdio(
params={
"command": "uvx",
"args": ["[email protected]"],
"env": {...}
},
tool_filter=['get-neo4j-schema', 'read-neo4j-cypher'] # Only expose these tools
)
Benefits
Enhanced security by limiting tool access
Simplified tool interfaces for specific use cases
Better control over agent capabilities
Implementation Considerations
The tool_filter parameter should be optional
When not provided, maintain current behavior of exposing all tools
Add validation to ensure filtered tools exist on the server
Consider adding warning logs when requested tools don't exist
Hi, considering that this feature has been requested multiple times, I've implemented a PR (#854 ) enabling the filtering of visible tools from an MCP server. @rm-openai, if you have time, I'd appreciate your feedback. Let me know if you'd like to include this implementation, otherwise I'll close the PR. Thanks!
Add Tool Filtering Capability to MCPServerStdio
Problem Statement
Currently, MCPServerStdio doesn't provide a mechanism to filter which tools are exposed from a given MCP Server. This means all tools from the server are always available, which may not be desirable in cases where we want to limit tool access for security or simplicity reasons.
Current Implementation
The current MCPServerStdio initialization only allows for basic configuration:
Desired Feature
Add the ability to filter tools similar to Google ADK's implementation:
Use Case Example
Benefits
Implementation Considerations
tool_filter
parameter should be optionalReferences
The text was updated successfully, but these errors were encountered: