{"record":{"id":"861d2a36d3b816fb","repo":"tirth8205/code-review-graph","slug":"unsupported-transport-transport-r","errorCode":null,"errorMessage":"unsupported transport: {transport!r}","messagePattern":"unsupported transport: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"code_review_graph/main.py","lineNumber":1256,"sourceCode":"            mcp.run(transport=\"stdio\", show_banner=False)\n        elif transport == \"streamable-http\":\n            if host is None or port is None:\n                raise ValueError(\"streamable-http transport requires host and port\")\n            # Validate Host/Origin on the loopback HTTP endpoint. Without it a web\n            # page the user visits can point a hostname it controls at 127.0.0.1\n            # (DNS rebinding) and drive the tools, which read the user's code.\n            # Non-browser MCP clients send no Origin and are unaffected; see\n            # code_review_graph.http_origin_guard.\n            from .http_origin_guard import build_http_middleware\n\n            mcp.run(\n                transport=\"streamable-http\",\n                host=host,\n                port=port,\n                middleware=build_http_middleware(host, port),\n            )\n        else:\n            raise ValueError(f\"unsupported transport: {transport!r}\")\n    finally:\n        if watch_store is not None:\n            watch_store.close()\n        _incremental._MCP_STDIO_ACTIVE = previous_stdio_state\n\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":1238,"sourceCodeEnd":1265,"githubUrl":"https://github.com/tirth8205/code-review-graph/blob/b58668751ab0c7670c078cf7cbd4d1f5b8e54f81/code_review_graph/main.py#L1238-L1265","documentation":"Raised by main() when the requested MCP transport string is neither 'stdio' nor 'streamable-http'. The f-string echoes the offending value so typos and unsupported transports are immediately visible.","triggerScenarios":"Passing a transport like 'sse', 'websocket', 'HTTP', or any misspelling to the MCP entrypoint — only exact 'stdio' and 'streamable-http' are accepted.","commonSituations":"Users coming from FastMCP docs that list 'sse' as a transport; case mismatches like 'Stdio'; config files with an old/renamed transport name after a version change.","solutions":["Use 'stdio' for local clients or exactly 'streamable-http' for HTTP (note the hyphen, not 'streamable_http' or 'sse').","Check for trailing whitespace/case differences in the transport value.","If you need SSE/WebSockets, front the streamable-http endpoint with your own proxy instead."],"exampleFix":"# before\nmcp --transport sse\n# after\nmcp --transport streamable-http --host 127.0.0.1 --port 8080","handlingStrategy":"validation","validationCode":"VALID_TRANSPORTS = {\"stdio\", \"streamable-http\"}\nif transport not in VALID_TRANSPORTS:\n    raise SystemExit(f\"transport must be one of {sorted(VALID_TRANSPORTS)}, got {transport!r}\")","typeGuard":"def is_supported_transport(value: str) -> bool:\n    return value in {\"stdio\", \"streamable-http\"}","tryCatchPattern":"try:\n    main()\nexcept ValueError as exc:\n    if str(exc).startswith(\"unsupported transport\"):\n        print(exc); sys.exit(2)","preventionTips":["Validate the transport string against a constant set before invoking main.","Normalize casing/whitespace on config-derived values.","Keep config templates using only documented transport names."],"tags":["mcp","transport","invalid-argument"],"backgroundTag":"unsupported-transport-value","analyzedSha":"b58668751ab0c7670c078cf7cbd4d1f5b8e54f81","analyzedAt":"2026-08-28T13:19:08.966Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}