{
  "name": "@mcpjam/sdk",
  "version": "8.1.0",
  "description": "MCP server unit testing, end to end (e2e) testing, and server evals",
  "type": "module",
  "main": "dist/index.js",
  "module": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js",
      "default": "./dist/index.js"
    },
    "./browser": {
      "types": "./dist/browser.d.ts",
      "import": "./dist/browser.js",
      "default": "./dist/browser.js"
    },
    "./worker": {
      "types": "./dist/worker.d.ts",
      "import": "./dist/worker.js",
      "default": "./dist/worker.js"
    },
    "./operations": {
      "types": "./dist/operations.d.ts",
      "import": "./dist/operations.js",
      "default": "./dist/operations.js"
    },
    "./skill-reference": {
      "types": "./dist/skill-reference.d.ts",
      "import": "./dist/skill-reference.js",
      "default": "./dist/skill-reference.js"
    },
    "./model-factory": {
      "types": "./dist/model-factory.d.ts",
      "import": "./dist/model-factory.js",
      "default": "./dist/model-factory.js"
    },
    "./matchers": {
      "types": "./dist/matchers.d.ts",
      "import": "./dist/matchers.js",
      "default": "./dist/matchers.js"
    },
    "./predicates": {
      "types": "./dist/predicates/index.d.ts",
      "import": "./dist/predicates/index.js",
      "default": "./dist/predicates/index.js"
    },
    "./contract": {
      "types": "./dist/contract/index.d.ts",
      "import": "./dist/contract/index.js",
      "default": "./dist/contract/index.js"
    },
    "./host-config": {
      "types": "./dist/host-config/index.d.ts",
      "import": "./dist/host-config/index.js",
      "default": "./dist/host-config/index.js"
    },
    "./host-config/internal": {
      "types": "./dist/host-config/internal.d.ts",
      "import": "./dist/host-config/internal.js",
      "default": "./dist/host-config/internal.js"
    },
    "./host-config/templates": {
      "types": "./dist/host-config/templates/index.d.ts",
      "import": "./dist/host-config/templates/index.js",
      "default": "./dist/host-config/templates/index.js"
    },
    "./platform": {
      "types": "./dist/platform/index.d.ts",
      "import": "./dist/platform/index.js",
      "default": "./dist/platform/index.js"
    },
    "./public-api": {
      "types": "./dist/public-api/index.d.ts",
      "import": "./dist/public-api/index.js",
      "default": "./dist/public-api/index.js"
    },
    "./widget-runtime": {
      "types": "./dist/widget-runtime/index.d.ts",
      "import": "./dist/widget-runtime/index.js",
      "default": "./dist/widget-runtime/index.js"
    },
    "./host-compat": {
      "types": "./dist/host-compat/index.d.ts",
      "import": "./dist/host-compat/index.js",
      "default": "./dist/host-compat/index.js"
    },
    "./plugin-bundle": {
      "types": "./dist/plugin-bundle/index.d.ts",
      "import": "./dist/plugin-bundle/index.js",
      "default": "./dist/plugin-bundle/index.js"
    },
    "./oauth/node": {
      "types": "./dist/oauth/node.d.ts",
      "import": "./dist/oauth/node.js",
      "default": "./dist/oauth/node.js"
    }
  },
  "files": [
    "dist"
  ],
  "scripts": {
    "build": "npm run bundle:runtimes && tsup",
    "bundle:chatgpt-runtime": "node scripts/bundle-chatgpt-apps-runtime.mjs",
    "bundle:mcp-apps-runtime": "node scripts/bundle-mcp-apps-openai-compatible-runtime.mjs",
    "bundle:runtimes": "npm run bundle:chatgpt-runtime && npm run bundle:mcp-apps-runtime",
    "generate:eval-suite-schema": "tsx scripts/generate-eval-suite-schema.ts",
    "check:eval-suite-schema": "tsx scripts/generate-eval-suite-schema.ts --check",
    "generate:eval-verdict-policy-schema": "tsx scripts/generate-eval-verdict-policy-schema.ts",
    "check:eval-verdict-policy-schema": "tsx scripts/generate-eval-verdict-policy-schema.ts --check",
    "generate:host-catalog-fallback": "tsx scripts/generate-host-catalog-fallback.ts",
    "check:host-catalog-fallback": "tsx scripts/generate-host-catalog-fallback.ts --check",
    "check:host-catalog-fallback:remote": "node --import tsx scripts/check-host-catalog-fallback-remote.ts",
    "dev": "tsup --watch",
    "sentry:sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload --release=@mcpjam/sdk@$(node -p \"require('./package.json').version\") --org=mcpjam-gh --project=mcpjam-sdk ./dist",
    "test": "vitest run",
    "test:watch": "vitest",
    "test:coverage": "vitest run --coverage",
    "test:packaging": "npm run build && node --input-type=module -e \"const root = await import('@mcpjam/sdk'); for (const n of ['driveTaskToTerminal','TaskLifecycleEngine','taskLifecycleKey','isTerminalLifecycleStatus','extensionTaskToObservation','legacyTaskToObservation','isUnknownTaskError','canDeclareTasksExtension','readDeclaredInputCapabilities','TaskInputRejectedError','createStrictElicitationContentValidator','retryAfterMsFromError']) { if (typeof root[n] !== 'function') { throw new Error('missing tasks export: ' + n); } } for (const n of ['loadEvalSuiteFile','resolveEvalSuiteFile','serializeEvalSuiteFile','formatSuiteFileFindings','suiteFilePointer']) { if (typeof root[n] !== 'function') { throw new Error('missing suite-file export: ' + n); } } for (const n of ['TERMINAL_LIFECYCLE_STATUSES','UNKNOWN_TASK_ERROR_CODE','DEFAULT_TASK_INPUT_LIMITS']) { if (root[n] === undefined) { throw new Error('missing tasks export: ' + n); } } for (const n of ['MAX_SUITE_FILE_BYTES','SUITE_FILE_VALIDITY_DEFAULTS','SUITE_FILE_DEFAULT_CAPTURE_LEVEL','SUITE_FILE_FINDING_CODES']) { if (root[n] === undefined) { throw new Error('missing suite-file export: ' + n); } } if (root.MAX_SUITE_FILE_BYTES !== 1048576) { throw new Error('MAX_SUITE_FILE_BYTES is not the pinned 1 MiB cap'); } await import('@mcpjam/sdk/browser'); await import('@mcpjam/sdk/worker'); await import('@mcpjam/sdk/operations'); await import('@mcpjam/sdk/skill-reference'); await import('@mcpjam/sdk/model-factory'); await import('@mcpjam/sdk/matchers'); await import('@mcpjam/sdk/predicates'); const contract = await import('@mcpjam/sdk/contract'); for (const n of ['canonicalJson','canonicalDigest','sha256Hex','resolveScoreDefinition','definitionHash','evaluationConfigHash','buildEvaluationConfigSnapshot','aggregateEvaluationConfigHash','allGatingScorersPassed','scorePassed','finalizeScoreResult','errorScoreResult','skippedScoreResult','notApplicableScoreResult','predicateScoreDefinition','scoreResultFromPredicateResult','toolMatchScoreDefinition','fromToolMatchResult','legacyTestScoreDefinition','fromLegacyTestOutcome','fromGoalCompletionCase','fromCriterionResult','generatedPredicateScorerId','deriveStageResults','stageDerivationToMetadata','mintCaseId','mintSuiteId','isOpaqueId','isPromptStep','isToolCallStep','isInteractStep','isAssertStep','isWidgetAssertion']) { if (typeof contract[n] !== 'function') { throw new Error('missing contract export: ' + n); } } for (const n of ['scoreResultSchema','resolvedScoreDefinitionSchema','evaluationConfigSnapshotSchema','PREDICATES_VERSION','MAX_SCORER_ID_LENGTH','TOOL_MATCH_SCORER_ID','LEGACY_TEST_SCORER_ID','opaqueIdSchema','CASE_ID_PREFIX','SUITE_ID_PREFIX','USER_VALUE_STAGES','STAGE_STATES','FAILURE_CATEGORIES','ITERATION_STATUSES','IMPORT_MAPPING_STATUSES','STAGE_ANALYZER_VERSION','STAGE_REASONS','STAGE_METADATA_KEYS','MAX_EVIDENCE_REASONS','MAX_EVIDENCE_REASON_CHARS','stageDerivationSchema','stageResultRowSchema','stageReasonSchema','TEST_STEP_KINDS','testStepSchema','stepsSchema','elementLocatorSchema','evalSuiteFileSchema','evalSuiteFileStructuralSchema','evalSuiteFileCaseSchema','evalSuiteFileJsonSchema','EVAL_SUITE_SCHEMA_ID','EVAL_SUITE_SCHEMA_VERSION','MAX_SUITE_FILE_CASES']) { if (contract[n] === undefined) { throw new Error('missing contract export: ' + n); } } if (typeof contract.evalSuiteFileJsonSchema !== 'object' || !contract.evalSuiteFileJsonSchema.properties?.cases) { throw new Error('contract export evalSuiteFileJsonSchema is not the generated JSON Schema document'); } await import('@mcpjam/sdk/host-config'); const w = await import('@mcpjam/sdk/widget-runtime'); for (const n of ['getToolVisibility','isVisibleToModelOnly','isVisibleToAppOnly','LoggingTransport','buildOuterAllowAttribute','buildOuterSandboxAttribute','resolveIframeSandboxPolicy','createHostAppBridge','registerHostBridgeHandlers']) { if (typeof w[n] !== 'function') { throw new Error('missing widget-runtime export: ' + n); } } if (w['DEFAULT_IFRAME_SANDBOX'] === undefined) { throw new Error('missing widget-runtime export: DEFAULT_IFRAME_SANDBOX'); } const p = await import('@mcpjam/sdk/platform'); for (const n of ['PlatformApiClient','PlatformApiError','buildShowServersPayload','resolveProject','listProjectsOperation','listProjectServersOperation','showServersOperation','checkHostCompatibilityOperation','createTunnelOperation','closeTunnelOperation']) { if (p[n] === undefined) { throw new Error('missing platform export: ' + n); } } const m = await import('@mcpjam/sdk/host-config/internal'); for (const n of ['canonicalizeHostConfigV2','computeHostConfigHashV2','isAppOnlyTool','filterAppOnlyTools','applyVisibilityPolicyAndCountSignals','extractHostExecutionPolicy','buildHostIterationMetadata','resolveOpenAiCompatForHostConfig','readOpenAiCompatOverride','compatPresetForHostStyle','normalizeSdkEvalHostConfigForWire']) { if (typeof m[n] !== 'function') { throw new Error('missing export: ' + n); } } const pub = await import('@mcpjam/sdk/public-api'); for (const n of ['isV1ErrorCode','mapInternalCode','v1ErrorBody','v1Page','classifyRuntimeError']) { if (typeof pub[n] !== 'function') { throw new Error('missing public-api export: ' + n); } } for (const n of ['V1_ERROR_CODES','V1_ERROR_STATUS','INTERNAL_TO_V1_CODE']) { if (pub[n] === undefined) { throw new Error('missing public-api export: ' + n); } } const hc = await import('@mcpjam/sdk/host-compat'); for (const n of ['deriveServerRequirements','evaluateHostCompat','evaluateAllHosts','buildMarketHostProfiles','evaluateMarketHosts','scanWidgetUsage','detectHostCompatBridgeFromMeta','scanWidgetSource','scanWidgetMeta','bundledHostCompatCatalog','buildHostProfilesFromCatalog','fetchHostCompatCatalog','hostConfigFieldsToImageSupport','imageSupportToHostConfigFields']) { if (typeof hc[n] !== 'function') { throw new Error('missing host-compat export: ' + n); } } if (hc['HostCompatBridge'] === undefined) { throw new Error('missing host-compat export: HostCompatBridge'); } for (const n of ['MCP_APPS_FULL','MCP_APPS_CHATGPT','MCP_APPS_MISTRAL','MCP_APPS_CURSOR','MCP_APPS_GOOSE','MCP_APPS_COPILOT','MCP_APPS_SLACK','MCP_APPS_VSCODE','MCP_APPS_NO_CLAIMS']) { if (typeof hc[n] !== 'object') { throw new Error('missing host-compat capability export: ' + n); } } for (const n of ['hostCompatCatalogSchema','hostCompatCatalogEnvelopeSchema','mcpAppsCapabilitiesSchema']) { if (hc[n] === undefined) { throw new Error('missing host-compat schema export: ' + n); } } const pb = await import('@mcpjam/sdk/plugin-bundle'); for (const n of ['parsePluginBundle','containsRootPlaceholder','containsPluginPlaceholder','selectPluginMcpServerMap','detectPluginMcpTransport']) { if (typeof pb[n] !== 'function') { throw new Error('missing plugin-bundle export: ' + n); } } for (const n of ['DEFAULT_PLUGIN_BUNDLE_LIMITS','PLUGIN_ISSUE_CODES','PLUGIN_MANIFEST_SCHEMAS','PLUGIN_MCP_SCHEMAS','PLUGIN_MANIFEST_PATH','PLUGIN_ROOT_PLACEHOLDERS','PLUGIN_DATA_PLACEHOLDER','PluginBundleError','MCP_CONFIG_PATH']) { if (pb[n] === undefined) { throw new Error('missing plugin-bundle export: ' + n); } } for (const n of ['normalizeBundlePath','validateBundleEntries','parseYamlLite','caseFoldPath','PluginIssueCollector','sha256HexBytes','computeAggregateHash']) { if (pb[n] !== undefined) { throw new Error('plugin-bundle should not re-export internal helper: ' + n); } } const on = await import('@mcpjam/sdk/oauth/node'); for (const n of ['assertOutboundOAuthUrlAllowed','isDisallowedIpAddress','isLoopbackOAuthUrl','isPrivateHost','OAuthOutboundUrlBlockedError','executeOAuthProxy','executeDebugOAuthProxy','fetchOAuthMetadata','fetchPinnedPublicDocument','validateUrl','OAuthProxyError']) { if (typeof on[n] !== 'function') { throw new Error('missing oauth/node export: ' + n); } }\"",
    "lint": "eslint src tests",
    "lint:fix": "eslint src tests --fix",
    "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
    "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
    "prettier-fix": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
    "typecheck": "tsc --noEmit",
    "prepublishOnly": "npm run build"
  },
  "keywords": [
    "mcp",
    "model-context-protocol",
    "testing",
    "evals",
    "unit-testing",
    "e2e"
  ],
  "author": "MCPJam",
  "license": "MIT",
  "devDependencies": {
    "@eslint/js": "^9.39.2",
    "@modelcontextprotocol/node": "2.0.0",
    "@modelcontextprotocol/sdk": "^1.26.0",
    "@modelcontextprotocol/server": "2.0.0",
    "@modelcontextprotocol/server-everything": "^2026.1.26",
    "@sentry/cli": "^2.58.4",
    "@sentry/node": "^8.55.0",
    "@types/jest": "^29.5.12",
    "@types/json-schema": "^7.0.15",
    "@types/node": "^20.11.0",
    "@typescript-eslint/eslint-plugin": "^8.53.1",
    "@typescript-eslint/parser": "^8.53.1",
    "esbuild": "^0.27.0",
    "eslint": "^9.39.2",
    "eslint-config-prettier": "^10.1.8",
    "eslint-plugin-prettier": "^5.5.5",
    "jest": "^29.7.0",
    "prettier": "^3.8.0",
    "ts-jest": "^29.1.2",
    "tsup": "^8.0.1",
    "tsx": "^4.21.0",
    "typescript": "^5.3.3",
    "typescript-eslint": "^8.53.1",
    "vitest": "^3.2.7"
  },
  "dependencies": {
    "@ai-sdk/amazon-bedrock": "^3.0.101",
    "@ai-sdk/anthropic": "^2.0.17",
    "@ai-sdk/azure": "^2.0.79",
    "@ai-sdk/deepseek": "^1.0.5",
    "@ai-sdk/google": "^2.0.11",
    "@ai-sdk/mistral": "^2.0.19",
    "@ai-sdk/openai": "^2.0.32",
    "@ai-sdk/xai": "^2.0.29",
    "@cfworker/json-schema": "^4.1.1",
    "@modelcontextprotocol/client": "2.0.0",
    "@modelcontextprotocol/ext-apps": "^1.7.4",
    "@noble/hashes": "^2.3.0",
    "@openrouter/ai-sdk-provider": "^2.2.0",
    "@xmldom/xmldom": "^0.8.13",
    "ai": "^6.0.141",
    "ajv": "^8.17.1",
    "jszip": "^3.10.1",
    "ollama-ai-provider-v2": "^1.5.2",
    "posthog-node": "^5.24.10",
    "xml-crypto": "^6.1.2",
    "xpath": "^0.0.34",
    "yaml": "^2.9.0",
    "zod": "^4.2.0"
  },
  "peerDependencies": {
    "@sentry/node": "^8.55.0"
  },
  "peerDependenciesMeta": {
    "@sentry/node": {
      "optional": true
    }
  },
  "engines": {
    "node": ">=20.0.0"
  },
  "overrides": {
    "zod": "^4.2.0"
  }
}
