{"record":{"id":"3015ad02f2288ac7","repo":"paperclipai/paperclip","slug":"mcp-remote-missing-secret","errorCode":"mcp_remote_missing_secret","errorMessage":"A configured credential secret could not be resolved.","messagePattern":"A configured credential secret could not be resolved\\.","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":422,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":2493,"sourceCode":"    const passthroughAllowlist = [\n      ...stringArray(passthrough.allow),\n      ...stringArray(passthrough.allowedHeaders),\n      ...stringArray(rawPolicy.allowedPassthroughHeaders),\n    ]\n      .map(headerName)\n      .filter((name): name is string => Boolean(name))\n      .filter((name) => !isSensitivePassthroughHeader(name));\n\n    const metadata = asRecord(rawPolicy.metadata) ?? {};\n    const metadataHeaders = [\n      ...stringArray(metadata.forward),\n      ...stringArray(metadata.headers),\n      ...stringArray(rawPolicy.forwardContextHeaders),\n    ].filter((value): value is HeaderPolicyConfig[\"metadataHeaders\"][number] =>\n      value === \"company_id\"\n      || value === \"agent_id\"\n      || value === \"issue_id\"\n      || value === \"project_id\"\n      || value === \"run_id\"\n      || value === \"gateway_session_id\"\n      || value === \"correlation_id\",\n    );\n\n    return {\n      staticHeaders: parsedStaticHeaders,\n      passthroughAllowlist: [...new Set(passthroughAllowlist)],\n      metadataHeaders: [...new Set(metadataHeaders)],\n    };\n  }\n\n  function readOnDemandToolsEnabled(connectionOrConfig: typeof toolConnections.$inferSelect | Record<string, unknown>): boolean {\n    const config = \"config\" in connectionOrConfig ? asRecord(connectionOrConfig.config) ?? {} : connectionOrConfig;\n    const raw = asRecord(config.onDemandTools) ?? asRecord(config.loadToolsOnDemand);\n    return config.onDemandTools === true || config.loadToolsOnDemand === true || raw?.enabled === true;\n  }\n","sourceCodeStart":2475,"sourceCodeEnd":2511,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L2475-L2511","documentation":"Credential resolution failure while building request headers for a tool connection: secrets.resolveSecretValue could not resolve one of the connection's credentialRefs (placement=header) — the secret is missing, its version is unavailable, or access was denied for this consumer. The masked 500 indicates an operator-side secret configuration problem, not caller input.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:2397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the connection's credential reference: the named secret is missing from the secret store. Reconfigure the credential or create the secret."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}