mcp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 3 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var DefaultMCPConfig = mcp.DefaultMCPConfig

DefaultMCPConfig returns the default MCP configuration.

View Source
var NewAuthHandler = mcp.NewAuthHandler

NewAuthHandler creates a new authentication handler.

View Source
var NewNotificationSender = mcp.NewNotificationSender

NewNotificationSender creates a new notification sender.

View Source
var NewRateLimiter = mcp.NewRateLimiter

NewRateLimiter creates a new rate limiter.

View Source
var NewStateChangeDetector = mcp.NewStateChangeDetector

NewStateChangeDetector creates a new state change detector.

View Source
var NewSubscriptionManager = mcp.NewSubscriptionManager

NewSubscriptionManager creates a new subscription manager.

View Source
var SanitizeInput = mcp.SanitizeInput

SanitizeInput sanitizes user input.

View Source
var ValidateResourceURI = mcp.ValidateResourceURI

ValidateResourceURI validates a resource URI.

View Source
var ValidateToolParams = mcp.ValidateToolParams

ValidateToolParams validates tool parameters.

Functions

func EnableWithMCP

func EnableWithMCP(config *Config) (*devtools.DevTools, error)

EnableWithMCP enables devtools with MCP server integration.

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 ClearResult

type ClearResult = mcp.ClearResult

ClearResult contains clear operation results.

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 Config

type Config = mcp.Config

Config holds MCP server configuration.

type EventsResource

type EventsResource = mcp.EventsResource

EventsResource provides event inspection resources.

type ExportParams

type ExportParams = mcp.ExportParams

ExportParams configures data export.

type ExportResult

type ExportResult = mcp.ExportResult

ExportResult contains export results.

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 RateLimiter

type RateLimiter = mcp.RateLimiter

RateLimiter limits request rates per client.

type RefInfo

type RefInfo = mcp.RefInfo

RefInfo contains information about a ref.

type SearchComponentsParams

type SearchComponentsParams = mcp.SearchComponentsParams

SearchComponentsParams configures component search.

type SearchComponentsResult

type SearchComponentsResult = mcp.SearchComponentsResult

SearchComponentsResult contains search results.

type Server

type Server = mcp.Server

Server is the MCP server instance.

func NewMCPServer

func NewMCPServer(config *Config, dt *devtools.DevTools) (*Server, error)

NewMCPServer creates a new MCP server.

type SetRefResult

type SetRefResult = mcp.SetRefResult

SetRefResult contains set ref 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 Throttler

type Throttler = mcp.Throttler

Throttler throttles update notifications.

func NewThrottler

func NewThrottler(minInterval time.Duration) (*Throttler, error)

NewThrottler creates a new throttler.

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.

Jump to

Keyboard shortcuts

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