Skip to content

Not able to scan http or sse MCP Servers #148

@CyberUltron-Nikhil

Description

@CyberUltron-Nikhil

Hi ,
would really appreciate some help in figuring out how to scan HTTP or SSE MCP Servers , because when i used the example config :

{
    "mcp": {
        "servers": {
            "http_server": {
                "type": "http",
                "url": "http://localhost:8124/mcp"
            },
            "sse_server": {
                "type": "sse",
                "url": "http://localhost:8123/sse"
            }
        }
    }
}

I got the below output :

{
  "C:\\Users\\HP\\AppData\\Local\\Temp\\tmp9kb8pzjc.json": {
    "client": "C:\\Users\\HP\\AppData\\Local\\Temp\\tmp9kb8pzjc.json",
    "path": "C:\\Users\\HP\\AppData\\Local\\Temp\\tmp9kb8pzjc.json",
    "servers": [
      {
        "name": "http_server",
        "server": {
          "url": "http://localhost:8124/mcp",
          "type": "http",
          "headers": {}
        },
        "signature": null,
        "error": {
          "message": "could not start server",
          "exception": "Could not connect to remote server (4 sub-exceptions)",
          "traceback": "  + Exception Group Traceback (most recent call last):\n  |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\MCPScanner.py\", line 224, in scan_server\n  |     result.signature = await check_server(server.server, self.server_timeout, traffic_capture)\n  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 250, in check_server\n  |     raise ExceptionGroup(\"Could not connect to remote server\", exceptions)  # noqa: F821\n  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  | ExceptionGroup: Could not connect to remote server (4 sub-exceptions)\n  +-+---------------- 1 ----------------\n    | Exception Group Traceback (most recent call last):\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 236, in check_server\n    |     result = await asyncio.wait_for(_check_server_pass(server_config, timeout, traffic_capture), timeout)\n    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Roaming\\uv\\python\\cpython-3.13.5-windows-x86_64-none\\Lib\\asyncio\\tasks.py\", line 507, in wait_for\n    |     return await fut\n    |            ^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 193, in _check_server_pass\n    |     return await _check_server()\n    |            ^^^^^^^^^^^^^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 141, in _check_server\n    |     async with get_client(server_config, timeout=timeout, traffic_capture=traffic_capture) as (read, write):\n    |                ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Roaming\\uv\\python\\cpython-3.13.5-windows-x86_64-none\\Lib\\contextlib.py\", line 235, in __aexit__\n    |     await self.gen.athrow(value)\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 109, in get_client\n    |     async with capturing_client(client_cm, traffic_capture) as streams:\n    |                ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Roaming\\uv\\python\\cpython-3.13.5-windows-x86_64-none\\Lib\\contextlib.py\", line 235, in __aexit__\n    |     await self.gen.athrow(value)\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\traffic_capture.py\", line 186, in capturing_client\n    |     async with client_cm as (read, write):\n    |                ^^^^^^^^^\n    |   File \"C:\\Users\\HP\\AppData\\Roaming\\uv\\python\\cpython-3.13.5-windows-x86_64-none\\Lib\\contextlib.py\", line 235, in __aexit__\n    |     await self.gen.athrow(value)\n    |   File \"C:\\Users\\HP\\AppData\\Local\\uv\\cache\\archive-v0\\N8dYiwBDMBtaRfg23eX2D\\Lib\\site-packages\\mcp_scan\\mcp_client.py\", line 39, in streamablehttp_client_without_session\n    |     async with streamablehttp_client(*args, **kwargs) as (read, write, _):\n    .................. 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions