update:1.更新mcp插件功能,目前只支持remote调用

This commit is contained in:
xiamuceer
2025-11-07 22:14:20 +08:00
parent 1e998920e3
commit 88115a45c5
26 changed files with 4088 additions and 138 deletions
+81
View File
@@ -522,4 +522,85 @@ export interface TriggerAnalysisResponse {
chapter_id: string;
status: string;
message: string;
}
// MCP 插件类型定义 - 优化后只包含必要字段
export interface MCPPlugin {
id: string;
plugin_name: string;
display_name: string;
description?: string;
plugin_type: 'http' | 'stdio';
category: string;
// HTTP类型字段
server_url?: string;
headers?: Record<string, string>;
// Stdio类型字段
command?: string;
args?: string[];
env?: Record<string, string>;
// 状态字段
enabled: boolean;
status: 'active' | 'inactive' | 'error';
last_error?: string;
last_test_at?: string;
// 时间戳
created_at: string;
}
export interface MCPPluginCreate {
plugin_name: string;
display_name?: string;
description?: string;
server_type: 'http' | 'stdio';
server_url?: string;
command?: string;
args?: string[];
env?: Record<string, string>;
headers?: Record<string, string>;
enabled?: boolean;
}
export interface MCPPluginUpdate {
display_name?: string;
description?: string;
server_url?: string;
command?: string;
args?: string[];
env?: Record<string, string>;
headers?: Record<string, string>;
enabled?: boolean;
}
export interface MCPTool {
name: string;
description?: string;
inputSchema?: Record<string, unknown>;
}
export interface MCPTestResult {
success: boolean;
message: string;
tools?: MCPTool[];
tools_count?: number;
response_time_ms?: number;
error?: string;
error_type?: string;
suggestions?: string[];
}
export interface MCPToolCallRequest {
plugin_id: string;
tool_name: string;
arguments: Record<string, unknown>;
}
export interface MCPToolCallResponse {
success: boolean;
result?: unknown;
error?: string;
}