MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / withTracedClient

Function withTracedClient

packages/hosts/mcp/src/tool-server.test.ts:145–152  ·  view source on GitHub ↗
(
  engine: ExecutionEngine<E>,
  fn: (client: Client, spans: RecordedSpan[]) => Promise<void>,
  config?: TestServerConfig<E>,
)

Source from the content-addressed store, hash-verified

143
144/** withClient, but with a recording tracer installed for the whole server. */
145const withTracedClient = async <E extends Cause.YieldableError>(
146 engine: ExecutionEngine<E>,
147 fn: (client: Client, spans: RecordedSpan[]) => Promise<void>,
148 config?: TestServerConfig<E>,
149) => {
150 const { tracer, spans } = makeRecordingTracer();
151 await withClient(engine, NO_CAPS, (client) => fn(client, spans), { ...config, tracer });
152};
153
154const ELICITATION_CAPS: ClientCapabilities = {
155 elicitation: { form: {}, url: {} },

Callers 1

Calls 2

makeRecordingTracerFunction · 0.70
withClientFunction · 0.70

Tested by

no test coverage detected