@@ -28,7 +28,15 @@ def _normalize_url(url):
2828def scan_one (server_name , server_config ):
2929 """Scan a single server; returns the per-server object {name, command, url, args, scan}."""
3030 servers = transform_mcp_servers_to_array ({server_name : server_config })
31- return servers [0 ] if servers else None
31+ obj = servers [0 ] if servers else None
32+ # Forward the base64 script body the hook attached for local-script servers
33+ # (it resolved the path with cwd; we run detached without it). The backend
34+ # recomputes sha256 -> `script:<hash>` fingerprint and stores the body.
35+ if obj is not None and isinstance (server_config , dict ) and server_config .get ('script_content' ):
36+ obj ['script_content' ] = server_config ['script_content' ]
37+ print (f"info: forwarding script_content ({ len (server_config ['script_content' ])} b64 chars) for { server_name } " ,
38+ file = sys .stderr )
39+ return obj
3240
3341
3442def _curl_config_quote (value ):
@@ -103,12 +111,6 @@ def main():
103111 print (f"error: scan produced no result [{ ctx } ]" , file = sys .stderr )
104112 return 1
105113
106- scan = server_obj .get ("scan" ) or {}
107- if not (scan .get ("tools" ) or []):
108- reason = (scan .get ("error" ) or {}).get ("code" ) or "no tools"
109- print (f"skip: not reporting ({ reason } , tools=0) [{ ctx } ]" , file = sys .stderr )
110- return 0
111-
112114 try :
113115 result = report (args .domain , args .api_key , server_obj )
114116 except Exception as e :
0 commit comments