(input: McpServerInput)
| 358 | }; |
| 359 | |
| 360 | const toIntegrationConfig = (input: McpServerInput): McpIntegrationConfigType => { |
| 361 | if (input.transport === "stdio") { |
| 362 | // The config only DECLARES the secret env vars by NAME (a `stdio_env` |
| 363 | // method); their values are credentials and live on the connection, never |
| 364 | // in this blob. Names come from the explicit `envVars` declaration and/or |
| 365 | // the keys of any one-shot `env` values. |
| 366 | const vars = stdioEnvVarNames(input); |
| 367 | return { |
| 368 | transport: "stdio", |
| 369 | command: input.command, |
| 370 | args: input.args ? [...input.args] : undefined, |
| 371 | cwd: input.cwd, |
| 372 | authenticationTemplate: |
| 373 | vars.length > 0 |
| 374 | ? [{ slug: STDIO_ENV_TEMPLATE, kind: "stdio_env", vars }] |
| 375 | : [{ slug: "none", kind: "none" }], |
| 376 | }; |
| 377 | } |
| 378 | return { |
| 379 | transport: "remote", |
| 380 | endpoint: input.endpoint, |
| 381 | remoteTransport: input.remoteTransport ?? "auto", |
| 382 | queryParams: input.queryParams, |
| 383 | headers: input.headers, |
| 384 | authenticationTemplate: input.authenticationTemplate |
| 385 | ? normalizeMcpAuthMethods(input.authenticationTemplate) |
| 386 | : [mcpAuthMethodFromShorthand(input.auth ?? { kind: "none" })], |
| 387 | }; |
| 388 | }; |
| 389 | |
| 390 | type JsonSchemaObject = Record<string, unknown> & { |
| 391 | readonly properties?: Record<string, unknown>; |
no test coverage detected