SM

stefh/mcpdotnet.extensions.semantickernel

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

40 stars 14 forks 品質 56 トレンド 16MIT

stefh/mcpdotnet.extensions.semantickernel は [https://github.com/stefh/mcpdotnet.extensions.semantickernel.] からインポートされた MCP サーバー候補です

概要

stefh/mcpdotnet.extensions.semantickernel は [https://github.com/stefh/mcpdotnet.extensions.semantickernel.] からインポートされた MCP サーバー候補です

概要(AI 翻訳)

モデルContextProtocol.SemanticKernel

csharp-sdk を使用したモデルコンテキストプロトコルの Microsoft SemanticKernel 統合。 MCP ツールを AI 機能としてシームレスに活用できます。

[!NOTE] このプロジェクトはプレビュー中です。事前の通知なしに変更を解除することができます。

📦 Nu パッケージ

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stef.ModelContextプロトコル セマンティックカーネル | Stef.ModelContextProtocol.Schema | 株式会社システフ

概要

¢ の使用

エクステンションメソッドを使用して、特定のMCP関数/ツールを登録します。

単一機能か用具を登録して下さい

##Claudeデスクトップ設定からMCP Server(s)を登録する また、Claude Desktopに登録されているすべての Stdio MCP Server を登録することもできます。

̇ フルStdioの例

コード

結果

̇ フルSSE (サーバー・セント・イベント) 事例紹介

コード

結果

447 リファレンス

スポンサー

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

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
Stef.ModelContextProtocol.Schema

Overview

---
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

// 💡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:

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

💻 Full Stdio Example

Code

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

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →