Documentation
¶
Overview ¶
Package mcp contains core MCP server integrations and tools.
Index ¶
- Constants
- Variables
- func AddOpts(opts ...server.ServerOption) []server.ServerOption
- func GetExternalKafkaServerInstructions(bootstrapServers string) string
- func GetExternalPulsarServerInstructions(webServiceURL string) string
- func GetKafkaSession(ctx context.Context) *kafka.Session
- func GetPulsarSession(ctx context.Context) *pulsar.Session
- func GetSNCloudCluster(ctx context.Context) string
- func GetSNCloudInstance(ctx context.Context) string
- func GetSNCloudOrganization(ctx context.Context) string
- func GetSNCloudSession(ctx context.Context) *config.Session
- func GetStreamNativeCloudServerInstructions(userName string, snConfig *config.SnConfig) string
- func HandleListPulsarClusters(ctx context.Context, _ mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
- func IsPackageURLSupported(functionPkgURL string) bool
- func KafkaAdminAddGroupsTools(s *server.MCPServer, readOnly bool, features []string)
- func KafkaAdminAddKafkaConnectTools(s *server.MCPServer, readOnly bool, features []string)
- func KafkaAdminAddPartitionsTools(s *server.MCPServer, readOnly bool, features []string)
- func KafkaAdminAddSchemaRegistryTools(s *server.MCPServer, readOnly bool, features []string)
- func KafkaAdminAddTopicTools(s *server.MCPServer, readOnly bool, features []string)
- func KafkaClientAddConsumeTools(s *server.MCPServer, _ bool, logrusLogger *logrus.Logger, features []string)
- func KafkaClientAddProduceTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddBrokerStatsTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddBrokersTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddClusterTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddFunctionsTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddFunctionsWorkerTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddNamespacePolicyTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddNamespaceTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddNsIsolationPolicyTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddPackagesTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddResourceQuotasTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddSchemasTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddSinksTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddSourcesTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddSubscriptionTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddTenantTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddTopicPolicyTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminAddTopicTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarAdminClusterTools(readOnly bool, features []string) []server.ServerTool
- func PulsarAdminFunctionsWorkerTools(readOnly bool, features []string) []server.ServerTool
- func PulsarAdminNamespaceTools(readOnly bool, features []string) []server.ServerTool
- func PulsarAdminSchemaTools(readOnly bool, features []string) []server.ServerTool
- func PulsarAdminSubscriptionTools(readOnly bool, features []string) []server.ServerTool
- func PulsarAdminTopicTools(readOnly bool, features []string) []server.ServerTool
- func PulsarClientAddConsumerTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarClientAddProducerTools(s *server.MCPServer, readOnly bool, features []string)
- func PulsarClientConsumeTools(readOnly bool, features []string) []server.ServerTool
- func PulsarClientProduceTools(readOnly bool, features []string) []server.ServerTool
- func RegisterContextTools(s *server.MCPServer, features []string, skipContextTools bool)
- func RegisterPrompts(s *server.MCPServer)
- func SetContext(ctx context.Context, options *config.Options, instanceName, clusterName string) error
- func StopAllPulsarFunctionManagers()
- func StreamNativeAddLogTools(s *server.MCPServer, _ bool, features []string)
- func StreamNativeAddResourceTools(s *server.MCPServer, readOnly bool, features []string)
- func WithKafkaSession(ctx context.Context, session *kafka.Session) context.Context
- func WithPulsarSession(ctx context.Context, session *pulsar.Session) context.Context
- func WithSNCloudCluster(ctx context.Context, cluster string) context.Context
- func WithSNCloudInstance(ctx context.Context, instance string) context.Context
- func WithSNCloudOrganization(ctx context.Context, organization string) context.Context
- func WithSNCloudSession(ctx context.Context, session *config.Session) context.Context
- type Feature
- type LogContent
- type LogOptions
- type LogResult
- type Metadata
- type Resource
- type Server
- type ServerlessPoolMember
Constants ¶
const ( // HTTP represents the HTTP package URL scheme. HTTP = "http" // FILE represents the file package URL scheme. FILE = "file" // BUILTIN represents the builtin package scheme. BUILTIN = "builtin" // FUNCTION represents a function package type. FUNCTION = "function" // SINK represents a sink package type. SINK = "sink" // SOURCE represents a source package type. SOURCE = "source" // PublicTenant is the default public tenant name. PublicTenant = "public" // DefaultNamespace is the default namespace name. DefaultNamespace = "default" )
const DefaultKafkaPort = 9093
DefaultKafkaPort is the default Kafka port for StreamNative Cloud.
const (
// DefaultPulsarPort is the default Pulsar protocol port.
DefaultPulsarPort = 6651
)
Variables ¶
var ( // ServerlessPoolMemberList defines the supported serverless pools. ServerlessPoolMemberList = []ServerlessPoolMember{ { Provider: "azure", Namespace: "streamnative", Pool: "shared-azure", Location: "eastus", }, { Provider: "aws", Namespace: "streamnative", Pool: "shared-aws", Location: "us-east-2", }, } // AvailableProviders lists supported cloud providers. AvailableProviders = []string{"azure", "aws", "gcloud"} )
var FunctionConnectorList = []string{"sink", "source", "function", "kafka-connect"}
FunctionConnectorList lists supported log components.
Functions ¶
func AddOpts ¶ added in v0.1.11
func AddOpts(opts ...server.ServerOption) []server.ServerOption
AddOpts merges default server options with custom options.
func GetExternalKafkaServerInstructions ¶
GetExternalKafkaServerInstructions renders instructions for external Kafka.
func GetExternalPulsarServerInstructions ¶
GetExternalPulsarServerInstructions renders instructions for external Pulsar.
func GetKafkaSession ¶ added in v0.1.11
GetKafkaSession gets the Kafka session from the context
func GetPulsarSession ¶ added in v0.1.11
GetPulsarSession gets the Pulsar session from the context
func GetSNCloudCluster ¶ added in v0.1.11
GetSNCloudCluster gets the SNCloud cluster from the context
func GetSNCloudInstance ¶ added in v0.1.11
GetSNCloudInstance gets the SNCloud instance from the context
func GetSNCloudOrganization ¶ added in v0.1.11
GetSNCloudOrganization gets the SNCloud organization from the context
func GetSNCloudSession ¶ added in v0.1.11
GetSNCloudSession gets the SNCloud session from the context
func GetStreamNativeCloudServerInstructions ¶
GetStreamNativeCloudServerInstructions renders instructions for StreamNative Cloud.
func HandleListPulsarClusters ¶ added in v0.1.11
func HandleListPulsarClusters(ctx context.Context, _ mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
HandleListPulsarClusters handles listing StreamNative Cloud clusters.
func IsPackageURLSupported ¶ added in v0.1.4
IsPackageURLSupported reports whether the package URL scheme is supported.
func KafkaAdminAddGroupsTools ¶
KafkaAdminAddGroupsTools registers Kafka admin group tools.
func KafkaAdminAddKafkaConnectTools ¶
KafkaAdminAddKafkaConnectTools registers Kafka Connect admin tools.
func KafkaAdminAddPartitionsTools ¶
KafkaAdminAddPartitionsTools registers Kafka admin partition tools.
func KafkaAdminAddSchemaRegistryTools ¶
KafkaAdminAddSchemaRegistryTools registers Kafka Schema Registry tools.
func KafkaAdminAddTopicTools ¶
KafkaAdminAddTopicTools registers Kafka admin topic tools.
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 ¶
KafkaClientAddProduceTools adds Kafka client produce tools to the MCP server
func PulsarAdminAddBrokerStatsTools ¶
PulsarAdminAddBrokerStatsTools adds broker-stats related tools to the MCP server
func PulsarAdminAddBrokersTools ¶
PulsarAdminAddBrokersTools adds broker-related tools to the MCP server
func PulsarAdminAddClusterTools ¶
PulsarAdminAddClusterTools adds cluster-related tools to the MCP server
func PulsarAdminAddFunctionsTools ¶
PulsarAdminAddFunctionsTools adds a unified function-related tool to the MCP server
func PulsarAdminAddFunctionsWorkerTools ¶
PulsarAdminAddFunctionsWorkerTools adds functions worker-related tools to the MCP server
func PulsarAdminAddNamespacePolicyTools ¶
PulsarAdminAddNamespacePolicyTools adds namespace policy-related tools to the MCP server
func PulsarAdminAddNamespaceTools ¶
PulsarAdminAddNamespaceTools adds namespace-related tools to the MCP server
func PulsarAdminAddNsIsolationPolicyTools ¶
PulsarAdminAddNsIsolationPolicyTools adds namespace isolation policy related tools to the MCP server
func PulsarAdminAddPackagesTools ¶
PulsarAdminAddPackagesTools adds package-related tools to the MCP server
func PulsarAdminAddResourceQuotasTools ¶
PulsarAdminAddResourceQuotasTools adds resource quotas-related tools to the MCP server
func PulsarAdminAddSchemasTools ¶
PulsarAdminAddSchemasTools adds schema-related tools to the MCP server
func PulsarAdminAddSinksTools ¶
PulsarAdminAddSinksTools adds a unified sink-related tool to the MCP server
func PulsarAdminAddSourcesTools ¶
PulsarAdminAddSourcesTools adds a unified source-related tool to the MCP server
func PulsarAdminAddSubscriptionTools ¶
PulsarAdminAddSubscriptionTools adds subscription-related tools to the MCP server
func PulsarAdminAddTenantTools ¶
PulsarAdminAddTenantTools registers Pulsar admin tenant tools.
func PulsarAdminAddTopicPolicyTools ¶
PulsarAdminAddTopicPolicyTools adds topic policy-related tools to the MCP server
func PulsarAdminAddTopicTools ¶
PulsarAdminAddTopicTools adds topic-related tools to the MCP server
func PulsarAdminClusterTools ¶ added in v0.1.11
func PulsarAdminClusterTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminClusterTools creates Pulsar Admin Cluster tool list using the new builder pattern
func PulsarAdminFunctionsWorkerTools ¶ added in v0.1.11
func PulsarAdminFunctionsWorkerTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminFunctionsWorkerTools creates Pulsar Admin Functions Worker tool list using the new builder pattern
func PulsarAdminNamespaceTools ¶ added in v0.1.11
func PulsarAdminNamespaceTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminNamespaceTools creates Pulsar Admin Namespace tool list using the new builder pattern
func PulsarAdminSchemaTools ¶ added in v0.1.11
func PulsarAdminSchemaTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminSchemaTools creates Pulsar Admin Schema tool list using the new builder pattern
func PulsarAdminSubscriptionTools ¶ added in v0.1.11
func PulsarAdminSubscriptionTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminSubscriptionTools creates Pulsar Admin Subscription tool list using the new builder pattern
func PulsarAdminTopicTools ¶ added in v0.1.11
func PulsarAdminTopicTools(readOnly bool, features []string) []server.ServerTool
PulsarAdminTopicTools creates Pulsar Admin Topic tool list using the new builder pattern
func PulsarClientAddConsumerTools ¶
PulsarClientAddConsumerTools adds Pulsar client consumer tools to the MCP server
func PulsarClientAddProducerTools ¶
PulsarClientAddProducerTools adds Pulsar client producer tools to the MCP server
func PulsarClientConsumeTools ¶ added in v0.1.11
func PulsarClientConsumeTools(readOnly bool, features []string) []server.ServerTool
PulsarClientConsumeTools creates Pulsar Client Consumer tool list using the new builder pattern
func PulsarClientProduceTools ¶ added in v0.1.11
func PulsarClientProduceTools(readOnly bool, features []string) []server.ServerTool
PulsarClientProduceTools creates Pulsar Client Producer tool list using the new builder pattern
func RegisterContextTools ¶
RegisterContextTools registers context-related tools on the server.
func RegisterPrompts ¶
RegisterPrompts registers prompt handlers on the server.
func SetContext ¶
func SetContext(ctx context.Context, options *config.Options, instanceName, clusterName string) error
SetContext resolves and stores StreamNative Cloud context in memory.
func StopAllPulsarFunctionManagers ¶ added in v0.1.9
func StopAllPulsarFunctionManagers()
StopAllPulsarFunctionManagers stops and removes all function managers.
func StreamNativeAddLogTools ¶
StreamNativeAddLogTools adds log tools
func StreamNativeAddResourceTools ¶ added in v0.1.4
StreamNativeAddResourceTools adds StreamNative resources tools
func WithKafkaSession ¶ added in v0.1.11
WithKafkaSession sets the Kafka session in the context
func WithPulsarSession ¶ added in v0.1.11
WithPulsarSession sets the Pulsar session in the context
func WithSNCloudCluster ¶ added in v0.1.11
WithSNCloudCluster sets the SNCloud cluster in the context
func WithSNCloudInstance ¶ added in v0.1.11
WithSNCloudInstance sets the SNCloud instance in the context
func WithSNCloudOrganization ¶ added in v0.1.11
WithSNCloudOrganization sets the SNCloud organization in the context
Types ¶
type Feature ¶
type Feature string
Feature represents a named capability flag for MCP tools.
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" )
Feature flags used to register MCP tools.
type LogContent ¶
type LogContent struct {
Message string `json:"message"`
Position int64 `json:"position"`
Record int64 `json:"record"`
}
LogContent represents a single log entry.
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
}
LogOptions captures parameters for StreamNative log queries.
type LogResult ¶
type LogResult struct {
Total int `json:"total"`
Data []LogContent `json:"data"`
}
LogResult represents a log query response.
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"`
}
Metadata holds standard resource metadata.
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"`
}
Resource represents a StreamNative resource manifest.
type Server ¶ added in v0.1.11
type Server struct {
MCPServer *server.MCPServer
KafkaSession *kafka.Session
PulsarSession *pulsar.Session
SNCloudSession *config.Session
// contains filtered or unexported fields
}
Server wraps MCP server state and StreamNative sessions.
func CreateSNCloudMCPServer ¶ added in v0.1.11
CreateSNCloudMCPServer constructs a Server wrapper for StreamNative Cloud.
Source Files
¶
- auth_utils.go
- ctx.go
- features.go
- instructions.go
- kafka_admin_connect_tools.go
- kafka_admin_groups_tools.go
- kafka_admin_partitions_tools.go
- kafka_admin_sr_tools.go
- kafka_admin_topics_tools.go
- kafka_client_consume_tools.go
- kafka_client_produce_tools.go
- prompts.go
- pulsar_admin_brokers_stats_tools.go
- pulsar_admin_brokers_tools.go
- pulsar_admin_cluster_tools.go
- pulsar_admin_functions_tools.go
- pulsar_admin_functions_worker_tools.go
- pulsar_admin_namespace_policy_tools.go
- pulsar_admin_namespace_tools.go
- pulsar_admin_nsisolationpolicy_tools.go
- pulsar_admin_packages_tools.go
- pulsar_admin_resourcequotas_tools.go
- pulsar_admin_schemas_tools.go
- pulsar_admin_sinks_tools.go
- pulsar_admin_sources_tools.go
- pulsar_admin_subscription_tools.go
- pulsar_admin_tenant_tools.go
- pulsar_admin_topic_policy_tools.go
- pulsar_admin_topic_tools.go
- pulsar_client_consume_tools.go
- pulsar_client_produce_tools.go
- pulsar_functions_as_tools.go
- server.go
- sncontext_tools.go
- sncontext_utils.go
- streamnative_resources_log_tools.go
- streamnative_resources_tools.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package builders provides common interfaces and helpers for MCP tool builders.
|
Package builders provides common interfaces and helpers for MCP tool builders. |
|
kafka
Package kafka provides Kafka MCP tool builders.
|
Package kafka provides Kafka MCP tool builders. |
|
pulsar
Package pulsar provides MCP tool builders for Pulsar admin operations.
|
Package pulsar provides MCP tool builders for Pulsar admin operations. |
|
internal
|
|
|
context
Package context provides internal context helpers for MCP sessions.
|
Package context provides internal context helpers for MCP sessions. |
|
Package pftools provides Pulsar Functions tooling for MCP.
|
Package pftools provides Pulsar Functions tooling for MCP. |
|
Package session provides context helpers for MCP session management.
|
Package session provides context helpers for MCP session management. |