Skip to content

gRPC Plugins

The GRPCPlugin kind allows you to integrate external tools or services that implement a gRPC interface. This is useful for long-running services, or when you want to implement plugins in languages other than Go while maintaining a high-performance communication channel.

Unlike External Plugins which run as subprocesses for each execution, gRPC plugins typically run as standalone services (e.g., in a separate container) that swcat connects to over the network.

Configuration

gRPC plugins are configured in plugins.yml.

Field Type Description
address string Required. The host:port of the gRPC plugin server.
config map Arbitrary key-value pairs passed to the plugin in the ExecuteRequest.

Example:

plugins:
  my-grpc-plugin:
    kind: GRPCPlugin
    spec:
      address: "localhost:50051"
      config:
        threshold: 0.8
        mode: "analyze"

Protocol

The gRPC service must implement the PluginService defined in plugin.proto.

Service Definition

service PluginService {
  // Execute runs a plugin for a specific entity.
  rpc Execute(ExecuteRequest) returns (ExecuteResponse) {}
}

See the proto file for the full message definitions of ExecuteRequest and ExecuteResponse.

Implementation Example

A reference implementation in Java is available in extensions/grpc/. This example demonstrates how to set up a gRPC server that implements the PluginService.


Build Your Own

The gRPC interface makes it easy to write custom plugins in any language. By implementing your own plugin, you can integrate internal tools, proprietary APIs, or specialized data sources directly into your software catalog.


Tip

For details on how to visualize the annotations generated by plugins, see Custom Content.