ModelContextProtocol.NET logo

ModelContextProtocol.NET

by salty-flower

ModelContextProtocol.NET is a C# SDK implementation of the Model Context Protocol (MCP). It provides a framework for building servers that can communicate using the MCP protocol.

View on GitHub

Last updated: N/A

What is ModelContextProtocol.NET?

ModelContextProtocol.NET is a C# SDK that implements the Model Context Protocol (MCP), enabling the creation of servers that can communicate using the MCP protocol. It offers a framework for tool integration and supports various communication methods.

How to use ModelContextProtocol.NET?

To use ModelContextProtocol.NET, install the server package and optionally the hosting package. Configure the server with desired tools, logging, and transport (e.g., Standard I/O). You can either host it directly or integrate it with the .NET generic host. See the documentation and examples for detailed usage.

Key features of ModelContextProtocol.NET

  • Standard I/O Communication

  • Tool Integration Framework

  • Native AOT Compatible

  • Calculator Demo Implementation

Use cases of ModelContextProtocol.NET

  • Creating servers that interact with tools using the Model Context Protocol

  • Building applications that require a standardized communication protocol for exchanging model context information

  • Integrating with existing systems that support the Model Context Protocol

  • Developing command-line tools that can be controlled remotely

FAQ from ModelContextProtocol.NET

What is the Model Context Protocol?

The README doesn't define MCP. Please refer to external documentation.

Is WebSocket support available?

WebSocket support is currently under development.

How do I configure logging?

Use Microsoft.Extensions.Logging.ILogger and configure a logging provider. If using stdio, configure a provider that writes to a destination other than the console.

How do I implement tools?

Implement tools as handlers, providing a JsonTypeInfo for parameter types for NativeAOT compatibility. You can implement a handler class or supply a function directly.

Where can I find more documentation?

More documentation and implementation guides are coming soon.