A type-safe, functional C# REST client library with compile-time exhaustiveness checking and OpenAPI/MCP code generation.
RestClient.Net is a C# library for making REST API calls with a focus on type safety and functional programming. It provides compile-time exhaustiveness checking through pattern matching on result types, eliminating runtime exceptions for predictable error handling. The library also includes tools to generate type-safe clients and MCP servers from OpenAPI specifications.
C# developers building REST API clients who prioritize type safety, explicit error handling, and modern .NET patterns, particularly those working with OpenAPI specifications or integrating with AI tools like Claude Code via MCP.
Developers choose RestClient.Net for its uncompromising approach to type safety, compile-time guarantees via exhaustiveness checking, and the ability to generate both API clients and MCP servers from OpenAPI specs, reducing boilerplate and runtime errors.
The safest way to make REST calls in C# with an MCP Generator
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates the Exhaustion Roslyn analyzer to enforce exhaustive pattern matching on result types, catching missing cases at build time and preventing runtime crashes, as shown in the README's error example.
Uses Result types like Result<TSuccess, HttpError<TError>> for explicit error handling without exceptions, demonstrated in pattern matching examples for predictable outcomes.
Generates type-safe C# clients and MCP servers from OpenAPI 3.x specs, reducing boilerplate; the README includes examples for both client and server generation.
Works seamlessly with IHttpClientFactory for proper connection pooling and DNS handling, aligning with Microsoft guidelines for HTTP client management.
Supports upload and download progress reporting via ProgressReportingHttpContent, with a code example showing real-time progress updates.
Requires installing the Exhaustion analyzer and Outcome package for full functionality, adding complexity and potential versioning issues to projects.
Necessitates manual type aliases for concise pattern matching unless using the OpenAPI generator, leading to boilerplate code, as illustrated in the usage section.
Upgrading from v6 involves using a polyfill or rewriting code, which can be cumbersome for existing users with large codebases, as noted in the upgrading section.
Embraces functional programming principles that may be unfamiliar to developers used to imperative C#, requiring adaptation and additional learning effort.