Spaces:
Sleeping
Sleeping
David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120 | "use client"; | |
| import {useState} from "react"; | |
| import mcp from "../services/mcp/client"; | |
| export default function useMCP(){ | |
| const [loading,setLoading]=useState(false); | |
| async function exec(fn,...args){ | |
| setLoading(true); | |
| try{ | |
| const {data}=await fn(...args); | |
| return data; | |
| }finally{ | |
| setLoading(false); | |
| } | |
| } | |
| return{ | |
| loading, | |
| servers:(...a)=>exec(mcp.servers,...a), | |
| tools:(...a)=>exec(mcp.tools,...a), | |
| resources:(...a)=>exec(mcp.resources,...a), | |
| prompts:(...a)=>exec(mcp.prompts,...a), | |
| connect:(...a)=>exec(mcp.connect,...a), | |
| disconnect:(...a)=>exec(mcp.disconnect,...a), | |
| invoke:(...a)=>exec(mcp.invoke,...a), | |
| status:(...a)=>exec(mcp.status,...a), | |
| logs:(...a)=>exec(mcp.logs,...a) | |
| }; | |
| } | |