Skip to content

Fix: Improve error handling and Docker timeout processing #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

syossan27
Copy link

Summary

This PR addresses several issues related to error handling and timeout processing in the MCP scanning process:

  1. Better error handling for unsupported methods: Properly handle "Method not found" and similar errors when scanning MCP servers that don't support certain capabilities.
  2. Empty data handling: Add validation to prevent failures when encountering empty data sets during scanning.
  3. Docker timeout improvements: Implement special timeout handling for Docker commands to ensure scans can continue even when Docker processes don't respond correctly.

Problem

Previously, the scanner could get stuck or fail in several scenarios:

  • When encountering servers that don't support certain MCP methods
  • When working with empty data sets during verification
  • When Docker commands didn't respond within the timeout period

Solution

  1. Added better error handling in mcp_client.py to gracefully handle "Method not found" errors
  2. Modified verify_api.py to handle empty payloads and tools lists
  3. Implemented specialized timeout handling for Docker commands in MCPScanner.py with proper task cancellation

Test plan

  • Test with servers that don't support all MCP methods
  • Test with configurations that would previously lead to empty data sets
  • Test with Docker-based MCP servers that may hang or time out

This PR fixes the issue where scanning results wouldn't display due to these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant