Skip to content

Commit b5d2982

Browse files
committed
chore: validate transport types in mcp_servers configuration
1 parent aee2f43 commit b5d2982

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/application/serializers/application.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,10 @@ def get_mcp_servers(self, instance, with_valid=True):
631631
if with_valid:
632632
self.is_valid(raise_exception=True)
633633
McpServersSerializer(data=instance).is_valid(raise_exception=True)
634-
if '"stdio"' in instance.get('mcp_servers'):
635-
raise AppApiException(500, _('stdio is not supported'))
636634
servers = json.loads(instance.get('mcp_servers'))
635+
for server, config in servers.items():
636+
if config.get('transport') not in ['sse', 'streamable_http']:
637+
raise AppApiException(500, _('Only support transport=sse or transport=streamable_http'))
637638
tools = []
638639
for server in servers:
639640
tools += [

0 commit comments

Comments
 (0)