using ModelContextProtocol.Protocol;
namespace ModelContextProtocol.Server;
///
/// Represents an instance of a Model Context Protocol (MCP) server that connects to and communicates with an MCP client.
///
public abstract partial class McpServer : McpSession
{
///
/// Gets the capabilities supported by the client.
///
///
///
/// These capabilities are established during the initialization handshake and indicate
/// which features the client supports, such as sampling, roots, and other
/// protocol-specific functionality.
///
///
/// Server implementations can check these capabilities to determine which features
/// are available when interacting with the client.
///
///
public abstract ClientCapabilities? ClientCapabilities { get; }
///
/// Gets the version and implementation information of the connected client.
///
///
///
/// This property contains identification information about the client that has connected to this server,
/// including its name and version. This information is provided by the client during initialization.
///
///
/// Server implementations can use this information for logging, tracking client versions,
/// or implementing client-specific behaviors.
///
///
public abstract Implementation? ClientInfo { get; }
///
/// Gets the options used to construct this server.
///
///
/// These options define the server's capabilities, protocol version, and other configuration
/// settings that were used to initialize the server.
///
public abstract McpServerOptions ServerOptions { get; }
///
/// Gets the service provider for the server.
///
public abstract IServiceProvider? Services { get; }
/// Gets the last logging level set by the client, or if it's never been set.
public abstract LoggingLevel? LoggingLevel { get; }
///
/// Runs the server, listening for and handling client requests.
///
public abstract Task RunAsync(CancellationToken cancellationToken = default);
}