Search Results for

    Show / Hide Table of Contents

    Class McpService

    Manages MCP integration for LM Studio native Track B chat requests. Reads registered connectors from McpConnectorCatalog and builds the ephemeral_mcp / plugin payload for native /api/v1/chat requests.

    MCP is opt-in: only active when LMStudioSettings.NativeTrack is enabled and there are connectors in the catalog.

    Inheritance
    object
    CrudServiceBase<LMStudioClient>
    McpService
    Implements
    ICrudService
    Inherited Members
    CrudServiceBase<LMStudioClient>.client
    CrudServiceBase<LMStudioClient>.ApiKey
    CrudServiceBase<LMStudioClient>.GetUrl(params string[])
    CrudServiceBase<LMStudioClient>.GetChildUrl(string, params string[])
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.LMStudio.Services
    Assembly: Glitch9.AIDevKit.Provider.LMStudio.dll
    Syntax
    public class McpService : CrudServiceBase<LMStudioClient>, ICrudService

    Constructors

    | Edit this page View Source

    McpService(LMStudioClient)

    Declaration
    public McpService(LMStudioClient client)
    Parameters
    Type Name Description
    LMStudioClient client

    Properties

    | Edit this page View Source

    Session

    Stateful conversation session for native Track B chat. Holds the conversation_id for multi-turn continuations.

    Declaration
    public NativeConversationSession Session { get; }
    Property Value
    Type Description
    NativeConversationSession

    Methods

    | Edit this page View Source

    BuildPayload()

    Builds the MCP payload (ephemeral_mcp + plugins) from McpConnectorCatalog entries. Returns (null, null) when the catalog is empty or unavailable. Connectors are forwarded only when the catalog has registered entries and explicit user opt-in.

    Declaration
    public (LMStudioEphemeralMcp ephemeralMcp, List<LMStudioPlugin> plugins) BuildPayload()
    Returns
    Type Description
    (LMStudioEphemeralMcp ephemeralMcp, List<LMStudioPlugin> plugins)
    | Edit this page View Source

    ClearSession()

    Clears the active conversation session. The next native chat request will start a fresh conversation.

    Declaration
    public void ClearSession()
    | Edit this page View Source

    InitializeSession(LMStudioNativeChatResponse)

    Records the conversation_id from the server's first native chat response. Call this after the first CreateNativeAsync to enable stateful continuation.

    Declaration
    public void InitializeSession(LMStudioNativeChatResponse firstResponse)
    Parameters
    Type Name Description
    LMStudioNativeChatResponse firstResponse

    Implements

    ICrudService

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation