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:
wizardchen
2025-11-12 11:32:59 +08:00
parent 3c02c4a434
commit 05154c8d75
15 changed files with 631 additions and 23 deletions
+30 -2
View File
@@ -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()
})