File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed 
tests/system/test_apps/mcp_enabled_app/bin Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 55from  fastmcp .client  import  Client 
66from  mcp .types  import  Tool  as  MCPTool 
77
8+ from  splunklib .mcp .mcp  import  send_mcp_registrations 
89from  splunklib .mcp .tools .models  import  (
910    McpInputOutputSchema ,
1011    SplunkMeta ,
@@ -83,3 +84,15 @@ async def get_mcp_tools(server_path: str) -> list[MCPTool]:
8384        tools  =  await  mcp_client .list_tools ()
8485
8586    return  tools 
87+ 
88+ 
89+ async  def  register_tools_to_mcp_server (
90+     server_file_path : str , endpoint_url : str 
91+ ) ->  None :
92+     tool_registrations  =  await  get_mcp_tools (server_file_path )
93+ 
94+     await  send_mcp_registrations (
95+         endpoint_url ,
96+         tool_registrations ,
97+         server_file_path ,
98+     )
Original file line number Diff line number Diff line change 11import  asyncio 
22import  os 
33
4- from  splunklib .mcp .mcp  import  send_mcp_registrations 
5- from  splunklib .mcp .tools  import  registrations 
4+ from  splunklib .mcp .tools .registrations  import  register_tools_to_mcp_server 
65
76
87async  def  post_install (server_file_path : str , endpoint_url : str ) ->  None :
9-     tool_registrations  =  await  registrations .get_mcp_tools (server_file_path )
10- 
11-     await  send_mcp_registrations (
12-         endpoint_url ,
13-         tool_registrations ,
14-         server_file_path ,
15-     )
8+     await  register_tools_to_mcp_server (server_file_path , endpoint_url )
169
1710
1811if  __name__  ==  "__main__" :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments