Model Context Protocol .NET Template

by NikiforovAll

26 stars
391 downloads
Not rated
GitHub Website

About

This repository contains a template for creating a Model Context Protocol (MCP) applications in .NET.

Details

Author
NikiforovAll
GitHub stars
26
Downloads
391
Categories
Developer Tools

- Four templates: mcp-server, mcp-server-http, mcp-server-http-auth, and mcp-server-hybrid
- Supports both Stdio and HTTP transport modes
- Automatic tool discovery with WithToolsFromAssembly()
- Can be packaged and distributed as a global .NET tool
- Integrates with Aspire hosting for cloud-native scenarios

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Model Context Protocol .NET Template
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the template using dotnet new install Nall.ModelContextProtocol.Template, then create a new project with commands like dotnet new mcp-server -o MyProject -n MyProject. The generated code registers tools marked with the [McpServerTool] attribute automatically. Build and run locally, or distribute as a .NET tool.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "model context protocol .net template": {
            "mcp-template-dotnet": {
                "command": "npx",
                "args": [
                    "@modelcontextprotocol/inspector",
                    "-e",
                    "DOTNET_ENVIRONMENT=Production",
                    "dotnet",
                    "$(PWD)/Artefacts/MyAwesomeMCPServer.dll"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-template-dotnet": {
        "command": "npx",
        "args": [
            "@modelcontextprotocol/inspector",
            "-e",
            "DOTNET_ENVIRONMENT=Production",
            "dotnet",
            "$(PWD)/Artefacts/MyAwesomeMCPServer.dll"
        ]
    }
}

Model Context Protocol .NET Template

<p align="center">
MCP Logo
</p>

<p align="center">
<strong>A protocol for seamless integration between LLM applications and external data sources</strong>
</p>

<p align="center">
<a href="https://modelcontextprotocol.io">Documentation</a> |
<a href="https://spec.modelcontextprotocol.io">Specification</a> |
<a href="https://github.com/orgs/modelcontextprotocol/discussions">Discussions</a>
</p>

This repository contains a template for creating a Model Context Protocol (MCP) application in .NET. It provides a basic structure and example code to help you get started with building your own MCP-enabled applications.

| Package | Version | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| Nall.ModelContextProtocol.Template | Nuget | Templates |
| Nall.ModelContextProtocol.Inspector.Aspire.Hosting | Nuget | Aspire Hosting Integration |

Getting Started

Install:

```bash
dotnet new install Nall.ModelContextProtocol.Template

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.