Documentation
¶
Overview ¶
Package mcp provides Model Context Protocol (MCP) server integration for BubblyUI DevTools.
The MCP server enables remote state inspection, component manipulation, and real-time debugging through the Model Context Protocol. It supports rate limiting, authentication, batching, and subscription-based updates.
This package is an alias for github.com/newbpydev/bubblyui/pkg/bubbly/devtools/mcp, providing a cleaner import path for users.
Features ¶
- Remote state inspection and manipulation
- Component search and filtering
- Event filtering and export
- Performance monitoring
- Rate limiting and authentication
- Real-time subscription updates
- HTTP and stdio transports
Example ¶
import "github.com/newbpydev/bubblyui/devtools/mcp"
func main() {
config := mcp.DefaultMCPConfig()
dt, err := mcp.EnableWithMCP(config)
if err != nil {
log.Fatal(err)
}
defer dt.Shutdown()
}
Index ¶
- Variables
- func EnableWithMCP(config *Config) (*devtools.DevTools, error)
- type AuthHandler
- type ClearEventLogParams
- type ClearResult
- type ClearStateHistoryParams
- type ComponentMatch
- type ComponentsResource
- type ComputedInfo
- type Config
- type EventsResource
- type ExportParams
- type ExportResult
- type FilterEventsParams
- type FilterEventsResult
- type FlushHandler
- type NotificationSender
- type PerformanceResource
- type PerformanceSummary
- type RateLimiter
- type RefInfo
- type SearchComponentsParams
- type SearchComponentsResult
- type Server
- type SetRefResult
- type SetRefValueParams
- type StateChangeDetector
- type StateResource
- type Subscription
- type SubscriptionManager
- type Throttler
- type TransportType
- type UpdateBatcher
- type UpdateNotification
Constants ¶
This section is empty.
Variables ¶
var DefaultMCPConfig = mcp.DefaultMCPConfig
DefaultMCPConfig returns the default MCP configuration.
var NewAuthHandler = mcp.NewAuthHandler
NewAuthHandler creates a new authentication handler.
var NewNotificationSender = mcp.NewNotificationSender
NewNotificationSender creates a new notification sender.
var NewRateLimiter = mcp.NewRateLimiter
NewRateLimiter creates a new rate limiter.
var NewStateChangeDetector = mcp.NewStateChangeDetector
NewStateChangeDetector creates a new state change detector.
var NewSubscriptionManager = mcp.NewSubscriptionManager
NewSubscriptionManager creates a new subscription manager.
var SanitizeInput = mcp.SanitizeInput
SanitizeInput sanitizes user input.
var ValidateResourceURI = mcp.ValidateResourceURI
ValidateResourceURI validates a resource URI.
var ValidateToolParams = mcp.ValidateToolParams
ValidateToolParams validates tool parameters.
Functions ¶
Types ¶
type AuthHandler ¶
type AuthHandler = mcp.AuthHandler
AuthHandler handles authentication for MCP requests.
type ClearEventLogParams ¶
type ClearEventLogParams = mcp.ClearEventLogParams
ClearEventLogParams configures event log clearing.
type ClearStateHistoryParams ¶
type ClearStateHistoryParams = mcp.ClearStateHistoryParams
ClearStateHistoryParams configures state history clearing.
type ComponentMatch ¶
type ComponentMatch = mcp.ComponentMatch
ComponentMatch represents a matched component.
type ComponentsResource ¶
type ComponentsResource = mcp.ComponentsResource
ComponentsResource provides component inspection resources.
type ComputedInfo ¶
type ComputedInfo = mcp.ComputedInfo
ComputedInfo contains information about a computed value.
type EventsResource ¶
type EventsResource = mcp.EventsResource
EventsResource provides event inspection resources.
type FilterEventsParams ¶
type FilterEventsParams = mcp.FilterEventsParams
FilterEventsParams configures event filtering.
type FilterEventsResult ¶
type FilterEventsResult = mcp.FilterEventsResult
FilterEventsResult contains filter results.
type FlushHandler ¶
type FlushHandler = mcp.FlushHandler
FlushHandler handles batched update flushes.
type NotificationSender ¶
type NotificationSender = mcp.NotificationSender
NotificationSender sends notifications to subscribers.
type PerformanceResource ¶
type PerformanceResource = mcp.PerformanceResource
PerformanceResource provides performance monitoring resources.
type PerformanceSummary ¶
type PerformanceSummary = mcp.PerformanceSummary
PerformanceSummary contains performance summary data.
type SearchComponentsParams ¶
type SearchComponentsParams = mcp.SearchComponentsParams
SearchComponentsParams configures component search.
type SearchComponentsResult ¶
type SearchComponentsResult = mcp.SearchComponentsResult
SearchComponentsResult contains search results.
type SetRefValueParams ¶
type SetRefValueParams = mcp.SetRefValueParams
SetRefValueParams configures ref value setting.
type StateChangeDetector ¶
type StateChangeDetector = mcp.StateChangeDetector
StateChangeDetector detects state changes for notifications.
type StateResource ¶
type StateResource = mcp.StateResource
StateResource provides state inspection resources.
type Subscription ¶
type Subscription = mcp.Subscription
Subscription represents a client subscription.
type SubscriptionManager ¶
type SubscriptionManager = mcp.SubscriptionManager
SubscriptionManager manages client subscriptions.
type TransportType ¶
type TransportType = mcp.TransportType
TransportType specifies the transport protocol.
type UpdateBatcher ¶
type UpdateBatcher = mcp.UpdateBatcher
UpdateBatcher batches update notifications.
func NewUpdateBatcher ¶
func NewUpdateBatcher(flushInterval time.Duration, maxBatchSize int) (*UpdateBatcher, error)
NewUpdateBatcher creates a new update batcher.
type UpdateNotification ¶
type UpdateNotification = mcp.UpdateNotification
UpdateNotification represents an update notification.