Skip to content

Commit 64417fc

Browse files
committed
forward script_content from server config to scan object
hook attaches base64 script body to server_config before dispatch; scan_one forwards it to the reported object so the backend can store it and derive the script:<hash> fingerprint.
1 parent c9c8198 commit 64417fc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/coding_discovery_tools/scan_single_mcp_server.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ def _normalize_url(url):
2828
def 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+
return obj
3238

3339

3440
def _curl_config_quote(value):

0 commit comments

Comments
 (0)