mcpserver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mcpserver exposes Beacon's local configuration and operational state through the Model Context Protocol. It is a thin transport over the same config.Service and stats.Registry used by the REST API and web UI, so MCP writes get identical validation, persistence, and hot reconciliation.

Index

Constants

View Source
const EndpointPath = "/mcp"

Variables

This section is empty.

Functions

func Handler

func Handler(svc *config.Service, reg *stats.Registry, version string, log *slog.Logger) http.Handler

Handler serves the current MCP Streamable HTTP transport. It uses ordinary JSON responses because Beacon's tools complete synchronously and do not need server-to-client streaming. Sessions are still negotiated normally for broad client compatibility. Cross-origin protection enforces the MCP transport's Origin requirement while continuing to allow non-browser local/LAN agents.

func NewServer

func NewServer(svc *config.Service, reg *stats.Registry, version string, log *slog.Logger) *sdkmcp.Server

NewServer creates Beacon's MCP server. The returned server can be used with an in-memory transport in tests or the Streamable HTTP handler returned by Handler in production.

Types

type ToolInfo

type ToolInfo struct {
	Name        string
	Access      string
	Description string
}

ToolInfo is the stable, human-readable catalog shared by the MCP server and the onboard /mcp/info reference page.

func Catalog

func Catalog() []ToolInfo

Catalog returns a copy so callers cannot mutate the registered tool list.

Jump to

Keyboard shortcuts

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