define executors with mcp configuration (#310)

This commit is contained in:
Gabriel Gordon-Hall
2025-07-23 14:10:38 +01:00
committed by GitHub
parent 8bbf327dd5
commit 96f27ff8bc
4 changed files with 33 additions and 4 deletions

View File

@@ -47,6 +47,15 @@ export const EDITOR_LABELS: Record<string, string> = {
"custom": "Custom" "custom": "Custom"
}; };
export const MCP_SUPPORTED_EXECUTORS: string[] = [
"claude",
"amp",
"gemini",
"sst-opencode",
"charm-opencode",
"claude-code-router"
];
export const SOUND_FILES: SoundFile[] = [ export const SOUND_FILES: SoundFile[] = [
"abstract-sound1", "abstract-sound1",
"abstract-sound2", "abstract-sound2",

View File

@@ -499,7 +499,7 @@ impl ExecutorConfig {
ExecutorConfig::CharmOpencode => Some(vec!["mcpServers"]), ExecutorConfig::CharmOpencode => Some(vec!["mcpServers"]),
ExecutorConfig::SstOpencode => Some(vec!["mcp"]), ExecutorConfig::SstOpencode => Some(vec!["mcp"]),
ExecutorConfig::Claude => Some(vec!["mcpServers"]), ExecutorConfig::Claude => Some(vec!["mcpServers"]),
ExecutorConfig::ClaudePlan => Some(vec!["mcpServers"]), ExecutorConfig::ClaudePlan => None, // Claude Plan shares Claude config
ExecutorConfig::Amp => Some(vec!["amp", "mcpServers"]), // Nested path for Amp ExecutorConfig::Amp => Some(vec!["amp", "mcpServers"]), // Nested path for Amp
ExecutorConfig::Gemini => Some(vec!["mcpServers"]), ExecutorConfig::Gemini => Some(vec!["mcpServers"]),
ExecutorConfig::ClaudeCodeRouter => Some(vec!["mcpServers"]), ExecutorConfig::ClaudeCodeRouter => Some(vec!["mcpServers"]),

View File

@@ -18,7 +18,11 @@ import { Label } from '@/components/ui/label';
import { Alert, AlertDescription } from '@/components/ui/alert'; import { Alert, AlertDescription } from '@/components/ui/alert';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea';
import { Loader2 } from 'lucide-react'; import { Loader2 } from 'lucide-react';
import { EXECUTOR_TYPES, EXECUTOR_LABELS } from 'shared/types'; import {
EXECUTOR_TYPES,
EXECUTOR_LABELS,
MCP_SUPPORTED_EXECUTORS,
} from 'shared/types';
import { useConfig } from '@/components/config-provider'; import { useConfig } from '@/components/config-provider';
import { mcpServersApi } from '../lib/api'; import { mcpServersApi } from '../lib/api';
@@ -35,7 +39,12 @@ export function McpServers() {
// Initialize selected MCP executor when config loads // Initialize selected MCP executor when config loads
useEffect(() => { useEffect(() => {
if (config?.executor?.type && !selectedMcpExecutor) { if (config?.executor?.type && !selectedMcpExecutor) {
// If current executor supports MCP, use it; otherwise use first available MCP executor
if (MCP_SUPPORTED_EXECUTORS.includes(config.executor.type)) {
setSelectedMcpExecutor(config.executor.type); setSelectedMcpExecutor(config.executor.type);
} else {
setSelectedMcpExecutor(MCP_SUPPORTED_EXECUTORS[0] || 'claude');
}
} }
}, [config?.executor?.type, selectedMcpExecutor]); }, [config?.executor?.type, selectedMcpExecutor]);
@@ -314,7 +323,9 @@ export function McpServers() {
<SelectValue placeholder="Select executor" /> <SelectValue placeholder="Select executor" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
{EXECUTOR_TYPES.map((type) => ( {EXECUTOR_TYPES.filter((type) =>
MCP_SUPPORTED_EXECUTORS.includes(type)
).map((type) => (
<SelectItem key={type} value={type}> <SelectItem key={type} value={type}>
{EXECUTOR_LABELS[type]} {EXECUTOR_LABELS[type]}
</SelectItem> </SelectItem>

View File

@@ -169,6 +169,15 @@ export const EDITOR_LABELS: Record<string, string> = {
"custom": "Custom" "custom": "Custom"
}; };
export const MCP_SUPPORTED_EXECUTORS: string[] = [
"claude",
"amp",
"gemini",
"sst-opencode",
"charm-opencode",
"claude-code-router"
];
export const SOUND_FILES: SoundFile[] = [ export const SOUND_FILES: SoundFile[] = [
"abstract-sound1", "abstract-sound1",
"abstract-sound2", "abstract-sound2",