feat: add MCP tool and web UI management

This commit is contained in:
lpf
2026-03-07 22:09:52 +08:00
parent cff379809c
commit fb5a228e7d
16 changed files with 1836 additions and 4 deletions

View File

@@ -326,10 +326,28 @@ type SandboxConfig struct {
type FilesystemConfig struct{}
type MCPServerConfig struct {
Enabled bool `json:"enabled"`
Transport string `json:"transport"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Description string `json:"description,omitempty"`
Package string `json:"package,omitempty"`
}
type MCPToolsConfig struct {
Enabled bool `json:"enabled"`
RequestTimeoutSec int `json:"request_timeout_sec"`
Servers map[string]MCPServerConfig `json:"servers,omitempty"`
}
type ToolsConfig struct {
Web WebToolsConfig `json:"web"`
Shell ShellConfig `json:"shell"`
Filesystem FilesystemConfig `json:"filesystem"`
MCP MCPToolsConfig `json:"mcp"`
}
type LoggingConfig struct {
@@ -540,6 +558,11 @@ func DefaultConfig() *Config {
},
},
Filesystem: FilesystemConfig{},
MCP: MCPToolsConfig{
Enabled: false,
RequestTimeoutSec: 20,
Servers: map[string]MCPServerConfig{},
},
},
Logging: LoggingConfig{
Enabled: true,