EA

elbruno/aspire.mcp.sample

Developer tools

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

48 stars 20 forks 品質 44 トレンド 13MIT

elbruno/aspire.mcp.sample は [https://github.com/elbruno/aspire.mcp.sample.] からインポートされた MCP サーバーの候補です

概要

elbruno/aspire.mcp.sample は [https://github.com/elbruno/aspire.mcp.sample.] からインポートされた MCP サーバーの候補です

概要(AI 翻訳)

MCP のサンプル AspireでサーバーとMCPクライアント

概要

このサンプルは、モデルコンテキストプロトコル(MCP)サーバーとクライアントの設定をAspireで実証します。 構造化されたAspire環境でC#を使用して、MCP通信の確立と管理方法を紹介します。

クイックデモ

この5分のビデオ概要をチェックして、プロジェクトの動作を確認します。

この5分のビデオ概要をチェックして、Azure にソリューションを展開する方法、および Visual Studio コードから Azure にデプロイされた MCP Server を消費する方法を参照してください。

##特徴

-Aspireインテグレーション: コンテナ化されたオーケストレーションとサービス管理のためにAspireを使用します。 -MCP Server: クライアント通信を管理するためにMCPサーバーを実装します。

  • MCP クライアント: MCP サーバーとの接続と通信方法を示すサンプル ブレザー チャット クライアント。
  • モデル選択: チャットクライアントは、Azure AI Foundry、Ollama、GitHubモデルからLLMを使用できます。 選択したモデルは、MCP サーバ関数を呼び出すことができる関数をサポートしなければなりません。
  • 機能呼出し: 選択したモデルを使用してMCPサーバーから関数を呼び出す方法について説明します。
  • ツール結果: チャットインターフェイスで関数呼び出しの結果を表示します.

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

README

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

Aspire.MCP.Sample

Sample MCP Server and MCP client using Aspire.

Overview

This sample demonstrates a Model Context Protocol (MCP) Server and client setup using Aspire. It showcases how to establish and manage MCP communication, using C# in a structured Aspire environment.

Quick Demo

Check out this 5-minute video overview to see the project in action.

Check out this 5-minute video overview to see how to deploy the solution to Azure, and how to consume the deployed MCP Server in Azure from Visual Studio Code.

Features

  • Aspire Integration: Uses Aspire for containerized orchestration and service management.
  • MCP Server: Implements an MCP server to manage client communication.
  • MCP Client: Sample Blazor Chat client demonstrating how to connect and communicate with the MCP server.
  • Model Selection: The Chat Client can use LLMs from Azure AI Foundry, Ollama or GitHub models. The selected model must support function calling to be able to call the MCP server functions.
  • Function Calling: Demonstrates how to call functions from the MCP server using the selected model.
  • Tool Result: Displays the result of the function call in the chat interface.
  • Azure Deployment: The project can be easily deployed to Azure using azd commands.

Getting Started

Prerequisites

  • .NET SDK 9.0 or later
  • Visual Studio 2022 or Visual Studio code
  • LLM or SLM that supports function calling.
    • Azure AI Foundry to run models in the cloud. IE: gpt-4o-mini
    • GitHub Models to run models in the cloud. IE: gpt-4o-mini
    • Ollama for running local models. Suggested: phi4-mini, llama3.2 or Qwq

Run locally

  1. Clone the repository:

  2. Navigate to the Aspire project directory:

    cd .\src\McpSample.AppHost\
    
  3. Run the project:

    dotnet run
    
  4. In the Aspire Dashboard, navigate to the Blazor Chat client project.

  5. In the Chat Settings page, define the model to be used. You choose to use models in Azure AI Foundry (suggested gpt-4o-mini), GitHub Models or locally with ollama (suggested llama3.2)

  6. Now you can chat with the model. Everytime that one of the functions of the MCP server is called, the Tool Result section will be displayed in the chat.

Architecture Diagram

GitHub Codespaces

(WIP)

  • Codespaces configuration will be added soon.

Deployment

GitHub で README 全文を見る

インストール

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

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