MCP .NET Client Server

v1.0.0Developer Toolsstable

This project demonstrates a Model Context Protocol (MCP) server and client implementation in .NET

mcp-client-server-for-agentsmcpai-integration
Share:
12
Stars
0
Downloads
0
Weekly
0/5

What is MCP .NET Client Server?

MCP .NET Client Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this project demonstrates a model context protocol (mcp) server and client implementation in .net

This project demonstrates a Model Context Protocol (MCP) server and client implementation in .NET

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • This project demonstrates a Model Context Protocol (MCP) ser

Use Cases

Implement MCP client-server communication in .NET.
qmatteoq

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedOct 20, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-client-server-for-agents

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP .NET Client Server

MCP .NET Client Server is a reference implementation demonstrating Model Context Protocol server and client communication in .NET, built around a vacation-day management use case. It supports both stdio transport (console-based) and SSE/HTTP Streaming transport using .NET Aspire, Blazor, and Semantic Kernel. Developers use it as a starting point for building production MCP integrations in C# or TypeScript, or to learn how MCP tools are exposed and consumed across different transport layers.

Prerequisites

  • .NET SDK 9.0 or later installed on your machine
  • Node.js (if running the TypeScript variant of the sample)
  • Visual Studio Code with the Azurite extension (for Table Storage emulation)
  • Azure OpenAI credentials if running the SSE sample (AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT)
  • An MCP-compatible client such as Claude Desktop, VS Code AI Toolkit, or a custom app
1

Clone the repository

Clone the sample project to your local machine so you have both the C# and TypeScript versions available.

git clone https://github.com/qmatteoq/MCP-Client-Server-for-agents.git
cd MCP-Client-Server-for-agents
2

Start the Azurite Table Storage emulator

Open the project in VS Code and start the Azurite Table Service emulator via the status bar button or the command palette (Ctrl+Shift+P → 'Azurite: Start Table Service'). This emulates the Azure Table Storage used to persist vacation data.

3

Run the stdio server (.NET)

Navigate to the Stdio folder and start the .NET console server. Any MCP client can connect by pointing to this command and arguments.

dotnet run --project src/csharp/Stdio/MCP.Stdio.Server/MCP.Stdio.Server.csproj
4

Configure your MCP client

Add the server to your MCP client configuration using the dotnet run command as the server process. The server exposes tools for listing employees, querying vacation balances, and charging vacation days.

{
  "mcpServers": {
    "mcp-dotnet-sample": {
      "command": "dotnet",
      "args": ["run", "--project", "/path/to/src/csharp/Stdio/MCP.Stdio.Server/MCP.Stdio.Server.csproj"]
    }
  }
}
5

(Optional) Run the SSE sample with Blazor frontend

For the full HTTP Streaming demo with a Blazor UI, update appsettings.json with your Azure OpenAI connection string, then start the Aspire host. A browser window opens showing the dashboard.

# Update appsettings.json openAiConnectionName first, then:
dotnet run --project MCP.SSE.AppHost/MCP.SSE.AppHost.csproj
6

Build the TypeScript server (optional)

If you prefer the TypeScript variant of the stdio server, install dependencies and build before running.

cd src/ts/stdio/server
npm install
npm run build

MCP .NET Client Server Examples

Client configuration (stdio, .NET)

MCP client config pointing to the .NET stdio server for vacation management tools.

{
  "mcpServers": {
    "mcp-dotnet-sample": {
      "command": "dotnet",
      "args": ["run", "--project", "/path/to/src/csharp/Stdio/MCP.Stdio.Server/MCP.Stdio.Server.csproj"]
    }
  }
}

Prompts to try

Example prompts that exercise the vacation-management MCP tools exposed by the server.

- "Give me a list of all employees and their remaining vacation days"
- "How many vacation days does Alice Johnson have left?"
- "Charge 5 vacation days to Alice Johnson"
- "Show the vacation balances for the entire engineering team"

Troubleshooting MCP .NET Client Server

Server fails to start with a storage error

Make sure the Azurite Table Service emulator is running in VS Code before starting the server. Check the Azurite output panel for errors.

TypeScript server not found after build

Ensure you ran 'npm run build' inside src/ts/stdio/server and that the compiled output exists at src/ts/stdio/server/dist/app.js before pointing your MCP client to it.

SSE sample browser page shows no data

Verify the openAiConnectionName in appsettings.json is set to a valid Azure OpenAI connection string in the format: Endpoint=https://<endpoint>.openai.azure.com/;Key=<key>

Frequently Asked Questions about MCP .NET Client Server

What is MCP .NET Client Server?

MCP .NET Client Server is a Model Context Protocol (MCP) server that this project demonstrates a model context protocol (mcp) server and client implementation in .net It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP .NET Client Server?

Follow the installation instructions on the MCP .NET Client Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP .NET Client Server?

MCP .NET Client Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP .NET Client Server free to use?

Yes, MCP .NET Client Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-client-server-for-agents": { "command": "npx", "args": ["-y", "mcp-client-server-for-agents"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP .NET Client Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides