mcp

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 31 Imported by: 1 module, 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

This section is empty.

Types

type CancelInspectionInput

type CancelInspectionInput struct {
	InspectionID string `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
}

CancelInspectionInput defines the input parameters for the cancel_inspection tool.

type ChromeTimelineImageRenderer

type ChromeTimelineImageRenderer struct {
	// contains filtered or unexported fields
}

ChromeTimelineImageRenderer renders timelines using a warm headless Chrome page over CDP.

func NewChromeTimelineImageRenderer

func NewChromeTimelineImageRenderer(browser *cdp.Browser, baseURL string) *ChromeTimelineImageRenderer

NewChromeTimelineImageRenderer creates a new ChromeTimelineImageRenderer using the provided CDP Browser and server baseURL.

func (*ChromeTimelineImageRenderer) Close

Close closes the active CDP page client connection.

func (*ChromeTimelineImageRenderer) RenderTimeline

RenderTimeline applies the requested timeline parameters and captures a PNG screenshot.

type CreateInspectionInput

type CreateInspectionInput struct {
	InspectionTypeID string `json:"inspectionTypeId" jsonschema:"The ID of the inspection type to create (for example 'gcp-gke')."`
	Name             string `json:"name,omitempty" jsonschema:"Optional display name for the inspection."`
}

CreateInspectionInput defines the input parameters for the create_inspection tool.

type DomainHandler

type DomainHandler interface {
	Register(srv *mcpsdk.Server)
}

DomainHandler registers tools, resources, and resource templates to an MCP server.

type DryRunInspectionInput

type DryRunInspectionInput struct {
	InspectionID string         `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
	Parameters   map[string]any `` /* 358-byte string literal not displayed */
	FieldID      string         `json:"fieldId,omitempty" jsonschema:"Optional field ID to expand without truncating its suggestions or options."`
}

DryRunInspectionInput defines the input parameters for the dry_run_inspection tool.

type GetLogInput

type GetLogInput struct {
	InspectionID string `json:"inspectionId" jsonschema:"The target inspection ID."`
	LogID        string `json:"logId" jsonschema:"The log ID from search_logs or get_timeline_logs."`
	ByteOffset   int    `` /* 143-byte string literal not displayed */
}

GetLogInput defines the input parameters for the get_log MCP tool.

type GetResourceDiffInput

type GetResourceDiffInput struct {
	InspectionID  string `json:"inspectionId" jsonschema:"The target inspection ID."`
	TimelineID    string `json:"timelineId" jsonschema:"The timeline ID from search_timelines or search_logs."`
	RevisionIndex int    `` /* 137-byte string literal not displayed */
	ByteOffset    int    `` /* 143-byte string literal not displayed */
}

GetResourceDiffInput defines the input parameters for the get_resource_diff MCP tool.

type GetResourceManifestInput

type GetResourceManifestInput struct {
	InspectionID         string     `json:"inspectionId" jsonschema:"The target inspection ID."`
	TimelineID           string     `json:"timelineId" jsonschema:"The timeline ID from search_timelines or search_logs."`
	RevisionIndex        *int       `` /* 129-byte string literal not displayed */
	Time                 *time.Time `` /* 135-byte string literal not displayed */
	ByteOffset           int        `` /* 192-byte string literal not displayed */
	IncludeManagedFields bool       `` /* 175-byte string literal not displayed */
}

GetResourceManifestInput defines the input parameters for the get_resource_manifest MCP tool.

type GetResourceRevisionsInput

type GetResourceRevisionsInput struct {
	InspectionID string     `json:"inspectionId" jsonschema:"The target inspection ID."`
	TimelineID   string     `json:"timelineId" jsonschema:"The timeline ID from search_timelines or search_logs."`
	StartTime    *time.Time `json:"startTime,omitempty" jsonschema:"Inclusive start of the revision time range in RFC3339 format."`
	EndTime      *time.Time `json:"endTime,omitempty" jsonschema:"Inclusive end of the revision time range in RFC3339 format."`
	PageSize     int        `json:"pageSize,omitempty" jsonschema:"Maximum number of revisions per page (default 50, max 500)."`
	PageToken    string     `json:"pageToken,omitempty" jsonschema:"The pageToken value from the last line of the previous response."`
}

