mcpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 13 Imported by: ? 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 exposes runtimekit through the official MCP protocol SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPOptions

type HTTPOptions struct {
	Address        string
	BearerToken    string
	AllowedHosts   []string
	AllowedOrigins []string
	MaxBodyBytes   int64
	MaxConcurrent  int
	RequestTimeout time.Duration
	ShutdownGrace  time.Duration
}

HTTPOptions are resolved transport settings. Token values never enter config files.

type Server

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

Server owns the protocol surface for one immutable runtime composition.

func New

func New(runtime *runtimekit.Runtime) (*Server, error)

New registers stable tools, resources, and prompts.

func (*Server) HTTPHandler

func (s *Server) HTTPHandler(opts HTTPOptions) (http.Handler, error)

HTTPHandler returns a stateless Streamable HTTP handler with bounded admission.

func (*Server) ProtocolServer

func (s *Server) ProtocolServer() *mcp.Server

ProtocolServer returns the underlying official MCP server for custom transports.

func (*Server) RunHTTP

func (s *Server) RunHTTP(ctx context.Context, opts HTTPOptions) error

RunHTTP serves until cancellation and then performs a bounded graceful shutdown.

func (*Server) RunStdio

func (s *Server) RunStdio(ctx context.Context) error

RunStdio serves MCP over stdin/stdout. Callers must keep logs on stderr.

Jump to

Keyboard shortcuts

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