MCP .NET Implementation
A fully featured C# implementation of Anthropic's Model Context Protocol (MCP)
What is MCP .NET Implementation?
MCP .NET Implementation is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to fully featured c# implementation of anthropic's model context protocol (mcp)
A fully featured C# implementation of Anthropic's Model Context Protocol (MCP)
This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A fully featured C# implementation of Anthropic's Model Cont
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-netConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP .NET Implementation
Mcp.Net is a fully featured C#/.NET implementation of Anthropic's Model Context Protocol, providing a complete SDK for building both MCP servers and clients in the .NET ecosystem. It supports dual transports (stdio for CLI tools and SSE for web applications), exposes a clean builder pattern API for registering tools, resources, and prompts, and ships with a working LLM demo that connects to OpenAI or Anthropic models. .NET developers use it to embed MCP server capabilities into existing C# applications or to build standalone MCP servers that integrate with Claude Desktop and other MCP clients.
Prerequisites
- .NET 8 SDK or higher installed
- An Anthropic or OpenAI API key (required only for the LLM interactive demo)
- Visual Studio 2022, VS Code with C# extension, or JetBrains Rider
- An MCP-compatible client such as Claude Desktop for testing servers
Add the Mcp.Net NuGet packages
Add the server and/or client packages to your .NET project. The Server package is needed to build an MCP server; the Client package is needed to connect to one.
dotnet add package Mcp.Net.Server
dotnet add package Mcp.Net.ClientBuild a minimal MCP server
Use the McpServerBuilder to register tools and select a transport. The following creates a stdio server with a single calculator tool suitable for Claude Desktop integration.
var builder = new McpServerBuilder()
.WithName("MyServer")
.UseStdioTransport();
builder.AddTool("multiply", "Multiplies two numbers",
(double a, double b) => a * b);
await builder.Build().RunAsync();Run the example server
Clone the repository and run the included SimpleServer example to verify your environment works before writing custom code.
git clone https://github.com/SamFold/Mcp.Net.git
cd Mcp.Net
dotnet run --project Mcp.Net.Examples.SimpleServer/Mcp.Net.Examples.SimpleServer.csprojConfigure optional server settings
For SSE/HTTP transport, configure host, port, and scheme either via appsettings.json or environment variables. These are only needed if you are not using stdio.
{
"Server": {
"Port": 8080,
"Hostname": "0.0.0.0",
"Scheme": "http"
}
}Connect Claude Desktop to your server
Add the compiled .NET server binary to claude_desktop_config.json. Build your project first with `dotnet publish`, then reference the output executable.
{
"mcpServers": {
"mcp-net-example": {
"command": "/path/to/publish/MyMcpServer",
"args": []
}
}
}MCP .NET Implementation Examples
Client configuration
Example claude_desktop_config.json using a published .NET MCP server binary via stdio transport.
{
"mcpServers": {
"mcp-net-example": {
"command": "/usr/local/bin/MyMcpServer",
"args": [],
"env": {}
}
}
}Prompts to try
Example prompts once a .NET MCP server built with Mcp.Net is connected to your AI client.
- "Multiply 47 by 83 using the calculator tool"
- "List all available resources on the connected MCP server"
- "Run the weather lookup tool for New York City"
- "Show me the available prompt templates from the MCP server"Troubleshooting MCP .NET Implementation
Server exits immediately when launched from Claude Desktop
Ensure you are using stdio transport (UseStdioTransport()) and that the published binary is a self-contained executable. Run the binary directly from a terminal first to see any startup errors.
SSE transport not reachable from MCP client
Verify MCP_SERVER_PORT and MCP_SERVER_HOSTNAME environment variables are set correctly, or configure them in appsettings.json. Ensure no firewall blocks the configured port.
Tool registration causes duplicate name exceptions
Each tool name must be unique within a server. If you are composing multiple modules, prefix tool names with a module identifier (e.g., "weather_lookup" vs "db_lookup") to avoid collisions.
Frequently Asked Questions about MCP .NET Implementation
What is MCP .NET Implementation?
MCP .NET Implementation is a Model Context Protocol (MCP) server that fully featured c# implementation of anthropic's model context protocol (mcp) It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP .NET Implementation?
Follow the installation instructions on the MCP .NET Implementation GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP .NET Implementation?
MCP .NET Implementation works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP .NET Implementation free to use?
Yes, MCP .NET Implementation is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP .NET Implementation Alternatives โ Similar APIs Servers
Looking for alternatives to MCP .NET Implementation? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
โ 43.4k๐ฆ The API and AI Gateway
API Mega List
โ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHubโperiod. ๐ช
Fetch
โ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
โ 2.1kSelf-Hosted API Management for Builders
Korean Law
โ 1.8k๊ตญ๊ฐ๋ฒ๋ น์ ๋ณดMCP v4.0 | ๋ฒ์ ์ฒ 41๊ฐ API โ 17๊ฐ MCP ๋๊ตฌ. ๋ฒ๋ นยทํ๋กยท์กฐ๋ก ๊ฒ์ + LLM ํ๊ฐ ๋ฐฉ์ง ์ธ์ฉ๊ฒ์ฆ + ์กฐ๋ฌธ ์ํฅ ๊ทธ๋ํ(impact_map) + ์์ ๋น๊ต ์๋ diff(time_travel) + ์๋ฏผ 5๋จ๊ณ ์คํ ๊ฐ์ด๋(action_plan) | 41 Korean legal APIs โ 17 MCP tools
RuleGo
โ 1.5kโ๏ธRuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP .NET Implementation in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP .NET Implementation?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.