Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/mcp_scan/mcp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,16 @@ def parse_and_validate(config: dict) -> MCPConfig:
with open(path) as f:
content = f.read()
logger.debug("Config file read successfully")

# if content is empty, return an empty MCPConfig
if content is None or content.strip() == "" or not content:
logger.warning("Config file is empty")
return parse_and_validate({})

# use json5 to support comments as in vscode
config = pyjson5.loads(content)
logger.debug("Config JSON parsed successfully")

# try to parse model
result = parse_and_validate(config)
logger.info("Config file parsed and validated successfully")
Expand Down