mcp
mcp guides you through building or consuming Model Context Protocol servers and clients in .NET using the official C# SDK. It covers package selection, transport configuration (stdio for local processes, HTTP for remote endpoints), and capability negotiation patterns. Use this skill when you need protocol interoperability; reach for other tools if you only need model abstraction or agent orchestration without the MCP wire protocol.
mcp helps you build or consume Model Context Protocol servers and clients in .NET using the official C# SDK.
AI-generated summary based on this skill's SKILL.md
Install
managedcode/dotnet-skills/mcp · repository language: C#
git clone https://github.com/managedcode/dotnet-skills
cp -r dotnet-skills/catalog/Libraries/MCP/skills/mcp ~/.claude/skills/mcpnpx skillfed install managedcode/dotnet-skills/mcpFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I build an MCP server in .NET?
mcp provides the official C# SDK for building Model Context Protocol servers. Start by adding the ModelContextProtocol.Core package, then instantiate a server, register your tools, resources, and prompts using the SDK's fluent API, and choose your transport: stdio for spawning as a child process or HTTP for remote endpoints. The SDK handles protocol negotiation and capability advertisement automatically.
What's the difference between stdio vs HTTP transport in MCP?
mcp supports both transport modes. Stdio transport runs your MCP server as a child process with bidirectional communication over standard streams—ideal for local, tightly-coupled deployments. HTTP transport exposes your server as a remote endpoint with streaming support, enabling distributed architectures and session resumption. Choose stdio for simplicity and HTTP when you need scalability or cross-machine connectivity.
Can I expose tools, resources, and prompts via MCP?
Yes. mcp's C# SDK lets you expose tools (callable functions), resources (data artifacts), and prompts (reusable instruction templates) through the Model Context Protocol. Register each capability type on your server instance, and mcp handles discovery and capability negotiation so clients can discover and invoke them according to their supported features.
How do I connect a .NET application to an MCP server?
mcp enables you to build MCP clients that discover and consume remote or local servers. Create an MCP client, connect it to your server's transport endpoint (stdio process or HTTP URL), perform capability negotiation, and integrate discovered tools into IChatClient workflows. The SDK abstracts transport details so your code works uniformly across deployment modes.
What does MCP capability negotiation and auth in C# involve?
mcp supports capability-aware flows where clients and servers exchange supported features during handshake. The SDK provides patterns for implementing authentication and authorization checks, negotiating which tools and resources are available based on client permissions, and handling capability mismatches gracefully. This ensures secure, interoperable protocol interactions.
Can I run an MCP server in ASP.NET Core over HTTP?
Yes. mcp supports HTTP transport for MCP servers deployed in ASP.NET Core. Map MCP protocol endpoints in your middleware, configure streaming for session resumption, and use the SDK's HTTP transport layer to handle incoming client connections. This approach scales better than stdio for multi-client scenarios and integrates cleanly with your existing ASP.NET infrastructure.
SKILL.md
rendered from the published skill — quoted content, verbatim
MCP C# SDK for .NET
Trigger On
- building or consuming MCP servers from a .NET application or library
- choosing between stdio and HTTP transport for MCP
- exposing tools, resources, prompts, completions, or logging to an MCP host
- connecting a .NET app to an existing MCP server and passing discovered tools into
IChatClient - bootstrapping a minimal MCP client/server from the
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 4 files
catalog/Libraries/MCP/skills/mcp/SKILL.md
catalog/Libraries/MCP/skills/mcp/manifest.json
catalog/Libraries/MCP/skills/mcp/references/patterns.md
catalog/Libraries/MCP/skills/mcp/references/security.md