mcpserver

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(opts Options) *mcp.Server

func RequireBearerToken

func RequireBearerToken(token string, next http.Handler) http.Handler

RequireBearerToken enforces a static bearer token for MCP endpoints. It is intentionally simple and should be replaced by stronger auth over time.

Types

type AssignmentInfo

type AssignmentInfo struct {
	Topic      string  `json:"topic"`
	Partitions []int32 `json:"partitions"`
}

type BrokerOutput

type BrokerOutput struct {
	NodeID int32  `json:"node_id"`
	Host   string `json:"host"`
	Port   int32  `json:"port"`
}

type ClusterMetricsOutput

type ClusterMetricsOutput struct {
	S3State                 string  `json:"s3_state"`
	S3LatencyMS             int     `json:"s3_latency_ms"`
	ProduceRPS              float64 `json:"produce_rps"`
	FetchRPS                float64 `json:"fetch_rps"`
	AdminRequestsTotal      float64 `json:"admin_requests_total"`
	AdminRequestErrorsTotal float64 `json:"admin_request_errors_total"`
	AdminRequestLatencyMS   float64 `json:"admin_request_latency_ms"`
	ObservedAt              string  `json:"observed_at"`
}

type ClusterStatusOutput

type ClusterStatusOutput struct {
	ClusterName  string         `json:"cluster_name,omitempty"`
	ClusterID    string         `json:"cluster_id,omitempty"`
	ControllerID int32          `json:"controller_id"`
	Brokers      []BrokerOutput `json:"brokers"`
	Topics       []TopicSummary `json:"topics"`
	S3           S3Status       `json:"s3"`
	Etcd         ComponentState `json:"etcd"`
	ObservedAt   string         `json:"observed_at"`
}

type ComponentState

type ComponentState struct {
	State string `json:"state"`
}

type FetchOffsetsInput

type FetchOffsetsInput struct {
	GroupID string   `json:"group_id" jsonschema:"Consumer group identifier"`
	Topics  []string `json:"topics,omitempty" jsonschema:"Optional list of topics to fetch offsets for. Omit to fetch offsets for every topic."`
}

type FetchOffsetsOutput

type FetchOffsetsOutput struct {
	GroupID string          `json:"group_id"`
	Offsets []OffsetDetails `json:"offsets"`
}

type GroupDetails

type GroupDetails struct {
	GroupID            string          `json:"group_id"`
	State              string          `json:"state"`
	ProtocolType       string          `json:"protocol_type"`
	Protocol           string          `json:"protocol"`
	Leader             string          `json:"leader"`
	GenerationID       int32           `json:"generation_id"`
	RebalanceTimeoutMS int32           `json:"rebalance_timeout_ms"`
	Members            []MemberDetails `json:"members"`
	Offsets            []OffsetDetails `json:"offsets"`
}

type GroupInput

type GroupInput struct {
	GroupID string `json:"group_id" jsonschema:"Consumer group identifier"`
}

type GroupSummary

type GroupSummary struct {
	GroupID      string `json:"group_id"`
	State        string `json:"state"`
	ProtocolType string `json:"protocol_type"`
	MemberCount  int    `json:"member_count"`
}

type GroupSummaryList

type GroupSummaryList struct {
	Groups []GroupSummary `json:"groups"`
}

type MemberDetails

type MemberDetails struct {
	MemberID         string           `json:"member_id"`
	ClientID         string           `json:"client_id"`
	ClientHost       string           `json:"client_host"`
	HeartbeatAt      string           `json:"heartbeat_at"`
	Assignments      []AssignmentInfo `json:"assignments"`
	Subscriptions    []string         `json:"subscriptions"`
	SessionTimeoutMS int32            `json:"session_timeout_ms"`
}

type OffsetDetails

type OffsetDetails struct {
	Topic     string `json:"topic"`
	Partition int32  `json:"partition"`
	Offset    int64  `json:"offset"`
	Metadata  string `json:"metadata"`
}

type Options

type Options struct {
	Store   metadata.Store
	Metrics console.MetricsProvider
	Logger  *log.Logger
	Version string
}

type PartitionDetails

type PartitionDetails struct {
	Partition       int32   `json:"partition"`
	LeaderID        int32   `json:"leader_id"`
	LeaderEpoch     int32   `json:"leader_epoch"`
	ReplicaNodes    []int32 `json:"replica_nodes"`
	ISRNodes        []int32 `json:"isr_nodes"`
	OfflineReplicas []int32 `json:"offline_replicas"`
	ErrorCode       int16   `json:"error_code"`
}

type S3Status

type S3Status struct {
	State     string `json:"state"`
	LatencyMS int    `json:"latency_ms"`
}

type TopicConfigInput

type TopicConfigInput struct {
	Topics []string `json:"topics,omitempty" jsonschema:"Optional list of topics to describe. Omit to describe every topic."`
}

type TopicConfigList

type TopicConfigList struct {
	Configs []TopicConfigOutput `json:"configs"`
}

type TopicConfigOutput

type TopicConfigOutput struct {
	Name              string            `json:"name"`
	Exists            bool              `json:"exists"`
	Partitions        int32             `json:"partitions"`
	ReplicationFactor int32             `json:"replication_factor"`
	RetentionMS       int64             `json:"retention_ms"`
	RetentionBytes    int64             `json:"retention_bytes"`
	SegmentBytes      int64             `json:"segment_bytes"`
	CreatedAt         string            `json:"created_at"`
	Config            map[string]string `json:"config"`
}

type TopicDetail

type TopicDetail struct {
	Name       string             `json:"name"`
	ErrorCode  int16              `json:"error_code"`
	Partitions []PartitionDetails `json:"partitions"`
}

type TopicDetailList

type TopicDetailList struct {
	Topics []TopicDetail `json:"topics"`
}

type TopicNameInput

type TopicNameInput struct {
	Names []string `json:"names,omitempty" jsonschema:"Optional list of topic names to filter. Omit to describe every topic."`
}

type TopicSummary

type TopicSummary struct {
	Name           string `json:"name"`
	PartitionCount int    `json:"partition_count"`
	ErrorCode      int16  `json:"error_code"`
}

type TopicSummaryList

type TopicSummaryList struct {
	Topics []TopicSummary `json:"topics"`
}

Jump to

Keyboard shortcuts

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