plugins/dotnet-blazor/skills/grpc-services/SKILL.md
gRPC service development in .NET for high-performance inter-service communication
npx skillsauth add markus41/claude grpc-servicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
syntax = "proto3";
option csharp_namespace = "MyApp.Grpc";
package catalog;
service CatalogService {
rpc GetProduct (GetProductRequest) returns (ProductResponse);
rpc ListProducts (ListProductsRequest) returns (ListProductsResponse);
rpc CreateProduct (CreateProductRequest) returns (ProductResponse);
rpc StreamProducts (StreamRequest) returns (stream ProductResponse);
}
message GetProductRequest { int32 id = 1; }
message ListProductsRequest {
int32 page = 1;
int32 page_size = 2;
string search = 3;
}
message ListProductsResponse {
repeated ProductResponse products = 1;
int32 total_count = 2;
}
message CreateProductRequest {
string name = 1;
string description = 2;
double price = 3;
}
message ProductResponse {
int32 id = 1;
string name = 2;
string description = 3;
double price = 4;
}
message StreamRequest { string filter = 1; }
public sealed class CatalogGrpcService(ICatalogService catalog, ILogger<CatalogGrpcService> logger)
: CatalogService.CatalogServiceBase
{
public override async Task<ProductResponse> GetProduct(
GetProductRequest request, ServerCallContext context)
{
var product = await catalog.GetByIdAsync(request.Id, context.CancellationToken)
?? throw new RpcException(new Status(StatusCode.NotFound, $"Product {request.Id} not found"));
return MapToResponse(product);
}
public override async Task StreamProducts(
StreamRequest request, IServerStreamWriter<ProductResponse> responseStream, ServerCallContext context)
{
await foreach (var product in catalog.StreamAsync(request.Filter, context.CancellationToken))
{
await responseStream.WriteAsync(MapToResponse(product));
}
}
}
builder.Services.AddGrpc();
app.MapGrpcService<CatalogGrpcService>();
builder.Services.AddGrpcClient<CatalogService.CatalogServiceClient>(o =>
{
o.Address = new("https+http://catalog-api");
})
.AddStandardResilienceHandler();
| Aspect | gRPC | REST/HTTP | |--------|------|----------| | Serialization | Protocol Buffers (binary) | JSON (text) | | Protocol | HTTP/2 | HTTP/1.1 or HTTP/2 | | Payload size | Small, compressed | Larger, human-readable | | Latency | Low (~10x faster) | Higher | | Browser support | Limited (gRPC-Web) | Full | | Code generation | Automatic (contract-first) | Manual | | Streaming | Native, bidirectional | Limited | | Debugging | Binary (harder) | Easy (HTTP tools) | | Use case | Microservices, real-time | Public APIs, browsers |
// Stream of requests → single response
public override async Task<HelloReply> LotsOfGreetings(
IAsyncStreamReader<HelloRequest> requestStream, ServerCallContext context)
{
var count = 0;
await foreach (var request in requestStream.ReadAllAsync())
{
count++;
}
return new HelloReply { Message = $"Processed {count} greetings" };
}
// Stream requests ↔ stream responses simultaneously
public override async Task BidiHello(
IAsyncStreamReader<HelloRequest> requestStream,
IServerStreamWriter<HelloReply> responseStream,
ServerCallContext context)
{
await foreach (var request in requestStream.ReadAllAsync())
{
await responseStream.WriteAsync(new HelloReply
{
Message = $"Echo: {request.Name}"
});
}
}
<!-- .csproj -->
<ItemGroup>
<Protobuf Include="Protos\greet.proto" />
</ItemGroup>
dotnet add package Grpc.AspNetCore
dotnet add package Grpc.Tools
Deadline for request timeouts.proto files to <Protobuf> item group in .csprojtools
Build Teams-native agents with the Teams SDK (formerly Teams AI Library v2) — App class, activity routing, adaptive cards, streaming, AI-generated labels, feedback, message extensions, Teams-as-MCP-server, and the bring-your-own-AI pattern with Agent Framework.
tools
Run agents on Microsoft Foundry (formerly Azure AI Foundry) Agent Service — prompt agents vs hosted agents, threads/runs and the Responses API, built-in tools (Bing grounding, code interpreter, file search, MCP, OpenAPI, A2A), connected agents, Entra agent identity, SDKs, and observability/evaluations.
tools
Build and host custom engine agents with the Microsoft 365 Agents SDK — AgentApplication, the Activity protocol, channel reach via Azure Bot Service, hosting Agent Framework or Semantic Kernel engines, and the Agents Toolkit/Playground workflow. Successor to the Bot Framework SDK.
tools
Design, govern, and extend Microsoft Copilot Studio agents — topics, generative orchestration, knowledge, tools and MCP, agent flows, autonomous triggers, publishing channels, Copilot Credits pricing, and solution-based ALM on Power Platform.