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

mcp

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package mcp provides a stateless streamable-HTTP MCP server for integration tests. It exposes the required provider surface through the official MCP SDK.

Index

Constants

View Source
const LegacyPort = 3014

LegacyPort is the container port used by the testbench for the handshake-era server.

View Source
const Path = "/mcp"

Path is the MCP endpoint path.

View Source
const Port = 3009

Port is the container port used by the testbench.

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyService

type LegacyService struct {
	// contains filtered or unexported fields
}

LegacyService is a handshake-era MCP server: stateful, and without server/discover.

func NewLegacy

func NewLegacy() *LegacyService

NewLegacy builds an MCP service that behaves as a server predating 2026-07-28.

func (*LegacyService) Handler

func (s *LegacyService) Handler() http.Handler

Handler serves the partitioned routes.

func (*LegacyService) Name

func (s *LegacyService) Name() string

Name returns the service registration name.

func (*LegacyService) PartitionKey

func (s *LegacyService) PartitionKey() string

PartitionKey returns the partitioning strategy used by this stateful service.

func (*LegacyService) Port

func (s *LegacyService) Port() int

Port returns the service's listening port.

func (*LegacyService) Stateful

func (s *LegacyService) Stateful() bool

Stateful reports whether the service keeps request-specific state. It does, and that is the point of it: a session opened by one request is read by the next.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the testbench MCP service.

func New

func New() *Service

New builds a stateless MCP service and registers its tools.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler returns the MCP and health handlers.

func (*Service) Name

func (s *Service) Name() string

Name returns the service registration name.

func (*Service) Port

func (s *Service) Port() int

Port returns the service's listening port.

func (*Service) Stateful

func (s *Service) Stateful() bool

Stateful reports whether the service keeps request-specific state.

Jump to

Keyboard shortcuts

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