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

Function fakeClient

packages/ai-mcp/tests/apps/call-handler.test.ts:63–77  ·  view source on GitHub ↗
(info: ServerInfo)

Source from the content-addressed store, hash-verified

61// Fake single client. The handler only reads `getInfo`; the rest are real
62// members that throw if reached.
63function fakeClient(info: ServerInfo): MCPClient {
64 return {
65 capabilities: {},
66 tools: unreached('tools'),
67 resources: unreached('resources'),
68 readResource: unreached('readResource'),
69 resourceTemplates: unreached('resourceTemplates'),
70 prompts: unreached('prompts'),
71 getPrompt: unreached('getPrompt'),
72 callTool: unreached('callTool'),
73 getInfo: () => info,
74 close: unreached('close'),
75 [Symbol.asyncDispose]: unreached('asyncDispose'),
76 }
77}
78
79const WEATHER_HTTP: ServerInfo = {
80 transport: { type: 'http', url: 'https://x/mcp' },

Callers 1

Calls 1

unreachedFunction · 0.85

Tested by

no test coverage detected