const TOOLS = [ { value: 'list_files', label: 'List Files', description: 'Lists files and directories in a given path.', params: [{ name: 'path', type: 'text', label: 'Directory Path' }] }, { value: 'read_file', label: 'Read File', description: 'Reads the content of a specific file.', params: [{ name: 'path', type: 'text', label: 'File Path' }] }, { value: 'create_file', label: 'Create File', description: 'Creates a new file with optional content.', params: [{ name: 'path', type: 'text', label: 'New File Path' }, { name: 'content', type: 'textarea', label: 'Initial Content (optional)' }] }, { value: 'write_file', label: 'Write to File', description: 'Writes content to a file, creating a backup first.', params: [{ name: 'path', type: 'text', label: 'File Path' }, { name: 'content', type: 'textarea', label: 'New Content' }] }, { value: 'delete_file', label: 'Delete File', description: 'Deletes a specific file.', params: [{ name: 'path', type: 'text', label: 'File to Delete' }] }, { value: 'identify_log_errors', label: 'Identify Log Errors', description: 'Scans a log file for common error messages.', params: [{ name: 'log_file_path', type: 'text', label: 'Log File Path' }] }, ]; function App() { const [selectedTool, setSelectedTool] = React.useState(TOOLS[0].value); const [parameters, setParameters] = React.useState({ path: 'C:\\temp' }); const [isLoading, setIsLoading] = React.useState(false); const [response, setResponse] = React.useState(null); const [error, setError] = React.useState(''); const currentTool = React.useMemo(() => TOOLS.find(t => t.value === selectedTool), [selectedTool]); const handleToolChange = (e) => { const newToolName = e.target.value; setSelectedTool(newToolName); setParameters({}); setResponse(null); setError(''); }; const handleParamChange = (name, value) => { setParameters(prev => ({ ...prev, [name]: value })); }; const handleSubmit = async (e) => { e.preventDefault(); setIsLoading(true); setResponse(null); setError(''); const invocation_id = `mcp-ui-${Date.now()}`; const endpoint = `http://127.0.0.1:8000/mcp/invoke/${selectedTool}`; try { const res = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tool_name: selectedTool, invocation_id, parameters, }), }); const data = await res.json(); if (!res.ok || data.result?.status === 'error') { throw new Error(data.result?.message || `Server responded with status: ${res.status}`); } setResponse(data); } catch (err) { setError(err instanceof Error ? err.message : 'An unknown error occurred.'); } finally { setIsLoading(false); } }; return (

MCP Toolkit Control Panel

A client to interact with the Maintenance & Control Program toolkit server.

Select a Tool

{currentTool.description}

{currentTool.params.map(param => (
{param.type === 'textarea' ? (