mcp

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP    = "http"
	FILE    = "file"
	BUILTIN = "builtin"

	FUNCTION = "function"
	SINK     = "sink"
	SOURCE   = "source"

	PublicTenant     = "public"
	DefaultNamespace = "default"
)
View Source
const DefaultKafkaPort = 9093
View Source
const (
	DefaultPulsarPort = 6651
)

Variables

View Source
var (
	ServerlessPoolMemberList = []ServerlessPoolMember{
		{
			Provider:  "azure",
			Namespace: "streamnative",
			Pool:      "shared-azure",
			Location:  "eastus",
		},
		{
			Provider:  "aws",
			Namespace: "streamnative",
			Pool:      "shared-aws",
			Location:  "us-east-2",
		},
	}
	AvailableProviders = []string{"azure", "aws", "gcloud"}
)
View Source
var FunctionConnectorList = []string{"sink", "source", "function", "kafka-connect"}
View Source
var McpContextOrganization *string
View Source
var McpContextPulsarCluster *string
View Source
var McpContextPulsarInstance *string

Functions

func GetExternalKafkaServerInstructions

func GetExternalKafkaServerInstructions(bootstrapServers string) string

func GetExternalPulsarServerInstructions

func GetExternalPulsarServerInstructions(webServiceURL string) string

func GetMcpContext

func GetMcpContext() (string, string, string)

GetMcpContext returns the currently configured StreamNative Cloud context. If the context has not been fully configured, it returns empty strings.

func GetStreamNativeCloudServerInstructions

func GetStreamNativeCloudServerInstructions(userName string, snConfig *config.SnConfig) string

func IsPackageURLSupported added in v0.1.4

func IsPackageURLSupported(functionPkgURL string) bool

func KafkaAdminAddGroupsTools

func KafkaAdminAddGroupsTools(s *server.MCPServer, readOnly bool, features []string)

func KafkaAdminAddKafkaConnectTools

func KafkaAdminAddKafkaConnectTools(s *server.MCPServer, readOnly bool, features []string)

func KafkaAdminAddPartitionsTools

func KafkaAdminAddPartitionsTools(s *server.MCPServer, readOnly bool, features []string)

func KafkaAdminAddSchemaRegistryTools

func KafkaAdminAddSchemaRegistryTools(s *server.MCPServer, readOnly bool, features []string)

func KafkaAdminAddTopicTools

func KafkaAdminAddTopicTools(s *server.MCPServer, readOnly bool, features []string)

func KafkaClientAddConsumeTools

func KafkaClientAddConsumeTools(s *server.MCPServer, _ bool, logrusLogger *logrus.Logger, features []string)

KafkaClientAddConsumeTools adds Kafka client consume tools to the MCP server

func KafkaClientAddProduceTools

func KafkaClientAddProduceTools(s *server.MCPServer, readOnly bool, features []string)

KafkaClientAddProduceTools adds Kafka client produce tools to the MCP server

func PulsarAdminAddBrokerStatsTools

func PulsarAdminAddBrokerStatsTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddBrokerStatsTools adds broker-stats related tools to the MCP server

func PulsarAdminAddBrokersTools

func PulsarAdminAddBrokersTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddBrokersTools adds broker-related tools to the MCP server

func PulsarAdminAddClusterTools

func PulsarAdminAddClusterTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddClusterTools adds cluster-related tools to the MCP server

func PulsarAdminAddFunctionsTools

func PulsarAdminAddFunctionsTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddFunctionsTools adds a unified function-related tool to the MCP server

func PulsarAdminAddFunctionsWorkerTools

func PulsarAdminAddFunctionsWorkerTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddFunctionsWorkerTools adds functions worker-related tools to the MCP server

func PulsarAdminAddNamespacePolicyTools

func PulsarAdminAddNamespacePolicyTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddNamespacePolicyTools adds namespace policy-related tools to the MCP server

func PulsarAdminAddNamespaceTools

func PulsarAdminAddNamespaceTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddNamespaceTools adds namespace-related tools to the MCP server

func PulsarAdminAddNsIsolationPolicyTools

func PulsarAdminAddNsIsolationPolicyTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddNsIsolationPolicyTools adds namespace isolation policy related tools to the MCP server

func PulsarAdminAddPackagesTools

func PulsarAdminAddPackagesTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddPackagesTools adds package-related tools to the MCP server

func PulsarAdminAddResourceQuotasTools

func PulsarAdminAddResourceQuotasTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddResourceQuotasTools adds resource quotas-related tools to the MCP server

func PulsarAdminAddSchemasTools

func PulsarAdminAddSchemasTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddSchemasTools adds schema-related tools to the MCP server

func PulsarAdminAddSinksTools

func PulsarAdminAddSinksTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddSinksTools adds a unified sink-related tool to the MCP server

func PulsarAdminAddSourcesTools

func PulsarAdminAddSourcesTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddSourcesTools adds a unified source-related tool to the MCP server

func PulsarAdminAddSubscriptionTools

func PulsarAdminAddSubscriptionTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddSubscriptionTools adds subscription-related tools to the MCP server

func PulsarAdminAddTenantTools

func PulsarAdminAddTenantTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddTenantTools adds tenant-related tools to the MCP server

func PulsarAdminAddTopicPolicyTools

func PulsarAdminAddTopicPolicyTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddTopicPolicyTools adds topic policy-related tools to the MCP server

func PulsarAdminAddTopicTools

