Skip to content

Commit ef3372f

Browse files
committed
Move deprecation attributes
1 parent 32a777a commit ef3372f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ModelContextProtocol.Core/Client/McpClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace ModelContextProtocol.Client;
1010
/// that connect to MCP servers. It handles the creation and connection
1111
/// of appropriate implementations through the supplied transport.
1212
/// </remarks>
13+
[Obsolete($"Use {nameof(McpClient)}.{nameof(McpClient.CreateAsync)} instead.")]
1314
public static partial class McpClientFactory
1415
{
1516
/// <summary>Creates an <see cref="IMcpClient"/>, connecting it to the specified server.</summary>
@@ -23,7 +24,6 @@ public static partial class McpClientFactory
2324
/// <returns>An <see cref="IMcpClient"/> that's connected to the specified server.</returns>
2425
/// <exception cref="ArgumentNullException"><paramref name="clientTransport"/> is <see langword="null"/>.</exception>
2526
/// <exception cref="ArgumentNullException"><paramref name="clientOptions"/> is <see langword="null"/>.</exception>
26-
[Obsolete($"Use {nameof(McpClient)}.{nameof(McpClient.CreateAsync)} instead.")]
2727
public static async Task<IMcpClient> CreateAsync(
2828
IClientTransport clientTransport,
2929
McpClientOptions? clientOptions = null,

src/ModelContextProtocol.Core/Server/McpServerFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace ModelContextProtocol.Server;
1010
/// This is the recommended way to create <see cref="IMcpServer"/> instances.
1111
/// The factory handles proper initialization of server instances with the required dependencies.
1212
/// </remarks>
13+
[Obsolete($"Use {nameof(McpServer)}.{nameof(McpServer.Create)} instead.")]
1314
public static class McpServerFactory
1415
{
1516
/// <summary>
@@ -22,7 +23,6 @@ public static class McpServerFactory
2223
/// <returns>An <see cref="IMcpServer"/> instance that should be disposed when no longer needed.</returns>
2324
/// <exception cref="ArgumentNullException"><paramref name="transport"/> is <see langword="null"/>.</exception>
2425
/// <exception cref="ArgumentNullException"><paramref name="serverOptions"/> is <see langword="null"/>.</exception>
25-
[Obsolete($"Use {nameof(McpServer)}.{nameof(McpServer.Create)} instead.")]
2626
public static IMcpServer Create(
2727
ITransport transport,
2828
McpServerOptions serverOptions,

0 commit comments

Comments
 (0)