MCPDotNet Extensions SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
What is MCPDotNet Extensions SemanticKernel?
MCPDotNet Extensions SemanticKernel is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to microsoft semantickernel integration for the model context protocol (mcp). enables seamless use of mcp tools as ai functions.
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Microsoft SemanticKernel integration for the Model Context P
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcpdotnet-extensions-semantickernelConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCPDotNet Extensions SemanticKernel
McpDotNet.Extensions.SemanticKernel is a .NET library that integrates the Model Context Protocol with Microsoft Semantic Kernel, enabling C# applications to register MCP server tools as native Semantic Kernel plugin functions. It supports both stdio-based MCP servers and SSE (HTTP) connections, and can automatically read server definitions from a Claude Desktop configuration file. This allows .NET developers to enrich their Semantic Kernel AI pipelines with the full ecosystem of MCP tools without writing custom adapters.
Prerequisites
- .NET 8 or .NET 9 SDK installed
- NuGet packages: Stef.ModelContextProtocol.SemanticKernel and Stef.ModelContextProtocol.Schema
- An OpenAI API key (OPENAI_API_KEY) for Semantic Kernel's chat completion backend
- At least one MCP server available (stdio or SSE), such as @modelcontextprotocol/server-github
Create a new .NET project
Create a console or worker service project that will host your Semantic Kernel pipeline.
dotnet new console -n MySemanticKernelApp
cd MySemanticKernelAppAdd the NuGet packages
Add the McpDotNet SemanticKernel extension and schema packages from NuGet.
dotnet add package Stef.ModelContextProtocol.SemanticKernel
dotnet add package Stef.ModelContextProtocol.SchemaSet your OpenAI API key
Provide your OpenAI API key as an environment variable or via .NET user secrets for Semantic Kernel's chat completion to work.
export OPENAI_API_KEY=sk-...Register MCP tools from a stdio server
In your C# code, build a Semantic Kernel instance and call AddMcpFunctionsFromStdioServerAsync to register all tools from a stdio MCP server as plugin functions.
await kernel.Plugins.AddMcpFunctionsFromStdioServerAsync(
"GitHub", "npx", new[] { "-y", "@modelcontextprotocol/server-github" });Or load servers from Claude Desktop config
Alternatively, call AddToolsFromClaudeDesktopConfigAsync to automatically discover and register all MCP servers listed in your claude_desktop_config.json file.
await kernel.Plugins.AddToolsFromClaudeDesktopConfigAsync(cancellationToken: cts.Token);Enable automatic function calling and invoke
Configure Semantic Kernel to use automatic function choice behavior so it can invoke MCP tools when responding to prompts.
var settings = new OpenAIPromptExecutionSettings
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
};
var result = await kernel.InvokePromptAsync("List my open GitHub issues", new(settings));MCPDotNet Extensions SemanticKernel Examples
Client configuration
Claude Desktop config that the library can read to discover MCP servers automatically via AddToolsFromClaudeDesktopConfigAsync.
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}Prompts to try
Example Semantic Kernel prompts that trigger MCP tool calls with automatic function calling enabled.
- "List all open issues in my GitHub repository"
- "Search for files containing 'TODO' in the repository"
- "Create a GitHub issue titled 'Fix login bug' with details about the authentication problem"
- "What tools are available from the connected MCP servers?"Troubleshooting MCPDotNet Extensions SemanticKernel
OPENAI_API_KEY not found or unauthorized error
Set the environment variable before running your app: export OPENAI_API_KEY=sk-... on macOS/Linux or $env:OPENAI_API_KEY='sk-...' in PowerShell. Ensure the key is valid and has sufficient quota.
MCP server fails to start via stdio
Ensure the target command (e.g. npx) is available in PATH and the MCP server package is accessible. Test by running the command manually: npx -y @modelcontextprotocol/server-github
AddToolsFromClaudeDesktopConfigAsync finds no servers
Verify that claude_desktop_config.json exists at the default Claude Desktop path for your OS and contains a valid mcpServers object. The library reads this file at the standard platform location.
Frequently Asked Questions about MCPDotNet Extensions SemanticKernel
What is MCPDotNet Extensions SemanticKernel?
MCPDotNet Extensions SemanticKernel is a Model Context Protocol (MCP) server that microsoft semantickernel integration for the model context protocol (mcp). enables seamless use of mcp tools as ai functions. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCPDotNet Extensions SemanticKernel?
Follow the installation instructions on the MCPDotNet Extensions SemanticKernel GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCPDotNet Extensions SemanticKernel?
MCPDotNet Extensions SemanticKernel works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCPDotNet Extensions SemanticKernel free to use?
Yes, MCPDotNet Extensions SemanticKernel is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCPDotNet Extensions SemanticKernel Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCPDotNet Extensions SemanticKernel? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCPDotNet Extensions SemanticKernel in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCPDotNet Extensions SemanticKernel?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.