(input: McpServerInput)
| 343 | }; |
| 344 | |
| 345 | const toIntegrationConfig = (input: McpServerInput): McpIntegrationConfigType => { |
| 346 | if (input.transport === "stdio") { |
| 347 | // The config only DECLARES the secret env vars by NAME (a `stdio_env` |
| 348 | // method); their values are credentials and live on the connection, never |
| 349 | // in this blob. Names come from the explicit `envVars` declaration and/or |
| 350 | // the keys of any one-shot `env` values. |
| 351 | const vars = stdioEnvVarNames(input); |
| 352 | return { |
| 353 | transport: "stdio", |
| 354 | command: input.command, |
| 355 | args: input.args ? [...input.args] : undefined, |
| 356 | cwd: input.cwd, |
| 357 | authenticationTemplate: |
| 358 | vars.length > 0 |
| 359 | ? [{ slug: STDIO_ENV_TEMPLATE, kind: "stdio_env", vars }] |
| 360 | : [{ slug: "none", kind: "none" }], |
| 361 | }; |
| 362 | } |
| 363 | return { |
| 364 | transport: "remote", |
| 365 | endpoint: input.endpoint, |
| 366 | remoteTransport: input.remoteTransport ?? "auto", |
| 367 | queryParams: input.queryParams, |
| 368 | headers: input.headers, |
| 369 | authenticationTemplate: input.authenticationTemplate |
| 370 | ? normalizeMcpAuthMethods(input.authenticationTemplate) |
| 371 | : [mcpAuthMethodFromShorthand(input.auth ?? { kind: "none" })], |
| 372 | }; |
| 373 | }; |
| 374 | |
| 375 | type JsonSchemaObject = Record<string, unknown> & { |
| 376 | readonly properties?: Record<string, unknown>; |
no test coverage detected