Skip to content

Commit 2ef8821

Browse files
committed
Remove McpEndpoint & IMcpClient
1 parent 70960e1 commit 2ef8821

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+497
-586
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ dotnet add package ModelContextProtocol --prerelease
3737

3838
## Getting Started (Client)
3939

40-
To get started writing a client, the `McpClientFactory.CreateAsync` method is used to instantiate and connect an `IMcpClient`
41-
to a server. Once you have an `IMcpClient`, you can interact with it, such as to enumerate all available tools and invoke tools.
40+
To get started writing a client, the `McpClientFactory.CreateAsync` method is used to instantiate and connect an `McpClientSession`
41+
to a server. Once you have an `McpClientSession`, you can interact with it, such as to enumerate all available tools and invoke tools.
4242

4343
```csharp
4444
var clientTransport = new StdioClientTransport(new StdioClientTransportOptions

samples/InMemoryTransport/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
_ = server.RunAsync();
2222

2323
// Connect a client using a stream-based transport over the same in-memory pipe.
24-
await using IMcpClient client = await McpClientFactory.CreateAsync(
24+
await using McpClientSession client = await McpClientFactory.CreateAsync(
2525
new StreamClientTransport(clientToServerPipe.Writer.AsStream(), serverToClientPipe.Reader.AsStream()));
2626

2727
// List all tools.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Reflection;
2+
3+
namespace ModelContextProtocol;
4+
5+
internal static class AssemblyNameHelper
6+
{
7+
/// <summary>Cached naming information used for MCP session name/version when none is specified.</summary>
8+
public static AssemblyName DefaultAssemblyName { get; } = (Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()).GetName();
9+
}

src/ModelContextProtocol.Core/Client/IClientTransport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace ModelContextProtocol.Client;
1111
/// and servers, allowing different transport protocols to be used interchangeably.
1212
/// </para>
1313
/// <para>
14-
/// When creating an <see cref="IMcpClient"/>, <see cref="McpClientFactory"/> is typically used, and is
14+
/// When creating an <see cref="McpClientSession"/>, <see cref="McpClientFactory"/> is typically used, and is
1515
/// provided with the <see cref="IClientTransport"/> based on expected server configuration.
1616
/// </para>
1717
/// </remarks>
@@ -35,7 +35,7 @@ public interface IClientTransport
3535
/// </para>
3636
/// <para>
3737
/// The lifetime of the returned <see cref="ITransport"/> instance is typically managed by the
38-
/// <see cref="McpClient"/> that uses this transport. When the client is disposed, it will dispose
38+
/// <see cref="McpClientSession"/> that uses this transport. When the client is disposed, it will dispose
3939
/// the transport session as well.
4040
/// </para>
4141
/// <para>

src/ModelContextProtocol.Core/Client/IMcpClient.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/ModelContextProtocol.Core/Client/McpClient.cs

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)