Aspire.MCP.Sample MCP Server

Sample MCP Server and MCP client with Aspire

Local serverstdio

What is the Aspire.MCP.Sample MCP Server?

Sample MCP Server and MCP client with Aspire

What the server does

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.

  • 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

Credentials and setup notes

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Configuration

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

Example prompts to try

  • “Use Aspire.MCP.Sample to Prerequisites.”

Frequently asked questions

You need .NET SDK 9.0 or later, Visual Studio 2022 or Visual Studio Code, and an LLM/SLM that supports function calling (Azure AI Foundry, GitHub Models, or Ollama).