mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package mcp registers the Disbug MCP tools and runs the stdio JSON-RPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, profile string, stderr io.Writer) error

Run registers the MCP server and serves stdio JSON-RPC until stdin closes or the process is interrupted.

func SetVersion

func SetVersion(s string)

SetVersion is called by the cmd package at startup so the MCP server reports the right version.

Types

type Deps

type Deps struct {
	Client         *client.Client
	Me             *client.Me
	Stderr         io.Writer
	CloudAvailable bool
}

Deps holds shared dependencies for MCP tool handlers.

type GetPinInput

type GetPinInput struct {
	Target string   `json:"target,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	URL    string   `json:"url,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	Pin    string   `json:"pin,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	Source string   `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
	Fields []string `json:"fields,omitempty" jsonschema:"array of: screenshot console network events replay voice_note video all"`
}

GetPinInput is the input for the get_pin MCP tool.

type GetPinsInput

type GetPinsInput struct {
	Items         []GetPinsItem `json:"items" jsonschema:"array of {target|url|pin, fields?} entries"`
	Source        string        `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
	DefaultFields []string      `json:"default_fields,omitempty" jsonschema:"fields used when an item omits its own list"`
}

GetPinsInput is the input for the get_pins MCP tool.

type GetPinsItem

type GetPinsItem struct {
	Target string   `json:"target,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	URL    string   `json:"url,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	Pin    string   `json:"pin,omitempty" jsonschema:"Disbug report URL with ?pin=<number>"`
	Fields []string `json:"fields,omitempty" jsonschema:"fields for this pin; defaults to default_fields"`
}

GetPinsItem is one pin fetch request in the get_pins MCP tool input.

type GetSessionInput

type GetSessionInput struct {
	Target  string `json:"target,omitempty" jsonschema:"Disbug report URL"`
	URL     string `json:"url,omitempty" jsonschema:"Disbug report URL"`
	ID      string `json:"id,omitempty" jsonschema:"Disbug report URL"`
	Session string `json:"session,omitempty" jsonschema:"Disbug report URL"`
	Source  string `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
}

GetSessionInput is the input for the get_session MCP tool.

type InspectLocalReportInput

type InspectLocalReportInput struct {
	Path     string   `json:"path" jsonschema:"Path to a downloaded Disbug local report JSON file"`
	Pin      int      `json:"pin,omitempty" jsonschema:"Pin number to inspect; omit for a session summary"`
	Fields   []string `json:"fields,omitempty" jsonschema:"array of: screenshot console network events replay voice_note video all"`
	CacheDir string   `json:"cache_dir,omitempty" jsonschema:"Directory for decoded local artifacts"`
}

InspectLocalReportInput is the input for the inspect_local_report MCP tool.

type ListSessionsInput

type ListSessionsInput struct {
	Source  string `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
	Status  string `json:"status,omitempty" jsonschema:"Filter by status: open, resolved, or dismissed"`
	Project string `json:"project,omitempty" jsonschema:"Filter by project slug"`
	Limit   int    `json:"limit,omitempty" jsonschema:"Maximum results to return; defaults to 50 and is capped at 100"`
}

ListSessionsInput is the input for the list_sessions MCP tool.

type Result

type Result map[string]any

Result is a generic JSON tool result payload.

type SearchPinsInput

type SearchPinsInput struct {
	Query  string `json:"query" jsonschema:"Search query"`
	Source string `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
	Limit  int    `json:"limit,omitempty" jsonschema:"Maximum results to return; defaults to 20 and is capped at 50"`
}

SearchPinsInput is the input for the search_pins MCP tool.

type SearchSessionsInput

type SearchSessionsInput struct {
	Query  string `json:"query" jsonschema:"Search query"`
	Source string `json:"source,omitempty" jsonschema:"Source: auto or cloud"`
	Scope  string `json:"scope,omitempty" jsonschema:"Search scope: sessions or pins; defaults to sessions"`
	Limit  int    `json:"limit,omitempty" jsonschema:"Maximum results to return; defaults to 20 and is capped at 50"`
}

SearchSessionsInput is the input for the search_sessions MCP tool.

type WhoamiInput

type WhoamiInput struct{}

WhoamiInput is the empty input for the whoami MCP tool.

Jump to

Keyboard shortcuts

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