File tree Expand file tree Collapse file tree
veadk/toolkits/apps/reverse_mcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,19 +28,19 @@ def __init__(
2828 ws_url : str ,
2929 mcp_server_url : str ,
3030 client_id : str ,
31- mcp_tool_filter : list [str ] | None = None ,
31+ filters : list [str ] | None = None ,
3232 ):
3333 """Start a client with reverse mcp,
3434
3535 Args:
3636 ws_url: The url of the websocket server (cloud). Like example.com:8000
3737 mcp_server_url: The url of the mcp server (local).
3838 client_id: The client id for the websocket connection.
39- mcp_tool_filter : Optional list of tool names to filter. If None, all tools are available.
39+ filters : Optional list of tool names to filter (whitelist) . If None, all tools are available.
4040 """
4141 self .ws_url = f"ws://{ ws_url } /ws?id={ client_id } "
42- if mcp_tool_filter :
43- self .ws_url += f"&mcp_tool_filter ={ ',' .join (mcp_tool_filter )} "
42+ if filters :
43+ self .ws_url += f"&filters ={ ',' .join (filters )} "
4444 self .mcp_server_url = mcp_server_url
4545
4646 # set timeout for httpx client
Original file line number Diff line number Diff line change @@ -156,13 +156,11 @@ async def ws_endpoint(ws: WebSocket):
156156 )
157157 return
158158
159- # Parse mcp_tool_filter from query params, comma-separated string
160- mcp_tool_filter_str = ws .query_params .get ("mcp_tool_filter" )
161- mcp_tool_filter = None
162- if mcp_tool_filter_str :
163- mcp_tool_filter = [
164- t .strip () for t in mcp_tool_filter_str .split ("," ) if t .strip ()
165- ]
159+ # Parse filters from query params, comma-separated string
160+ filters_str = ws .query_params .get ("filters" )
161+ filters = None
162+ if filters_str :
163+ filters = [t .strip () for t in filters_str .split ("," ) if t .strip ()]
166164
167165 logger .info (f"Register websocket { client_id } to session manager." )
168166 self .ws_session_mgr .connections [client_id ] = ws
@@ -180,7 +178,7 @@ async def ws_endpoint(ws: WebSocket):
180178 url = mcp_toolset_url ,
181179 headers = mcp_toolset_headers ,
182180 ),
183- tool_filter = mcp_tool_filter ,
181+ tool_filter = filters ,
184182 )
185183 )
186184 self .ws_agent_mgr [client_id ] = agent
You can’t perform that action at this time.
0 commit comments