()
| 11 | } |
| 12 | |
| 13 | const MCPServerStatus = () => { |
| 14 | const [status, setStatus] = useState<ServerStatus>({ status: 'stopped' }); |
| 15 | const [logs, setLogs] = useState<string[]>([]); |
| 16 | |
| 17 | // Use the exact configuration specified by the user |
| 18 | const exactConfig = { |
| 19 | "mcpServers": { |
| 20 | "fast-markdown": { |
| 21 | "command": "docker", |
| 22 | "args": [ |
| 23 | "exec", |
| 24 | "-i", |
| 25 | "devdocs-mcp", |
| 26 | "python", |
| 27 | "-m", |
| 28 | "fast_markdown_mcp.server", |
| 29 | "/app/storage/markdown" |
| 30 | ], |
| 31 | "env": {}, |
| 32 | "disabled": false, |
| 33 | "alwaysAllow": [ |
| 34 | "sync_file", |
| 35 | "get_status", |
| 36 | "list_files", |
| 37 | "read_file", |
| 38 | "search_files", |
| 39 | "search_by_tag", |
| 40 | "get_stats", |
| 41 | "get_section", |
| 42 | "get_table_of_contents" |
| 43 | ] |
| 44 | } |
| 45 | } |
| 46 | }; |
| 47 | |
| 48 | useEffect(() => { |
| 49 | |
| 50 | const checkStatus = async () => { |
| 51 | try { |
| 52 | const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || process.env.BACKEND_URL || 'http://localhost:24125'; |
| 53 | const response = await fetch(`${backendUrl}/api/mcp/status`); |
| 54 | const data = await response.json(); |
| 55 | setStatus({ |
| 56 | status: data.status, |
| 57 | pid: data.pid, |
| 58 | details: data.details |
| 59 | }); |
| 60 | } catch (error) { |
| 61 | setStatus({ |
| 62 | status: 'error', |
| 63 | details: error instanceof Error ? error.message : 'Failed to check status' |
| 64 | }); |
| 65 | } |
| 66 | }; |
| 67 | |
| 68 | const getLogs = async () => { |
| 69 | try { |
| 70 | const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || process.env.BACKEND_URL || 'http://localhost:24125'; |
nothing calls this directly
no test coverage detected