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

Function toIntegrationConfig

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

Source from the content-addressed store, hash-verified

358};
359
360const 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
390type JsonSchemaObject = Record<string, unknown> & {
391 readonly properties?: Record<string, unknown>;

Callers 1

addServerFunction · 0.85

Calls 3

normalizeMcpAuthMethodsFunction · 0.90
stdioEnvVarNamesFunction · 0.85

Tested by

no test coverage detected