diff options
| author | Clawd <ai@clawd.bot> | 2026-03-01 08:45:09 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-03-01 08:45:09 -0800 |
| commit | 12099b4f8cd10002810438bd309e208169960107 (patch) | |
| tree | b00e2043b6f66c1569c43c9ae9cad346f8dbdd42 /renderer/src/components/SettingsPage.tsx | |
| parent | d44d0f61e4026da35c0d1a4acb87ba71ed6cd599 (diff) | |
feat(settings): add MCP server configuration
- Add McpSettings component with add/edit/delete server UI
- Support stdio (command + args + env) and sse/http (url + headers) transports
- Array builder for args, key-value builder for env vars and headers
- Pass mcpServers config to SDK query() calls
- Store config as JSON in settings table
Diffstat (limited to 'renderer/src/components/SettingsPage.tsx')
| -rw-r--r-- | renderer/src/components/SettingsPage.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/renderer/src/components/SettingsPage.tsx b/renderer/src/components/SettingsPage.tsx index d3ff4bf..7d06547 100644 --- a/renderer/src/components/SettingsPage.tsx +++ b/renderer/src/components/SettingsPage.tsx | |||
| @@ -2,8 +2,9 @@ import React, { useState } from "react"; | |||
| 2 | import { SystemPromptsSettings } from "./settings/SystemPromptsSettings"; | 2 | import { SystemPromptsSettings } from "./settings/SystemPromptsSettings"; |
| 3 | import { GitSettings } from "./settings/GitSettings"; | 3 | import { GitSettings } from "./settings/GitSettings"; |
| 4 | import { ModelSettings } from "./settings/ModelSettings"; | 4 | import { ModelSettings } from "./settings/ModelSettings"; |
| 5 | import { McpSettings } from "./settings/McpSettings"; | ||
| 5 | 6 | ||
| 6 | type SettingsSection = "model" | "system-prompts" | "git"; | 7 | type SettingsSection = "model" | "mcp" | "system-prompts" | "git"; |
| 7 | 8 | ||
| 8 | interface SettingsPageProps { | 9 | interface SettingsPageProps { |
| 9 | onClose: () => void; | 10 | onClose: () => void; |
| @@ -42,6 +43,14 @@ export function SettingsPage({ onClose }: SettingsPageProps) { | |||
| 42 | </button> | 43 | </button> |
| 43 | <button | 44 | <button |
| 44 | className={`settings-nav-item${ | 45 | className={`settings-nav-item${ |
| 46 | activeSection === "mcp" ? " active" : "" | ||
| 47 | }`} | ||
| 48 | onClick={() => setActiveSection("mcp")} | ||
| 49 | > | ||
| 50 | MCP Servers | ||
| 51 | </button> | ||
| 52 | <button | ||
| 53 | className={`settings-nav-item${ | ||
| 45 | activeSection === "system-prompts" ? " active" : "" | 54 | activeSection === "system-prompts" ? " active" : "" |
| 46 | }`} | 55 | }`} |
| 47 | onClick={() => setActiveSection("system-prompts")} | 56 | onClick={() => setActiveSection("system-prompts")} |
| @@ -61,6 +70,7 @@ export function SettingsPage({ onClose }: SettingsPageProps) { | |||
| 61 | {/* Content */} | 70 | {/* Content */} |
| 62 | <div className="settings-content"> | 71 | <div className="settings-content"> |
| 63 | {activeSection === "model" && <ModelSettings />} | 72 | {activeSection === "model" && <ModelSettings />} |
| 73 | {activeSection === "mcp" && <McpSettings />} | ||
| 64 | {activeSection === "system-prompts" && <SystemPromptsSettings />} | 74 | {activeSection === "system-prompts" && <SystemPromptsSettings />} |
| 65 | {activeSection === "git" && <GitSettings />} | 75 | {activeSection === "git" && <GitSettings />} |
| 66 | </div> | 76 | </div> |
