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

Function toIntegrationConfig

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

Source from the content-addressed store, hash-verified

343};
344
345const 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
375type JsonSchemaObject = Record<string, unknown> & {
376 readonly properties?: Record<string, unknown>;

Callers 1

addServerFunction · 0.85

Calls 3

normalizeMcpAuthMethodsFunction · 0.90
stdioEnvVarNamesFunction · 0.85

Tested by

no test coverage detected