MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toIntegrationConfig

Function toIntegrationConfig

packages/plugins/mcp/src/sdk/plugin.ts:361–389  ·  view source on GitHub ↗
(input: McpServerInput)

Source from the content-addressed store, hash-verified

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

Callers 1

addServerFunction · 0.85

Calls 3

normalizeMcpAuthMethodsFunction · 0.90
stdioEnvVarNamesFunction · 0.85

Tested by

no test coverage detected