* Pure factory — no SDK loading beyond the injected {@link IClaudeAgentSdkService}.
*/
host: IAgentServerToolHost,
sessionUri: string,
sdk: IClaudeAgentSdkService,
): Promise<McpSdkServerConfigWithInstance> {
const tools = await Promise.all(host.definitions.map(def => sdk.tool(
def.name,
def.description ?? '',
jsonSchemaToZodRawShape(def.inputSchema),
async args => {
try {
const text = await host.executeTool(sessionUri, def.name, args);