GetResourceRevisionsInput defines the input parameters for the get_resource_revisions MCP tool.

type GetTimelineLogsInput

type GetTimelineLogsInput struct {
	InspectionID string                      `json:"inspectionId" jsonschema:"The target inspection ID."`
	TimelineID   string                      `json:"timelineId" jsonschema:"The timeline ID from search_timelines or search_logs."`
	Filter       workbench.TimelineLogFilter `json:"filter,omitempty" jsonschema:"Log CEL and time range filter parameters."`
	PageSize     int                         `json:"pageSize,omitempty" jsonschema:"Maximum number of logs per page (default 50, max 500)."`
	PageToken    string                      `json:"pageToken,omitempty" jsonschema:"The pageToken value from the last line of the previous response."`
}

GetTimelineLogsInput defines the input parameters for the get_timeline_logs MCP tool.

type InspectionHandler

type InspectionHandler struct {
	// contains filtered or unexported fields
}

InspectionHandler exposes inspection types, inspection listing, inspection summaries, and inspection lifecycle tools over MCP.

func NewInspectionHandler

func NewInspectionHandler(server *coreinspection.InspectionTaskServer, uploadURLIssuer *uploadurl.Issuer) *InspectionHandler

NewInspectionHandler creates a new InspectionHandler using the provided InspectionTaskServer. uploadURLIssuer issues the URLs that agents upload files for file form fields to.

func (*InspectionHandler) Register

func (h *InspectionHandler) Register(srv *mcpsdk.Server)

Register registers the inspection resources, resource templates, and tools to the MCP server.

type RenderTimelinesInput

type RenderTimelinesInput struct {
	InspectionID       string           `json:"inspectionId" jsonschema:"The target inspection ID."`
	Filter             workbench.Filter `` /* 253-byte string literal not displayed */
	TimelineIDs        []string         `` /* 163-byte string literal not displayed */
	MaxDepth           int              `json:"maxDepth,omitempty" jsonschema:"Maximum tree depth from root timelines (0-based). 0 means unlimited."`
	MaxNodes           int              `json:"maxNodes,omitempty" jsonschema:"Maximum number of timeline rows to render (default 50, max 150)."`
	Width              int              `json:"width,omitempty" jsonschema:"Rendered image width in pixels (default 1600, min 800, max 3840)."`
	TimezoneShiftHours float64          `json:"timezoneShiftHours,omitempty" jsonschema:"Timezone offset in hours from UTC for the timeline ruler (default 0)."`
}

RenderTimelinesInput defines the input parameters for the render_timelines MCP tool.

type RequestFileUploadInput

type RequestFileUploadInput struct {
	InspectionID string `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
	FieldID      string `json:"fieldId" jsonschema:"The ID of a field with Type: file in the dry_run_inspection result."`
}

RequestFileUploadInput defines the input parameters for the request_file_upload tool.

type RunInspectionInput

type RunInspectionInput struct {
	InspectionID string         `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
	Parameters   map[string]any `` /* 358-byte string literal not displayed */
}

RunInspectionInput defines the input parameters for the run_inspection tool.

type SearchLogsInput

type SearchLogsInput struct {
	InspectionID  string           `json:"inspectionId" jsonschema:"The target inspection ID."`
	Filter        workbench.Filter `` /* 167-byte string literal not displayed */
	MaxTimelines  int              `json:"maxTimelines,omitempty" jsonschema:"Maximum number of linked timelines to return (default 20)."`
	MaxSampleLogs int              `json:"maxSampleLogs,omitempty" jsonschema:"Maximum number of evenly spaced sample logs to return (default 20)."`
}

SearchLogsInput defines the input parameters for the search_logs MCP tool.

type SearchTimelinesInput

type SearchTimelinesInput struct {
	InspectionID string           `json:"inspectionId" jsonschema:"The target inspection ID."`
	Filter       workbench.Filter `` /* 167-byte string literal not displayed */
	MaxDepth     int              `json:"maxDepth,omitempty" jsonschema:"Maximum tree depth from root timelines (0-based). 0 means unlimited."`
	MaxNodes     int              `json:"maxNodes,omitempty" jsonschema:"Maximum number of timeline nodes to return (default 200)."`
}

