fix: stio mcp

This commit is contained in:
Alex
2026-02-02 15:46:19 +00:00
parent 4245e5bd2e
commit 8e3e4a8b09
2 changed files with 30 additions and 5 deletions

View File

@@ -43,6 +43,16 @@ class TestMCPServerConfig(Resource):
return missing_fields
try:
config = data["config"]
transport_type = (config.get("transport_type") or "auto").lower()
allowed_transports = {"auto", "sse", "http"}
if transport_type not in allowed_transports:
return make_response(
jsonify({"success": False, "error": "Unsupported transport_type"}),
400,
)
config.pop("command", None)
config.pop("args", None)
config["transport_type"] = transport_type
auth_credentials = {}
auth_type = config.get("auth_type", "none")
@@ -115,6 +125,16 @@ class MCPServerSave(Resource):
return missing_fields
try:
config = data["config"]
transport_type = (config.get("transport_type") or "auto").lower()
allowed_transports = {"auto", "sse", "http"}
if transport_type not in allowed_transports:
return make_response(
jsonify({"success": False, "error": "Unsupported transport_type"}),
400,
)
config.pop("command", None)
config.pop("args", None)
config["transport_type"] = transport_type
auth_credentials = {}
auth_type = config.get("auth_type", "none")