# Start-IntelligenceXMcpOAuthLogin

Starts an MCP OAuth login flow and returns the browser authorization URL.

Command 

**Module**

`IntelligenceX.PowerShell`

**Inputs**

`IntelligenceX.OpenAI.IntelligenceXClient`

**Outputs**

`IntelligenceX.Json.JsonValue` `IntelligenceX.OpenAI.AppServer.Models.McpOauthLoginStart`

Starts an MCP OAuth login flow and returns the browser authorization URL.

## Syntax

```
Start-IntelligenceXMcpOAuthLogin
[-Client <IntelligenceXClient>]
[-Raw]
[-ServerId <string>]
[-ServerName <string>]
[<CommonParameters>]
```

[#](#method-start-intelligencexmcpoauthlogin-intelligencexclient-switchparameter-string-string)

## Examples

### Example 1

```powershell
$login = Start-IntelligenceXMcpOAuthLogin -ServerName "github"; Start-Process $login.AuthUrl; $login
```

Start OAuth login by server name and open the browser

### Example 2

```powershell
Start-IntelligenceXMcpOAuthLogin -ServerId "srv_123"
```

Start OAuth login by server id

### Example 3

```powershell
$oauthStatus = [IntelligenceX.OpenAI.AppServer.Models.McpAuthStatus]::OAuth; $server = (Get-IntelligenceXMcpServerStatus).Servers | Where-Object { $_.AuthStatus -eq $oauthStatus } | Select-Object -First 1; Start-IntelligenceXMcpOAuthLogin -ServerName $server.Name
```

Discover an OAuth server first, then start login

### Example 4

```powershell
Start-IntelligenceXMcpOAuthLogin -ServerName "github" -Raw
```

Return raw JSON response for custom handling

## Parameters

**-Client IntelligenceXClient optionalpipeline: true (ByValue)**

App-server client instance to use. Defaults to the active client.

**-Raw SwitchParameter optional**

Returns the raw JSON-RPC payload instead of a typed model.

**-ServerId string optional**

MCP server identifier to start login for.

**-ServerName string optional**

MCP server name to start login for.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:A2567371D21773A0EF7603A41BC6BFB933E729886235CEBCDB2855674B165011 -->