SearchTimelinesInput defines the input parameters for the search_timelines MCP tool.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps an MCP server with Streamable HTTP and SSE handlers.

func NewServer

func NewServer(handlers ...DomainHandler) *Server

NewServer creates a new Server instance and registers the provided domain handlers.

func (*Server) HTTPHandler

func (s *Server) HTTPHandler() http.Handler

HTTPHandler returns the http.Handler for the Streamable HTTP transport (/mcp).

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(handler DomainHandler)

RegisterHandler registers a domain handler to the underlying MCP server.

func (*Server) SSEHandler

func (s *Server) SSEHandler() http.Handler

SSEHandler returns the http.Handler for the SSE transport (/mcp/sse).

type TimelineImageRenderer

type TimelineImageRenderer interface {
	RenderTimeline(ctx context.Context, req TimelineRenderRequest) (*TimelineRenderResult, error)
	Close() error
}

TimelineImageRenderer renders timeline views into PNG screenshots.

type TimelineRenderRequest

type TimelineRenderRequest struct {
	InspectionID           string   `json:"inspectionId"`
	TimelineQuery          string   `json:"timelineQuery,omitempty"`
	TimelineExclusionQuery string   `json:"timelineExclusionQuery,omitempty"`
	LogQuery               string   `json:"logQuery,omitempty"`
	ExcludeNoLogs          bool     `json:"excludeNoLogs,omitempty"`
	FilterStartTimeNs      string   `json:"filterStartTimeNs,omitempty"`
	FilterEndTimeNs        string   `json:"filterEndTimeNs,omitempty"`
	ViewStartTimeMs        *int64   `json:"viewStartTimeMs,omitempty"`
	ViewEndTimeMs          *int64   `json:"viewEndTimeMs,omitempty"`
	TimelineIDs            []uint32 `json:"timelineIds,omitempty"`
	MaxDepth               int      `json:"maxDepth,omitempty"`
	MaxNodes               int      `json:"maxNodes,omitempty"`
	Width                  int      `json:"width,omitempty"`
	TimezoneShiftHours     float64  `json:"timezoneShiftHours,omitempty"`
}

TimelineRenderRequest holds the parameters passed to the frontend /render/timeline page.

type TimelineRenderResult

type TimelineRenderResult struct {
	PNGBytes        []byte
	Width           int
	Height          int
	RenderedCount   int
	TotalMatched    int
	HasMore         bool
	ViewStartTimeMs int64
	ViewEndTimeMs   int64
}

TimelineRenderResult holds the captured PNG image and measurement metadata.

type UpdateInspectionFeaturesInput

type UpdateInspectionFeaturesInput struct {
	InspectionID      string   `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
	EnabledFeatureIDs []string `json:"enabledFeatureIds" jsonschema:"The complete list of all feature IDs to enable for this inspection."`
}

UpdateInspectionFeaturesInput defines the input parameters for the update_inspection_features tool.

type ValidateReportInput

type ValidateReportInput struct {
	InspectionID string `json:"inspectionId" jsonschema:"The target inspection ID."`
	Report       string `json:"report" jsonschema:"The Markdown report or writeup to validate against the inspection data."`
}

ValidateReportInput defines the input parameters for the validate_report MCP tool.

type WaitInspectionInput

type WaitInspectionInput struct {
	InspectionID string `json:"inspectionId" jsonschema:"The unique identifier of the inspection."`
	// TimeoutSeconds is a pointer to distinguish an omitted value (default wait) from an explicit 0 (no wait).
	TimeoutSeconds *int `` /* 241-byte string literal not displayed */
}

WaitInspectionInput defines the input parameters for the wait_inspection tool.

type WorkbenchHandler

type WorkbenchHandler struct {
	// contains filtered or unexported fields
}

WorkbenchHandler exposes workbench operations and tools over MCP.

func NewWorkbenchHandler

func NewWorkbenchHandler(manager *workbench.WorkbenchManager, renderer TimelineImageRenderer) *WorkbenchHandler

NewWorkbenchHandler creates a new WorkbenchHandler.

func (*WorkbenchHandler) Register

func (h *WorkbenchHandler) Register(srv *mcpsdk.Server)

Register registers workbench tools to the MCP server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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