Skip to content

peidaqi/mcp-csharp-minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Model Context Protocol (MCP) Client/Server examples using the Official C# MCP SDK


The Model Context Protocol (MCP) is an open standard developed by Anthropic to enable seamless integration between Large Language Models (LLMs) and external tools, services, and data sources.

Since release, it has gained a lot of popularity and has greatly expanded the capabilities for AI tools such as Cursor and Cline.

Although the official MCP C# SDK has been released, the examples provided are a bit complex and can be overwhelming for beginners.

This repository offers two minimal client/server examples to help you get started quickly and easily.

Projects Overview

There are two methods to implement MCP:

  • HTTP
    Communicates remotely or through localhost using Streamable HTTP or Server-Sent Events(SSE). SSE is now deprecated.
  • Stdio
    Communicates locally by starting the server as a child process of client, and exchange data over stdio pipe.

Details can be found here.

This repository includes minimal implementations for both methods:

http-server
Minimal MCP server implementation using Streamable HTTP. This works with http-client

stdio-server
Minimal MCP server implementation using Stdio. This works with stdio-client

The Server can either be tested with the Client or using the official MCP Inspector.

About

Minimal MCP Client/Server examples using the Official C# MCP SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

close