fix: skip Anthropic MCP registry fetch for third-party providers (#310)

This commit is contained in:
KRATOS
2026-04-04 14:50:48 +05:30
committed by GitHub
parent 3c2e80a1ae
commit b4725c19e0
2 changed files with 67 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import axios from 'axios'
import { logForDebugging } from '../../utils/debug.js'
import { errorMessage } from '../../utils/errors.js'
import { getAPIProvider } from '../../utils/model/providers.js'
type RegistryServer = {
server: {
@@ -35,6 +36,11 @@ export async function prefetchOfficialMcpUrls(): Promise<void> {
return
}
// Anthropic's official MCP registry is only relevant for first-party mode.
if (getAPIProvider() !== 'firstParty') {
return
}
try {
const response = await axios.get<RegistryResponse>(
'https://api.anthropic.com/mcp-registry/v0/servers?version=latest&visibility=commercial',