updateMcpServer()
This method updates MCP server configuration.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function example() { const client = await wachtClient(); const mcpServerId: string = 'mcpserverid-123'; const request: UpdateMcpServerRequest = { name: 'Internal MCP (Updated)', }; return client.ai.updateMcpServer(mcpServerId, request);}Signature
function updateMcpServer( mcpServerId: string, request: UpdateMcpServerRequest, client?: WachtClient,): Promise<McpServer>Parameters
›mcpServerId: string;
mcpServerId: string;Target MCP server id.
›request: UpdateMcpServerRequest;
request: UpdateMcpServerRequest;Request payload object sent to the backend API.
›name?: string | undefined;
name?: string | undefined;Display name for the target resource.
Return value
›id?: string | undefined;
id?: string | undefined;MCP server id.
›name?: string | undefined;
name?: string | undefined;MCP server display name.
›transport?: string | undefined;
transport?: string | undefined;MCP transport mode (for example `sse`).
›endpoint_url?: string | undefined;
endpoint_url?: string | undefined;MCP endpoint URL.
Examples
AI usage pattern
import { wachtClient } from '@wacht/nextjs/server';export async function provisionMcp(actorId: string) { const client = await wachtClient(); const server = await client.ai.createMcpServer({ name: 'Internal MCP', transport: 'sse', endpoint_url: 'https://mcp.example.com', }); const connected = await client.ai.connectActorMcpServer(actorId, server.id); return { server, connected };}