Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Mcpdotnet.extensions.semantickernel

    Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.

    34 stars
    C#
    Updated Oct 31, 2025

    Table of Contents

    • 📦 NuGet packages
    • Overview
    • ⚙️ Usage
    • Register single function or tool
    • Register MCP Server(s) from Claude Desktop configuration
    • 💻 Full Stdio Example
    • Code
    • Result
    • 💻 Full SSE (Server-Sent Events) Example
    • Code
    • Result
    • 📖 References
    • Sponsors

    Table of Contents

    • 📦 NuGet packages
    • Overview
    • ⚙️ Usage
    • Register single function or tool
    • Register MCP Server(s) from Claude Desktop configuration
    • 💻 Full Stdio Example
    • Code
    • Result
    • 💻 Full SSE (Server-Sent Events) Example
    • Code
    • Result
    • 📖 References
    • Sponsors

    Documentation

    Project Icon ModelContextProtocol.SemanticKernel

    Microsoft SemanticKernel integration for the Model Context Protocol using the csharp-sdk.

    Enables seamless use of MCP tools as AI functions.

    [!NOTE]

    This project is in preview; breaking changes can be introduced without prior notice.

    📦 NuGet packages

    Stef.ModelContextProtocol.SemanticKernel | NuGet Badge

    Stef.ModelContextProtocol.Schema | NuGet Badge

    Overview

    mermaid
    ---
    title: "Overview"
    ---
    
    graph LR;
        SK[Semantic Kernel'OpenAI'] 
        MCPClient[MCPClient'Function Calling']
        MCPServer[Local MCP Server'server-github'] 
        GitHub[GitHub]
    
        SK  MCPClient
        MCPClient  MCPServer
        MCPServer  GitHub

    ⚙️ Usage

    Use an extension method to register a specific MCP function/tool

    Register single function or tool

    csharp
    // 💡Stdio
    await kernel.Plugins.AddMcpFunctionsFromStdioServerAsync("GitHub", "npx", ["-y", "@modelcontextprotocol/server-github"]);
    
    // 💡SSE
    await kernel.Plugins.AddMcpFunctionsFromSseServerAsync("GitHub", new Uri("http://localhost:12345"));

    Register MCP Server(s) from Claude Desktop configuration

    It's also possible to register all Stdio MCP Servers which are registered in Claude Desktop:

    csharp
    // 💡Stdio MCP Tools defined in claude_desktop_config.json
    await kernel.Plugins.AddToolsFromClaudeDesktopConfigAsync(cancellationToken: cts.Token);

    💻 Full Stdio Example

    Code

    csharp
    var builder = Kernel.CreateBuilder();
    builder.Services.AddLogging(c => c.AddDebug().SetMinimumLevel(LogLevel.Trace));
    
    builder.Services.AddOpenAIChatCompletion(
        serviceId: "openai",
        modelId: "gpt-4o-mini",
        apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")!);
    
    var kernel = builder.Build();
    
    // 💡 Add this line to enable MCP functions from a Stdio server named "Everything"
    await kernel.Plugins.AddMcpFunctionsFromStdioServerAsync("Everything", "npx", ["-y", "@modelcontextprotocol/server-github"]);
    
    var executionSettings = new OpenAIPromptExecutionSettings
    {
        Temperature = 0,
        FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
    };
    
    var prompt = "Please call the echo tool with the string 'Hello Stef!' and give me the response as-is.";
    var result = await kernel.InvokePromptAsync(prompt, new(executionSettings)).ConfigureAwait(false);
    Console.WriteLine($"\n\n{prompt}\n{result}");

    Result

    code
    Please call the echo tool with the string 'Hello Stef!' and give me the response as-is.
    Echo: Hello Stef!

    💻 Full SSE (Server-Sent Events) Example

    Code

    csharp
    var builder = Kernel.CreateBuilder();
    builder.Services.AddLogging(c => c.AddDebug().SetMinimumLevel(LogLevel.Trace));
    
    builder.Services.AddOpenAIChatCompletion(
        serviceId: "openai",
        modelId: "gpt-4o-mini",
        apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")!);
    
    var kernel = builder.Build();
    
    // 💡 Add this line to enable MCP functions from a Sse server named "Github"
    // - Note that a server must be running at the specified URL
    await kernel.Plugins.AddMcpFunctionsFromSseServerAsync("GitHub", "http://localhost:12345");
    
    var executionSettings = new OpenAIPromptExecutionSettings
    {
        Temperature = 0,
        FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
    };
    
    var prompt = "Summarize the last 3 commits to the StefH/FluentBuilder repository.";
    var result = await kernel.InvokePromptAsync(prompt, new(executionSettings)).ConfigureAwait(false);
    Console.WriteLine($"\n\n{prompt}\n{result}");

    Result

    code
    Summarize the last 3 commits to the StefH/FluentBuilder repository.
    Here are the summaries of the last three commits to the `StefH/FluentBuilder` repository:
    
    1. **Commit [2293880](https://github.com/StefH/FluentBuilder/commit/229388090f50a39f489e30cb535f67f3705cf61f)** (January 30, 2025)
       - **Author:** Stef Heyenrath
       - **Message:** Update README.md
       - **Details:** This commit updates the README.md file. The commit was verified and is valid.
    
    2. **Commit [ae27064](https://github.com/StefH/FluentBuilder/commit/ae2706424c3b75613bf5625091aa2649fb33ecde)** (November 6, 2024)
       - **Author:** Stef Heyenrath
       - **Message:** Update README.md
       - **Details:** This commit also updates the README.md file. The commit was verified and is valid.
    
    3. **Commit [53096a8](https://github.com/StefH/FluentBuilder/commit/53096a8b54a1029532425bc727fdd831e9ed0092)** (October 20, 2024)
       - **Author:** Stef Heyenrath
       - **Message:** Update README.md
       - **Details:** This commit updates the README.md file as well. The commit was verified and is valid.
    
    All three commits involve updates to the README.md file, reflecting ongoing improvements or changes to the documentation.

    📖 References

    • https://modelcontextprotocol.io
    • https://github.com/PederHP/mcpdotnet
    • https://github.com/modelcontextprotocol/csharp-sdk
    • https://devblogs.microsoft.com/semantic-kernel/integrating-model-context-protocol-tools-with-semantic-kernel-a-step-by-step-guide/

    Sponsors

    Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of ModelContextProtocol-SemanticKernel.

    Entity Framework Extensions

    Dapper Plus

    Similar MCP

    Based on tags & features

    • MC

      Mcpmcp Server

      21
    • IM

      Imagen3 Mcp

      Rust·
      46
    • MC

      Mcp Open Library

      TypeScript·
      42
    • DI

      Discogs Mcp Server

      TypeScript·
      59

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcpmcp Server

      21
    • IM

      Imagen3 Mcp

      Rust·
      46
    • MC

      Mcp Open Library

      TypeScript·
      42
    • DI

      Discogs Mcp Server

      TypeScript·
      59

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k