feat: Enhance MCP service configuration with stdio transport support
- Added support for stdio transport type in MCP service configuration, allowing command execution via standard input/output. - Updated MCPService interface to include optional stdio_config and env_vars fields for managing command arguments and environment variables. - Enhanced frontend components to handle stdio transport, including dynamic form fields for command and arguments. - Implemented validation logic for stdio configuration in the service update process, ensuring proper handling of required fields. - Updated backend logic to manage stdio transport connections and ensure proper client lifecycle management.
This commit is contained in:
@@ -36,11 +36,11 @@
|
||||
<div class="service-name">
|
||||
{{ service.name }}
|
||||
<t-tag
|
||||
:theme="service.transport_type === 'sse' ? 'success' : 'primary'"
|
||||
:theme="getTransportTypeTheme(service.transport_type)"
|
||||
size="small"
|
||||
variant="light"
|
||||
>
|
||||
{{ service.transport_type === 'sse' ? 'SSE' : 'HTTP Streamable' }}
|
||||
{{ getTransportTypeLabel(service.transport_type) }}
|
||||
</t-tag>
|
||||
</div>
|
||||
<div class="service-controls">
|
||||
@@ -274,6 +274,34 @@ const handleMenuAction = (data: { value: string }, service: MCPService) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Get transport type theme for tag
|
||||
const getTransportTypeTheme = (transportType: string) => {
|
||||
switch (transportType) {
|
||||
case 'sse':
|
||||
return 'success'
|
||||
case 'http-streamable':
|
||||
return 'primary'
|
||||
case 'stdio':
|
||||
return 'warning'
|
||||
default:
|
||||
return 'default'
|
||||
}
|
||||
}
|
||||
|
||||
// Get transport type label
|
||||
const getTransportTypeLabel = (transportType: string) => {
|
||||
switch (transportType) {
|
||||
case 'sse':
|
||||
return 'SSE'
|
||||
case 'http-streamable':
|
||||
return 'HTTP Streamable'
|
||||
case 'stdio':
|
||||
return 'Stdio'
|
||||
default:
|
||||
return transportType
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadServices()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user