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
+7 -2
View File
@@ -6,8 +6,8 @@ export interface MCPService {
name: string
description: string
enabled: boolean
transport_type: 'sse' | 'http-streamable'
url: string
transport_type: 'sse' | 'http-streamable' | 'stdio'
url?: string // Optional: required for SSE/HTTP Streamable
headers?: Record<string, string>
auth_config?: {
api_key?: string
@@ -19,6 +19,11 @@ export interface MCPService {
retry_count?: number
retry_delay?: number
}
stdio_config?: {
command: 'uvx' | 'npx' // Command: uvx or npx
args: string[] // Command arguments array
}
env_vars?: Record<string, string> // Environment variables for stdio transport
created_at?: string
updated_at?: string
}