From 0c651fd082b2baaffe5f094592f227240c7d5cb3 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 17 Jun 2026 09:49:15 +0800 Subject: [PATCH] refactor(agents): drop mcp fetch type re-export --- src/agents/mcp-http-fetch.test.ts | 2 +- src/agents/mcp-http-fetch.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/agents/mcp-http-fetch.test.ts b/src/agents/mcp-http-fetch.test.ts index 910989440d0e..d2a957ea406c 100644 --- a/src/agents/mcp-http-fetch.test.ts +++ b/src/agents/mcp-http-fetch.test.ts @@ -1,4 +1,5 @@ import { parseErrorResponse } from "@modelcontextprotocol/sdk/client/auth.js"; +import type { FetchLike } from "@modelcontextprotocol/sdk/shared/transport.js"; /** * Regression coverage for MCP HTTP fetch wrappers. * Verifies SSRF-guarded fetch, scoped dispatcher behavior, and same-origin headers. @@ -9,7 +10,6 @@ import { buildMcpHttpFetch, withoutMcpAuthorizationHeader, withSameOriginMcpHttpHeaders, - type FetchLike, } from "./mcp-http-fetch.js"; const testGlobal = globalThis as Record; diff --git a/src/agents/mcp-http-fetch.ts b/src/agents/mcp-http-fetch.ts index 411e489842c1..f9909bdefb76 100644 --- a/src/agents/mcp-http-fetch.ts +++ b/src/agents/mcp-http-fetch.ts @@ -12,9 +12,6 @@ import { } from "../infra/net/ssrf.js"; import { loadUndiciRuntimeDeps } from "../infra/net/undici-runtime.js"; -/** MCP SDK-compatible fetch function type. */ -export type { FetchLike }; - /** Default MCP HTTP fetch backed by lazy-loaded undici runtime deps. */ const fetchWithUndici: FetchLike = async (url, init) => (await loadUndiciRuntimeDeps().fetch(