Skip to main content
Any Framework

MSBuild SDK for .NET 10 file-based MCP servers (stdio transport).

Published
May 25, 2026
4mo ago
Total Downloads
1.5K
1,531

Install

dotnet add package Cadenza.Mcp --version 1.0.7

No framework information available.

README

Cadenza.Mcp

Read this in 한국어.

Cadenza.Mcp is the MCP-server variant of the Cadenza SDK family — a single-file scripting MSBuild SDK that wraps the official ModelContextProtocol C# SDK (maintained jointly by Anthropic and Microsoft).

Quick start

Create a server.cs file:

#!/usr/bin/env dotnet run
#:sdk [email protected]

Tool("read_file", "Read a UTF-8 text file from disk",
    (string path) => ReadText(path));

Tool("list_files", "List files matching a glob pattern",
    (string pattern) => Glob(pattern).ToArray());

await Run();

Run iteratively:

dotnet run server.cs

Register with Claude Desktop (or another MCP client) by adding to its config:

{
  "mcpServers": {
    "cadenza-files": {
      "command": "dotnet",
      "args": ["run", "/absolute/path/to/server.cs"]
    }
  }
}

Publish as a self-contained single binary:

dotnet publish server.cs -r linux-x64 -c Release

Important: stdout is owned by the protocol

Stdio MCP servers carry JSON-RPC over stdout, so the System.Console bare names (WriteLine, Write, ReadLine) are intentionally not part of the Cadenza.Mcp Tier 1 surface. Writing to stdout from user code corrupts the protocol stream and disconnects the client. Use the Log.* helpers for diagnostics — they route through ILogger to stderr.

See the project repository for the full specification, security boundary notes, and additional samples.

Changes from Previous Version

No structural changes between v1.0.6 and v1.0.7.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.