Documentation
¶
Overview ¶
Package mcp exposes opt-in, read-only tools over a single Streamable HTTP endpoint.
Index ¶
- Constants
- func NewHandler(server *sdk.Server, token string, allowedOrigins []string) http.Handler
- func NewServer(name string, commands []Command) *sdk.Server
- func Pagination(page, pageSize int) (int, int, error)
- func RegisterErrorLog(server *sdk.Server)
- func RegisterRoutes(ginEngine *gin.Engine)
- type Command
- type ErrorLogEntry
- type ErrorLogInput
- type ErrorLogOutput
Constants ¶
View Source
const Endpoint = "/dev/mcp"
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler requires a bearer token even in local mode. Empty tokens fail closed.
func Pagination ¶
Pagination supplies bounded defaults for read-only commands.
func RegisterErrorLog ¶
RegisterErrorLog adds the built-in read-only log tool.
func RegisterRoutes ¶
RegisterRoutes keeps MCP separate from dev-panel JWT/cookie authentication.
Types ¶
type ErrorLogEntry ¶
type ErrorLogEntry struct {
ID string
*errorlogger.Entry
}
type ErrorLogInput ¶
type ErrorLogInput struct {
Group string `json:"group,omitempty" jsonschema:"Log group: error (default), service, warning, or missing-translation"`
ErrorID string `json:"error_id,omitempty" jsonschema:"Exact stored entry ID for reading one error in detail"`
AppName string `json:"app_name,omitempty" jsonschema:"Case-insensitive app name substring filter"`
Query string `json:"query,omitempty" jsonschema:"Search ID, message, file, request, stack, app, service, time, and ticket link"`
Trace string `json:"trace,omitempty" jsonschema:"Case-insensitive stack trace substring filter"`
SortBy string `json:"sort_by,omitempty" jsonschema:"Sort by time (default) for recent errors or counter for most frequent errors"`
IncludeRequest bool `json:"include_request,omitempty" jsonschema:"Include captured requests with common credentials masked; defaults to false"`
IncludeStack bool `json:"include_stack,omitempty" jsonschema:"Include stack traces with common credentials masked; defaults to false"`
Page int `json:"page,omitempty" jsonschema:"Page number starting at 1; defaults to 1"`
PageSize int `json:"page_size,omitempty" jsonschema:"Entries per page, from 1 to 100; defaults to 50"`
}
type ErrorLogOutput ¶
type ErrorLogOutput struct {
Group string
Rows []ErrorLogEntry
Total int
Page int
PageSize int
}
Click to show internal directories.
Click to hide internal directories.