# Aspire MCP Sample

> Sample MCP Server and MCP client with Aspire

- **Type:** MCP server
- **Install:** `agentstack add mcp-elbruno-aspire-mcp-sample`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [elbruno](https://agentstack.voostack.com/s/elbruno)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [elbruno](https://github.com/elbruno)
- **Source:** https://github.com/elbruno/Aspire.MCP.Sample
- **Website:** https://aka.ms/aspiremcp/repo

## Install

```sh
agentstack add mcp-elbruno-aspire-mcp-sample
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

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

[](https://www.youtube.com/watch?v=2holzbob1_I)

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.

[](https://www.youtube.com/watch?v=subvIWlrzu4)

## 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](https://ai.azure.com) to run models in the cloud. IE: gpt-4o-mini
  - [GitHub Models](https://github.com/marketplace?type=models) to run models in the cloud. IE: gpt-4o-mini
  - [Ollama](https://ollama.com/) for running local models. Suggested: phi4-mini, llama3.2 or Qwq

### Run locally

1. Clone the repository:

1. Navigate to the Aspire project directory:

   ```bash
   cd .\src\McpSample.AppHost\
   ```

1. Run the project:

   ```bash
   dotnet run
   ```

1. In the Aspire Dashboard, navigate to the Blazor Chat client project.

    

1. 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)

    

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

Once you've opened the project in [Codespaces](#github-codespaces), or [locally](#run-locally), you can deploy it to Azure.

From a Terminal window, open the folder with the clone of this repo and run the following commands.

1. Login to Azure:

    ```shell
    azd auth login
    ```

1. Provision and deploy all the resources:

    ```shell
    azd up
    ```

    It will prompt you to provide an `azd` environment name (like "aspiremcp"), select a subscription from your Azure account, and select a location.

1. When `azd` has finished deploying, you'll see the list of resources created in Azure and a set of URIs in the command output.

1. Visit the **blazorchat** URI, and you should see the **MCP Chat App**! 🎉

***Note:** The deploy files are located in the `./src/McpSample.AppHost/infra/` folder. They are generated by the `Aspire AppHost` project.*

## Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

## License

This project is licensed under the MIT License.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [elbruno](https://github.com/elbruno)
- **Source:** [elbruno/Aspire.MCP.Sample](https://github.com/elbruno/Aspire.MCP.Sample)
- **License:** MIT
- **Homepage:** https://aka.ms/aspiremcp/repo

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-elbruno-aspire-mcp-sample
- Seller: https://agentstack.voostack.com/s/elbruno
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
