Documentation
¶
Overview ¶
Package mcpapi exposes the curated Agent-facing MCP operation subset.
Index ¶
Constants ¶
const (
ServerName = "PowerContext Server"
)
Variables ¶
This section is empty.
Functions ¶
func AccessLogMiddleware ¶
func AccessLogMiddleware(logger *slog.Logger) mcp.Middleware
AccessLogMiddleware observes logical MCP protocol requests. It must be installed inside the tracing middleware so the record shares the MCP transport span and request ID; Streamable HTTP frames are logged nowhere.
func NewHTTPHandler ¶
func NewHTTPHandler(server *mcp.Server, options HTTPOptions) http.Handler
NewHTTPHandler exposes a server through MCP Streamable HTTP. Go's standard same-origin protection is explicit so browser behavior does not depend on an SDK compatibility flag; the SDK's localhost DNS-rebinding protection remains enabled.
Types ¶
type ApplicationObserver ¶
type ApplicationObserver interface {
ObserveApplication(operation, outcome string, started time.Time)
}
ApplicationObserver is the consumer-shaped telemetry boundary needed by direct MCP endpoint calls.
type HTTPOptions ¶
type HTTPOptions struct {
Stateless bool
JSONResponse bool
SessionTimeout time.Duration
Logger *slog.Logger
}
HTTPOptions configures the official MCP streamable HTTP transport. The defaults preserve sessions and SSE compatibility; JSONResponse is useful for simple clients that do not need server-initiated notifications.
type Options ¶
type Options struct {
Version string
HandoffReportEnabled bool
ReceivingMiddleware []mcp.Middleware
ApplicationObserver ApplicationObserver
ApplicationLogger *slog.Logger
TracerProvider trace.TracerProvider
}
Options controls the externally visible MCP surface. Handoff Report tools are omitted entirely unless the feature is enabled.