> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AddCommand

> Interactive wizard command that generates the `claude mcp add` registration line for a remote OData service, including the outbound OAuth flags `odata-mcp st...

## Definition

**Assembly:** Microsoft.OData.Mcp.Tools.dll

**Namespace:** Microsoft.OData.Mcp.Tools.Commands

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Tools.Commands.AddCommand
```

## Summary

Interactive wizard command that generates the `claude mcp add` registration line for a remote OData
service, including the outbound OAuth flags `odata-mcp start` needs to sign in.

## Remarks

This command provides an interactive experience for users to configure their OData
service connection and generates the appropriate `claude mcp add` command for Claude Code.
Tests must assign [Input](https://learn.microsoft.com/dotnet/api/microsoft.odata.mcp.tools.commands.addcommand.input) and [Output](https://learn.microsoft.com/dotnet/api/microsoft.odata.mcp.tools.commands.addcommand.output) instead of calling
[TextReader)](https://learn.microsoft.com/dotnet/api/system.console.setin\(system.io.textreader\)). Windows testhost wraps `SetIn` in
`SyncTextReader` and leaves [IsInputRedirected](https://learn.microsoft.com/dotnet/api/system.console.isinputredirected) false, so
[Boolean)](https://learn.microsoft.com/dotnet/api/system.console.readkey\(system.boolean\)) blocks the Visual Studio Test Explorer.

Per `specs/v3/AUTHENTICATION.md` "CLI UX → `odata-mcp add`" the generated command never
carries an access or refresh token, and never carries `--env`: `claude mcp add --env` takes
`KEY=VALUE`, so a bare name is either invalid or empty. A client secret is an instruction, not a
value. An API key, a Basic password, and a pasted bearer token do reach the configuration file, and each
one is warned about at the moment it is collected.

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={null}
public AddCommand()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public Object()
```

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;OnExecuteAsync

Executes the interactive wizard for generating MCP registration commands.

#### Syntax

```csharp theme={null}
public System.Threading.Tasks.Task<int> OnExecuteAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task<int>`
Exit code: `0` for success, `1` when the wizard could not finish.

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.