Model Context Protocol Net

v1.0.0Developer Toolsstable

MCP server for modelcontextprotocol net

modelcontextprotocol-netmcpai-integration
Share:
80
Stars
0
Downloads
0
Weekly
0/5

What is Model Context Protocol Net?

Model Context Protocol Net is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for modelcontextprotocol net

MCP server for modelcontextprotocol net

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

Features

  • MCP server for modelcontextprotocol net

Use Cases

Access and integrate with modelcontextprotocol.net services.
salty-flower

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx modelcontextprotocol-net

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 Model Context Protocol Net

ModelContextProtocol.NET is a C# SDK that lets .NET developers build MCP servers natively, without Node.js or Python. It provides a strongly-typed tool integration framework with stdio transport, native AOT compatibility, and optional ASP.NET Core hosting — enabling teams that work in C# to expose custom tools, resources, and prompts to Claude and other MCP-compatible AI clients using idiomatic .NET patterns.

Prerequisites

  • .NET 8 SDK or later installed (dotnet CLI available)
  • A .NET project in which to add the MCP server (console app or ASP.NET Core app)
  • NuGet access to install the ModelContextProtocol.NET packages (currently prerelease)
  • An MCP-compatible client such as Claude Desktop to test the server
1

Create a new .NET console project

Create a new console application that will host your MCP server. You can skip this step if adding to an existing project.

dotnet new console -n MyMcpServer
cd MyMcpServer
2

Install the ModelContextProtocol.NET NuGet packages

Add the core server package. If you want ASP.NET Core generic host integration (dependency injection, configuration, logging), also add the Hosting package.

dotnet add package ModelContextProtocol.NET.Server --prerelease
dotnet add package ModelContextProtocol.NET.Server.Hosting --prerelease
3

Define your MCP server and tools

In Program.cs, create the server builder, configure stdio transport, and register your tool handlers. Note: when using stdio transport, do not log to the console — configure a file or provider-based logger instead.

using ModelContextProtocol.NET.Server;

var serverInfo = new Implementation { Name = "My MCP Server", Version = "1.0.0" };
var builder = new McpServerBuilder(serverInfo)
    .AddStdioTransport()
    .AddTool<MyToolHandler>();

var server = builder.Build();
await server.StartAsync();
4

Implement a tool handler

Create a handler class that implements your tool logic. Each handler declares the tool name, description, and input schema. Parameters need JsonTypeInfo for Native AOT compatibility.

public class MyToolHandler : IToolHandler
{
    public string Name => "my_tool";
    public string Description => "Does something useful";

    public Task<CallToolResult> HandleAsync(JsonElement arguments, CancellationToken ct)
    {
        var input = arguments.GetProperty("input").GetString();
        return Task.FromResult(new CallToolResult("Result: " + input));
    }
}
5

Build and configure your MCP client

Build the project with 'dotnet build' and publish it. Then add the compiled binary to your MCP client configuration pointing to the executable path.

dotnet build -c Release
# Output binary path: bin/Release/net8.0/MyMcpServer
6

Add the server to your MCP client config

Register the compiled .NET executable in claude_desktop_config.json. The server communicates over stdio so no port configuration is needed.

{
  "mcpServers": {
    "my-dotnet-server": {
      "command": "/absolute/path/to/bin/Release/net8.0/MyMcpServer",
      "args": []
    }
  }
}

Model Context Protocol Net Examples

Client configuration

Example claude_desktop_config.json for a compiled ModelContextProtocol.NET server binary running over stdio transport.

{
  "mcpServers": {
    "my-dotnet-mcp": {
      "command": "/Users/you/MyMcpServer/bin/Release/net8.0/MyMcpServer",
      "args": []
    }
  }
}

Prompts to try

Once your custom tools are registered, test them with prompts that match the tools you exposed.

- "Use my_tool with input 'hello world' and show me the result"
- "List all available tools in the connected MCP server"
- "Call the calculator tool to compute 142 * 37"

Troubleshooting Model Context Protocol Net

Server crashes silently when logs are written to stdout

MCP stdio transport uses stdout for protocol messages. Any Console.Write/WriteLine calls will corrupt the protocol stream. Configure logging to use a file, Serilog file sink, or NLog file target instead of the console.

Native AOT build fails with JSON serialization errors

Native AOT requires explicit JsonTypeInfo for all parameter types. Use System.Text.Json source generation by adding [JsonSerializable] attributes to your type context and passing the generated JsonTypeInfo when registering tool parameter schemas.

Package not found — prerelease version unavailable

Run 'dotnet add package ModelContextProtocol.NET.Server --prerelease' explicitly. If nuget.org access is blocked, add 'https://api.nuget.org/v3/index.json' to your NuGet.Config sources. Check the GitHub releases page for the latest prerelease version tag.

Frequently Asked Questions about Model Context Protocol Net

What is Model Context Protocol Net?

Model Context Protocol Net is a Model Context Protocol (MCP) server that mcp server for modelcontextprotocol net It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Model Context Protocol Net?

Follow the installation instructions on the Model Context Protocol Net GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Model Context Protocol Net?

Model Context Protocol Net works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Model Context Protocol Net free to use?

Yes, Model Context Protocol Net 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": { "modelcontextprotocol-net": { "command": "npx", "args": ["-y", "modelcontextprotocol-net"] } } }

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

Read the full setup guide →

Ready to use Model Context Protocol Net?

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