# TraconMcpOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconmcpoptions/
> Summary: TraconMcpOptions: Options for connecting to remote MCP servers.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Mcp.dll</code></div>

Options for connecting to remote MCP servers.

```csharp
public sealed class TraconMcpOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconmcpoptions/">TraconMcpOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Constructors

### <a id="Tracon_TraconMcpOptions__ctor"></a> TraconMcpOptions\(\)

```csharp
public TraconMcpOptions()
```

## Fields

### <a id="Tracon_TraconMcpOptions_SectionName"></a> SectionName

The default name of the configuration section.

```csharp
public const string SectionName = "Tracon:Mcp"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconMcpOptions_ConnectionTimeout"></a> ConnectionTimeout

The upper time bound for connecting to a server and listing its tools.

```csharp
public TimeSpan ConnectionTimeout { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

Must be from one millisecond to about 49.7 days; any other value fails at startup.

### <a id="Tracon_TraconMcpOptions_Enabled"></a> Enabled

Whether MCP tool discovery is on. When turned off, no server is
connected to and only the tools registered in code are visible.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_TraconMcpOptions_MaxResourceBytesPerResource"></a> MaxResourceBytesPerResource

In Mode A ([AgentDefinition.McpResourceUris](/api/tracon.agentdefinition/#Tracon_AgentDefinition_McpResourceUris)), the maximum
number of bytes added to the context from a single resource. Content
beyond this limit is trimmed.

```csharp
public int MaxResourceBytesPerResource { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconMcpOptions_MaxResourceBytesTotal"></a> MaxResourceBytesTotal

In Mode A, the total byte limit across all resources of an agent
definition. Resources beyond this limit are trimmed; resources beyond
the total limit are skipped entirely.

```csharp
public int MaxResourceBytesTotal { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconMcpOptions_MaxToolsPerServer"></a> MaxToolsPerServer

The maximum number of tools accepted from a single server. Tools
beyond this limit are dropped and a warning is logged.

```csharp
public int MaxToolsPerServer { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

The remote server is treated as untrusted. An unbounded tool list
would produce uncontrolled growth both in the model context and in
the UI.

### <a id="Tracon_TraconMcpOptions_OAuthCallbackBaseUri"></a> OAuthCallbackBaseUri

The base URI of the OAuth Mode 1 (authorization code) callback
addresses. Example: `https://myapp.example.com/`. Must already be
registered with the provider. When [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), no
connection is made to a server with OAuth enabled, and
`/oauth/start` answers that OAuth is not configured.

```csharp
public Uri? OAuthCallbackBaseUri { get; set; }
```

#### Property Value

 Uri?

### <a id="Tracon_TraconMcpOptions_RefreshInterval"></a> RefreshInterval

The refresh interval of the tool list. A remote server may change its
tool definitions; discovery repeats at this interval.

```csharp
public TimeSpan RefreshInterval { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

### <a id="Tracon_TraconMcpOptions_StaleToolRetention"></a> StaleToolRetention

How long a server's last good tool list is kept when a refresh cannot list
its tools. The default is 15 minutes, three refreshes at the default interval.

```csharp
public TimeSpan StaleToolRetention { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

A network blip on one `tools/list` call no longer takes a server's
tools away: while the server stays registered with the same definition, its
connection keeps serving the tools it last listed for this long after that
listing, and agents that use them keep running. A call that reaches a server
that is really down fails as a tool error, as it would during the next refresh
interval. Once the time has passed, the next failed refresh drops the tools,
and an agent that names one is refused because the tool is not registered.

A server whose definition changes, or that is deleted or disabled, drops its
tools at once; this setting only covers a failed listing of an unchanged
server. [TimeSpan.Zero](https://learn.microsoft.com/dotnet/api/system.timespan) drops them at the first failed listing.
Must not be negative; a negative value fails at startup.
