update_mcp_server_user_access
Immediately grant or revoke user access to an MCP server. Overrides default access for selected users.
Instructions
Grant or revoke individual user access to an MCP server. Changes take effect immediately and override the default access setting for the selected users; use list_mcp_server_user_access first if you need the current state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The MCP server ID or slug | |
| users | Yes | Array of user access updates |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- src/tools/mcp-servers.tools.ts:359-383 (handler)The MCP tool handler for 'update_mcp_server_user_access'. Receives params (id, users), calls the service layer method, and returns a success message.
server.tool( "update_mcp_server_user_access", "Grant or revoke individual user access to an MCP server. Changes take effect immediately and override the default access setting for the selected users; use list_mcp_server_user_access first if you need the current state.", MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerUserAccess, async (params) => { await service.mcpServers.updateMcpServerUserAccess(params.id, { user_access: params.users, }); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated user access for MCP server "${params.id}"`, success: true, }, null, 2, ), }, ], }; }, ); - src/tools/mcp-servers.tools.ts:75-86 (schema)Zod schema definition for updateMcpServerUserAccess tool input: id (string) and users (array of {user_id, enabled} with min 1 item).
updateMcpServerUserAccess: { id: z.string().describe("The MCP server ID or slug"), users: z .array( z.object({ user_id: z.string().describe("User ID"), enabled: z.boolean().describe("Whether user has access"), }), ) .min(1) .describe("Array of user access updates"), }, - src/tools/mcp-servers.tools.ts:359-383 (registration)Tool registration via server.tool() using name 'update_mcp_server_user_access', description, schema, and handler.
server.tool( "update_mcp_server_user_access", "Grant or revoke individual user access to an MCP server. Changes take effect immediately and override the default access setting for the selected users; use list_mcp_server_user_access first if you need the current state.", MCP_SERVERS_TOOL_SCHEMAS.updateMcpServerUserAccess, async (params) => { await service.mcpServers.updateMcpServerUserAccess(params.id, { user_access: params.users, }); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated user access for MCP server "${params.id}"`, success: true, }, null, 2, ), }, ], }; }, ); - Service method that executes the HTTP PUT request to /mcp-servers/{id}/user-access with the UpdateMcpServerUserAccessRequest payload.
async updateMcpServerUserAccess( id: string, data: UpdateMcpServerUserAccessRequest, ): Promise<{ success: boolean }> { await this.put( `/mcp-servers/${this.encodePathSegment(id)}/user-access`, data, ); return { success: true }; } - TypeScript interface UpdateMcpServerUserAccessRequest defining the request body: user_access array of {user_id, enabled}.
export interface UpdateMcpServerUserAccessRequest { user_access: Array<{ user_id: string; enabled: boolean; }>; }