Aspire.MCP.Sample logo

Aspire.MCP.Sample

by elbruno

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.

View on GitHub

Last updated: N/A

What is Aspire.MCP.Sample?

This is a sample MCP Server and client application built using Aspire. It demonstrates how to set up and manage MCP communication within an Aspire environment.

How to use Aspire.MCP.Sample?

To use this sample, clone the repository, navigate to the Aspire project directory, and run the project using 'dotnet run'. Configure the Blazor Chat client with your desired model (Azure AI Foundry, GitHub Models, or Ollama). You can then interact with the chat interface and observe the 'Tool Result' section when MCP server functions are called. For Azure deployment, use the 'azd' commands.

Key features of Aspire.MCP.Sample

  • Aspire Integration

  • MCP Server

  • MCP Client

  • Model Selection

  • Function Calling

  • Azure Deployment

Use cases of Aspire.MCP.Sample

  • Demonstrating MCP communication

  • Learning Aspire integration

  • Building chat applications with function calling

  • Deploying Aspire applications to Azure

FAQ from Aspire.MCP.Sample

What is MCP?

MCP stands for Model Context Protocol.

What is Aspire?

Aspire is a framework for building cloud-native applications.

What models can be used with the Chat Client?

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.

How do I deploy this to Azure?

Use the 'azd up' command after logging in with 'azd auth login'.

Where are the deployment files located?

The deploy files are located in the ./src/McpSample.AppHost/infra/ folder.