Help us shape the future of Go! Take the 2026 Go Developer Survey

mcp

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 8 Imported by: 8

Documentation

Overview

Package mcp is GTB's glue over the go/mcp module, and the link that gives a tool the mcp feature. A blank import from the tool's main (the generator writes cmd/<name>/mcp.go to do so) declares the feature as a link kind and contributes the `mcp` command to the root, with the framework's conventions applied once (spec 0201 D1, spec 0202 D1). Nothing else in the framework imports go/mcp, so a binary without the import carries neither the module nor the MCP SDK.

Index

Constants

View Source
const Feature = props.McpCmd

Feature is the feature this import declares: props.McpCmd, kept there as the ID so a main that names it links nothing.

View Source
const PackagePath = "gitlab.com/phpboyscout/go-tool-base/pkg/mcp"

PackagePath is this package's import path, the ConstPackage the descriptor carries: for a link, the package to blank-import.

Variables

This section is empty.

Functions

func BindingOptions

func BindingOptions() []mcpcobra.BindingOption

BindingOptions are GTB's conventions for the Cobra binding: exposure by the tree's own markers (spec 0089), the global flags withheld, and the wrapper's feature as the search group.

func NewCmdMCP

func NewCmdMCP(p *props.Props, level *slog.LevelVar, extra ...cli.Option) *setup.Command

NewCmdMCP builds the `mcp` command for a tool: exposure from the command tree's own markers, the framework's global flags withheld, operations grouped by feature, the publication mode from props.Tool.MCP, the tool's identity, and logs on the invocation's error stream at the level the root's --debug also moves (stdout carries the protocol). extra options come last, so a host or a test can add or override.

func ServerOptions

func ServerOptions(p *props.Props) []server.Option

ServerOptions are the protocol server's identity and publication mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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