MCPcopy
hub / github.com/ComposioHQ/composio / update

Method update

ts/packages/core/src/models/MCP.ts:369–411  ·  view source on GitHub ↗

* Update an existing MCP server configuration with new settings * @param {string} serverId - The unique identifier of the MCP server to update * @param {Object} config - Update configuration parameters * @param {string} [config.name] - New name for the MCP server * @param {Array} [config

(
    serverId: string,
    config: MCPUpdateParams,
    requestOptions?: ComposioRequestOptions
  )

Source from the content-addressed store, hash-verified

367 * @note When updating toolkits, the entire toolkit configuration is replaced, not merged.
368 */
369 async update(
370 serverId: string,
371 config: MCPUpdateParams,
372 requestOptions?: ComposioRequestOptions
373 ): Promise<MCPItem> {
374 const { data: params, error } = MCPUpdateParamsSchema.safeParse(config);
375 if (error) {
376 throw new ValidationError('Failed to validate update params', {
377 cause: error,
378 });
379 }
380
381 const toolkits: string[] = [];
382 const auth_config_ids: string[] = [];
383 const custom_tools: string[] | undefined = params.allowedTools ?? undefined;
384
385 // extract all the toolkits, authconfigs, and allowed tools to separate slugs
386 params.toolkits?.forEach(toolkit => {
387 if (typeof toolkit === 'string') {
388 toolkits.push(toolkit);
389 } else if (toolkit.toolkit) {
390 toolkits.push(toolkit.toolkit);
391 } else if (toolkit.authConfigId) {
392 auth_config_ids.push(toolkit.authConfigId);
393 }
394 });
395 const updateBody = {
396 ...{ name: params.name ?? undefined },
397 ...(params.toolkits
398 ? {
399 custom_tools: custom_tools,
400 toolkits: toolkits,
401 auth_config_ids: auth_config_ids,
402 }
403 : {}),
404 ...{ managed_auth_via_composio: params.manuallyManageConnections ?? undefined },
405 };
406 const response = await withCancellation(
407 () => this.client.mcp.update(serverId, updateBody, requestOptions),
408 requestOptions?.signal
409 );
410 return transformMCPItemResponse(response);
411 }
412
413 /**
414 * Get server URLs for an existing MCP server.

Callers 15

computeSignatureFunction · 0.45
createSignatureFunction · 0.45
triggers.test.tsFile · 0.45
createSignatureFunction · 0.45
mcp.test.tsFile · 0.45
uploadFileToS3Function · 0.45
logFunction · 0.45
infoFunction · 0.45
warnFunction · 0.45

Calls 3

withCancellationFunction · 0.90
transformMCPItemResponseFunction · 0.85
pushMethod · 0.80

Tested by 3

computeSignatureFunction · 0.36
createSignatureFunction · 0.36
createSignatureFunction · 0.36