mcpserver

package
v0.3.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 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

Overview

Package mcpserver is the built-in MCP server at /mcp (streamable HTTP, stateless). It offers the same operations as the REST API, with the same tokens and scopes, so an agent can see what is alerting, gather the evidence in one call, act on it and leave notes, and work on machines through the SSH channel with tools shaped like its own (run a command, read, write and edit a file). Every write and every session is audited and echoed to the alert chat.

Index

Constants

View Source
const ConfigInstructions = `` /* 944-byte string literal not displayed */

ConfigInstructions follow Instructions when the server has the configuration tools.

View Source
const Instructions = `` /* 3461-byte string literal not displayed */

Instructions tell an agent what the server is for, how its six domains are organised, and how to use the write tools, resources and prompts responsibly.

View Source
const StatusInstructions = `` /* 652-byte string literal not displayed */

StatusInstructions follow Instructions when the server has the status pages.

Variables

This section is empty.

Functions

func Handler

func Handler(b *bridge.Bridge, g SSH, a *api.Auth, log *slog.Logger, opts ...Option) http.Handler

Handler returns the MCP endpoint, guarded by bearer credentials: a token, or an OAuth access token a person allowed a client to hold (package oauth). A request without one, or with one that does not verify, gets a 401 whose WWW-Authenticate names the protected resource metadata (RFC 9728), so that an MCP client can sign in through the browser.

func New

func New(b *bridge.Bridge, g SSH, opts ...Option) *mcp.Server

New builds the MCP server with its tools.

Types

type Option

type Option func(*options)

Option changes what the server offers.

func WithConfig

func WithConfig(c *configdb.Service) Option

WithConfig adds the tools that read and change the configuration Beacon holds.

func WithResourceMetadata

func WithResourceMetadata(url func(*http.Request) string) Option

WithResourceMetadata names, for a request, the protected resource metadata (RFC 9728) that a 401 points to, so that an MCP client can find where to sign in (package oauth).

func WithSettings

func WithSettings(m *config.Manager) Option

WithSettings enables the system settings MCP tools backed by m.

func WithStatus

func WithStatus(st *status.Service) Option

WithStatus adds the tool that reads the public status pages.

func WithTeamCredentials

func WithTeamCredentials(c *secrets.Service, configured bool) Option

type SSH

type SSH struct {
	Gate    *sshgate.Gate
	Address string
}

SSH is the SSH channel behind the machine tools (Gate nil: off), and where agents reach it with their own ssh (host:port, for the ssh configuration list_machines returns).

Jump to

Keyboard shortcuts

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