mcp

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package mcp provides a MCP server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenOpts

type ListenOpts struct {
	L       *slog.Logger
	M       *middleware.Middleware
	TCPAddr string
}

ListenOpts represents Listen options.

type Listener

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

Listener represents MCP listener.

func Listen

func Listen(opts *ListenOpts) (*Listener, error)

Listen creates a new MCP handler and starts listener on the given TCP address. Listener.Run must be called on the returned value.

func (*Listener) Addr

func (lis *Listener) Addr() net.Addr

Addr returns TCP listener's address. It can be used to determine an actually used port, if it was zero.

func (*Listener) Collect

func (lis *Listener) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Listener) Describe

func (lis *Listener) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*Listener) Run

func (lis *Listener) Run(ctx context.Context)

Run runs MCP handler until ctx is canceled.

It exits when handler is stopped and listener closed.

Jump to

Keyboard shortcuts

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