func PulsarAdminAddTopicTools(s *server.MCPServer, readOnly bool, features []string)

PulsarAdminAddTopicTools adds topic-related tools to the MCP server

func PulsarClientAddConsumerTools

func PulsarClientAddConsumerTools(s *server.MCPServer, _ bool, features []string)

PulsarClientAddConsumerTools adds Pulsar client consumer tools to the MCP server

func PulsarClientAddProducerTools

func PulsarClientAddProducerTools(s *server.MCPServer, _ bool, features []string)

PulsarClientAddProducerTools adds Pulsar client producer tools to the MCP server

func PulsarFunctionManagedMcpTools added in v0.1.9

func PulsarFunctionManagedMcpTools(s *server.MCPServer, readOnly bool, features []string)

func RegisterContextTools

func RegisterContextTools(s *server.MCPServer, features []string)

func RegisterPrompts

func RegisterPrompts(s *server.MCPServer)

func ResetContext

func ResetContext()

func ResetMcpContext

func ResetMcpContext()

func SetContext

func SetContext(options *config.Options, instanceName, clusterName string) error

func SetMcpContext

func SetMcpContext(instance, cluster, organization string)

func StopAllPulsarFunctionManagers added in v0.1.9

func StopAllPulsarFunctionManagers()

func StreamNativeAddLogTools

func StreamNativeAddLogTools(s *server.MCPServer, _ bool, features []string)

StreamNativeAddLogTools adds log tools

func StreamNativeAddResourceTools added in v0.1.4

func StreamNativeAddResourceTools(s *server.MCPServer, readOnly bool, features []string)

StreamNativeAddResourceTools adds StreamNative resources tools

Types

type Feature

type Feature string
const (
	FeatureAll                          Feature = "all"
	FeatureAllKafka                     Feature = "all-kafka"
	FeatureAllPulsar                    Feature = "all-pulsar"
	FeatureKafkaClient                  Feature = "kafka-client"
	FeatureKafkaAdmin                   Feature = "kafka-admin"
	FeatureKafkaAdminSchemaRegistry     Feature = "kafka-admin-schema-registry"
	FeatureKafkaAdminKafkaConnect       Feature = "kafka-admin-kafka-connect"
	FeaturePulsarAdmin                  Feature = "pulsar-admin"
	FeaturePulsarAdminBrokersStatus     Feature = "pulsar-admin-brokers-status"
	FeaturePulsarAdminBrokers           Feature = "pulsar-admin-brokers"
	FeaturePulsarAdminClusters          Feature = "pulsar-admin-clusters"
	FeaturePulsarAdminFunctions         Feature = "pulsar-admin-functions"
	FeaturePulsarAdminNamespaces        Feature = "pulsar-admin-namespaces"
	FeaturePulsarAdminTenants           Feature = "pulsar-admin-tenants"
	FeaturePulsarAdminTopics            Feature = "pulsar-admin-topics"
	FeaturePulsarAdminFunctionsWorker   Feature = "pulsar-admin-functions-worker"
	FeaturePulsarAdminSinks             Feature = "pulsar-admin-sinks"
	FeaturePulsarAdminSources           Feature = "pulsar-admin-sources"
	FeaturePulsarAdminNamespacePolicy   Feature = "pulsar-admin-namespace-policy"
	FeaturePulsarAdminNsIsolationPolicy Feature = "pulsar-admin-ns-isolation-policy"
	FeaturePulsarAdminPackages          Feature = "pulsar-admin-packages"
	FeaturePulsarAdminResourceQuotas    Feature = "pulsar-admin-resource-quotas"
	FeaturePulsarAdminSchemas           Feature = "pulsar-admin-schemas"
	FeaturePulsarAdminSubscriptions     Feature = "pulsar-admin-subscriptions"
	FeaturePulsarAdminTopicPolicy       Feature = "pulsar-admin-topic-policy"
	FeaturePulsarClient                 Feature = "pulsar-client"
	FeatureStreamNativeCloud            Feature = "streamnative-cloud"
	FeatureFunctionsAsTools             Feature = "functions-as-tools"
)

type LogContent

type LogContent struct {
	Message  string `json:"message"`
	Position int64  `json:"position"`
	Record   int64  `json:"record"`
}

type LogOptions

type LogOptions struct {
	ServiceURL      string
	Organization    string
	Instance        string
	Cluster         string
	Component       string
	Name            string
	PulsarTenant    string
	PulsarNamespace string
	Size            string
	Since           string
	Timestamp       string
	Follow          bool

	Previous                     bool
	InsecureSkipTLSVerifyBackend bool
	// contains filtered or unexported fields
}

type LogResult

type LogResult struct {
	Total int          `json:"total"`
	Data  []LogContent `json:"data"`
}

type Metadata added in v0.1.4

type Metadata struct {
	Name      string            `json:"name" yaml:"name"`
	Namespace string            `json:"namespace" yaml:"namespace"`
	Labels    map[string]string `json:"labels" yaml:"labels"`
}

type Resource added in v0.1.4

type Resource struct {
	APIVersion string                 `json:"apiVersion" yaml:"apiVersion"`
	Kind       string                 `json:"kind" yaml:"kind"`
	Metadata   Metadata               `json:"metadata" yaml:"metadata"`
	Spec       map[string]interface{} `json:"spec" yaml:"spec"`
}

Define simple resource structure for parsing YAML documents

type ServerlessPoolMember added in v0.1.4

type ServerlessPoolMember struct {
	Provider  string
	Namespace string
	Pool      string
	Location  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL