MCPToolkit
Lightweight, fast, NativeAOT compatible MCP (Model Context Protocol) framework for .NET
What is MCPToolkit?
MCPToolkit is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to lightweight, fast, nativeaot compatible mcp (model context protocol) framework for .net
Lightweight, fast, NativeAOT compatible MCP (Model Context Protocol) framework for .NET
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Lightweight, fast, NativeAOT compatible MCP (Model Context P
Use Cases
Maintainer
Works with
Installation
NPM
npx -y mcptoolkitManual Installation
npx -y mcptoolkitConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCPToolkit
McpToolkit is a lightweight, NativeAOT-compatible MCP framework for .NET that lets C# and .NET developers build Model Context Protocol servers and clients with minimal boilerplate, using source generators to automatically derive tool schemas from method signatures. It supports registering tools (functions callable by AI models), resources (URI-addressable data), and reusable prompt templates, and ships with stdio and in-memory transports out of the box. .NET developers who want to expose their business logic or data to AI assistants through the MCP standard — without heavyweight dependencies — will find McpToolkit the most ergonomic path to a production-ready MCP server in the .NET ecosystem.
Prerequisites
- .NET 8 SDK or later installed
- A .NET project (console app recommended for MCP servers)
- NuGet package manager (included with the .NET SDK)
- An MCP client such as Claude Desktop, Cursor, or any agent supporting the Model Context Protocol to test your server
Create a new .NET console project (or use an existing one)
MCP servers built with McpToolkit are typically console applications that read/write on stdio.
dotnet new console -n MyMcpServer
cd MyMcpServerAdd the McpToolkit.Server NuGet package
Install the server package from NuGet. For building an MCP client instead, use McpToolkit.Client.
dotnet add package McpToolkit.ServerImplement your MCP server
Create your server, register tools using lambda expressions or class methods, and connect with the stdio transport. The framework generates JSON schemas for your tool parameters automatically.
using McpToolkit.Server;
using McpToolkit.Server.Transports;
await using var server = new McpServer
{
Name = "MyMcpServer",
Version = "1.0.0"
};
server.Tools.Add("add", "Add two numbers.",
(double lhs, double rhs) => lhs + rhs);
server.Tools.Add("greet", "Greet a user by name.",
(string name) => $"Hello, {name}!");
await server.ConnectAsync(new StdioServerTransport());Build and publish your server
Build the project in release mode. For NativeAOT deployment (smaller binary, faster startup), publish with the NativeAOT runtime identifier.
# Standard build
dotnet build -c Release
# NativeAOT publish (requires native toolchain)
dotnet publish -c Release -r linux-x64Add the server to your MCP client configuration
Register your built server in your MCP client configuration file, pointing to the compiled binary or using 'dotnet run' for development.
{
"mcpServers": {
"my-mcp-server": {
"command": "dotnet",
"args": ["run", "--project", "/absolute/path/to/MyMcpServer/MyMcpServer.csproj"]
}
}
}MCPToolkit Examples
Client configuration (Claude Desktop — dotnet run)
Use this configuration during development to run your McpToolkit server via dotnet run. Replace the path with the absolute path to your .csproj file.
{
"mcpServers": {
"my-mcp-server": {
"command": "dotnet",
"args": [
"run",
"--project",
"/Users/yourname/MyMcpServer/MyMcpServer.csproj"
]
}
}
}Prompts to try
Once your McpToolkit server is running and registered, test it with prompts that invoke your registered tools.
- "Use the add tool to calculate 42 plus 58."
- "Call the greet tool with the name Alice."
- "List all available tools from my local MCP server."
- "What resources are exposed by the server?"Troubleshooting MCPToolkit
The MCP client cannot find or start the server
Ensure the 'dotnet' command is in your system PATH. Run 'dotnet --version' in a terminal to verify .NET 8+ is installed. Use the absolute path to your .csproj in the args array, not a relative path.
NativeAOT publish fails with toolchain errors
NativeAOT compilation requires native build tools: on Windows install Visual Studio with C++ workload; on Linux install clang and zlib-dev; on macOS install Xcode command line tools. McpToolkit is NativeAOT-compatible but the runtime still requires the native toolchain at publish time.
Tool schema is incorrect or parameters are not recognized
McpToolkit uses source generators to derive parameter schemas. Ensure your project has source generators enabled (the default for .NET SDK projects). Complex types may need JsonSerializable attributes if you are using NativeAOT trimming. Check that parameter names and types in your lambda or method signature are what you intend to expose.
Frequently Asked Questions about MCPToolkit
What is MCPToolkit?
MCPToolkit is a Model Context Protocol (MCP) server that lightweight, fast, nativeaot compatible mcp (model context protocol) framework for .net It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCPToolkit?
Install via npm with the command: npx -y mcptoolkit. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with MCPToolkit?
MCPToolkit works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCPToolkit free to use?
Yes, MCPToolkit is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCPToolkit Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCPToolkit? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up MCPToolkit 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 MCPToolkit?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.