mcp

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 17 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer() *server.MCPServer

NewServer creates and configures the MCP server with all tools registered.

Types

type HTTPTransport

type HTTPTransport struct {
	Addr string // e.g. ":8080"
}

HTTPTransport serves the MCP server over HTTP (Streamable HTTP).

func (*HTTPTransport) Name

func (t *HTTPTransport) Name() string

func (*HTTPTransport) Serve

func (t *HTTPTransport) Serve(ctx context.Context, s *server.MCPServer) error

type StdioTransport

type StdioTransport struct {
	In  io.Reader
	Out io.Writer
}

StdioTransport serves the MCP server over stdin/stdout.

func (*StdioTransport) Name

func (t *StdioTransport) Name() string

func (*StdioTransport) Serve

func (t *StdioTransport) Serve(ctx context.Context, s *server.MCPServer) error

type Transport

type Transport interface {
	// Serve starts the MCP server and blocks until the context is cancelled or an error occurs.
	Serve(ctx context.Context, s *server.MCPServer) error
	// Name returns the transport identifier.
	Name() string
}

Transport defines the strategy for serving an MCP server.

func NewTransport

func NewTransport(name, addr string, in io.Reader, out io.Writer) (Transport, error)

NewTransport resolves a transport strategy by name.

Jump to

Keyboard shortcuts

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