Cover image
Try Now
2025-04-14

Beispiel für die Verwendung von Microsoft Semantic Kernel mit OpenAI und MCP Server

3 years

Works with Finder

1

Github Watches

1

Github Forks

2

Github Stars

$${\color{red}This \space repository \space will \space not \space be \space maintained. \space It's \space just \space a \space quick \space sample.}$$

mpc-csharp-semantickernel

An example usage of Microsoft Semantic Kernel with OpenAI and the The official C# SDK for the Model Context Protocol which can be found at https://github.com/modelcontextprotocol/csharp-sdk

Prerequisites

A SMTP Email Server (for the EmailTools) An OpenAI ApiKey

How to run the sample

  1. Use your OpenAI Developer Dashboard to get an ApiKey.
  2. Fill out the appsettings for each separate project.
  3. The email addresses that you can send emails to are hardcoded as a dictionary inside Tools/EmailTool.cs. Update the dictionary with your email list. Feel free to make this a setting.
  4. Run the project. The default launchSettings are set to http://localhost:5109

Appsettings

WebAppMCPPoc Project

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "OpenAI": {
    "ApiKey": "<yourApiKey>",
    "ChatModelId" : "gpt-4o-mini"
  }
}

MCPServer Project

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "EmailSettings": {
    "SMTPServer": {
      "MailPort": "465",
      "MailServer": "<yourserver.com>",
      "Sender": "<sender@youremail.com>",
      "SenderName": "<AIEmailSender>",
      "Password": "<EmailPassword>",
      "Username": "<EmailUsername>"
    }
  }
}

Sending Requests:

You can use a tool like postman to send requests.

Example request: POST https://localhost:7113/chat Body: { "text": "send and email toaFriend and tell him that you are an ai in 250 words. Tell him you're using C# to do this.."}

Replace {someone} with a name you have added in the EmailTool emails dictionary.

        private static readonly Dictionary<string, string> emails = new Dictionary<string, string>
        {
            { "example", "mail@example.com" },
            { "aFriend", "friendEmail@gmail.com" }
        };

License

This project is licensed under the MIT License.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • momi
  • Provides initial medical assessments and advice.

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • huahuayu
  • Ein einheitliches API-Gateway zur Integration mehrerer Ethercan-ähnlicher Blockchain-Explorer-APIs mit Modellkontextprotokoll (MCP) für AI-Assistenten.

  • deemkeen
  • Steuern Sie Ihren MBOT2 mit einer Power Combo: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Message Connector Protocol )服务 , 提供了与钉钉企业应用交互的 api 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

  • pontusab
  • Die Cursor & Windsurf -Community finden Regeln und MCPs

    Reviews

    3.5 (2)
    Avatar
    user_vdtiClYz
    2025-04-16

    As a dedicated user of mpc applications, I highly recommend the mpc-csharp-semantickernel by mrazvanalex. This tool, available on GitHub, is a robust solution for semantic analysis in C#. Its efficient and intuitive features make it an indispensable asset for any developer working with natural language processing. The project's repository is well-documented and easy to navigate, ensuring a smooth integration into your workflow. Definitely worth checking out!

    Avatar
    user_ChfvAY3a
    2025-04-16

    I've been using mpc-csharp-semantickernel by mrazvanalex and it's been a game changer! This C# semantic kernel library has made complex calculations and data manipulations so much easier and more efficient for my projects. Highly recommend checking it out at https://github.com/mrazvanalex/mpc-csharp-semantickernel.