MCPToolkit

v1.0.0Developer Toolsstable

Lightweight, fast, NativeAOT compatible MCP (Model Context Protocol) framework for .NET

mcptoolkitmcpai-integration
Share:
33
Stars
0
Downloads
0
Weekly
0/5

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

Build MCP servers with a lightweight, fast, NativeAOT-compatible .NET framework.
Deploy high-performance MCP integrations in resource-constrained environments.
nuskey8

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedJan 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y mcptoolkit

Manual Installation

npx -y mcptoolkit

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

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 MyMcpServer
2

Add the McpToolkit.Server NuGet package

Install the server package from NuGet. For building an MCP client instead, use McpToolkit.Client.

dotnet add package McpToolkit.Server
3

Implement 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());
4

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-x64
5

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

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": { "mcptoolkit": { "command": "npx", "args": ["-y", "mcptoolkit"] } } }

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

Read the full setup guide →

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.

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