MCPcopy Create free account
hub / github.com/TanStack/ai / tryConnect

Function tryConnect

examples/ts-react-chat/src/routes/api.mcp-apps-call.ts:24–33  ·  view source on GitHub ↗
(
  url: string,
  prefix: string,
)

Source from the content-addressed store, hash-verified

22} from '@/lib/mcp-apps'
23
24async function tryConnect(
25 url: string,
26 prefix: string,
27): Promise<MCPClient | null> {
28 try {
29 return await createMCPClient({ transport: { type: 'http', url }, prefix })
30 } catch {
31 return null
32 }
33}
34
35export const Route = createFileRoute('/api/mcp-apps-call')({
36 server: {

Callers 1

Calls 1

createMCPClientFunction · 0.90

Tested by

no test coverage detected