Browse MLX and Ollama catalogs in a unified model library

This commit is contained in:
Mark Gregory
2026-11-17 09:20:58 +00:00
parent 0f1ce5f512
commit 1d5edbc292
6 changed files with 181 additions and 35 deletions
+25 -25
View File
@@ -250,7 +250,7 @@ struct MCPSettings: View {
}
}
Section("Custom MCP Servers") {
VStack(alignment: .leading, spacing: 6) {
Menu("Manage Servers", systemImage: "ellipsis.circle") {
Button("Import mcp.json…") { importingConfig = true }
Button("Use LM Studio Config") {
loadConfig(FileManager.default.homeDirectoryForCurrentUser.appending(path: ".lmstudio/mcp.json"))
@@ -261,27 +261,25 @@ struct MCPSettings: View {
}
}.buttonStyle(.bordered)
ForEach(profiles.keys.sorted(), id: \.self) { name in
if let profile = profiles[name] {
let id = MCPConnectionID.profile(name)
let state = studio.mcpConnections[id]
VStack(alignment: .leading, spacing: 5) {
Toggle(name, isOn: Binding(
get: { studio.enabledMCPProfiles(path: configPath).contains(name) },
set: { enabled in
if enabled { selected = id }
studio.setMCPProfile(name, enabled: enabled, path: configPath)
}
))
if let state {
Text(state.progress ?? state.output)
.font(.caption)
.foregroundStyle(state.failed ? Color.red : Color.secondary)
.textSelection(.enabled)
if state.failed {
Button("Retry") { studio.restoreToolsets() }
} else if state.toolset != nil {
Button("Tools") { selected = id }
}
let id = MCPConnectionID.profile(name)
let state = studio.mcpConnections[id]
VStack(alignment: .leading, spacing: 5) {
Toggle(name, isOn: Binding(
get: { studio.enabledMCPProfiles(path: configPath).contains(name) },
set: { enabled in
if enabled { selected = id }
studio.setMCPProfile(name, enabled: enabled, path: configPath)
}
))
if let state {
Text(state.progress ?? state.output)
.font(.caption)
.foregroundStyle(state.failed ? Color.red : Color.secondary)
.textSelection(.enabled)
if state.failed {
Button("Retry") { studio.restoreToolsets() }
} else if state.toolset != nil {
Button("Tools") { selected = id }
}
}
}
@@ -331,12 +329,14 @@ struct MCPSettings: View {
.font(.system(.caption, design: .monospaced)).textSelection(.enabled)
}
}
TextEditor(text: $arguments).font(.system(.body, design: .monospaced))
.frame(height: 85).accessibilityLabel("JSON arguments")
DisclosureGroup("Arguments") {
TextEditor(text: $arguments).font(.system(.body, design: .monospaced))
.frame(height: 85).accessibilityLabel("JSON arguments")
}
Button("Review Tool Call…") { confirm = true }
.disabled(tool.isEmpty || state.progress != nil)
}
if !state.output.isEmpty {
if !state.output.isEmpty && (state.completedTool != nil || state.failed) {
ScrollView {
Text(state.output).font(.system(.caption, design: .monospaced)).textSelection(.enabled)
.frame(maxWidth: .infinity, alignment: .leading)