server

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 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

Overview

Package server implements the Model Context Protocol (MCP) server for godoctor. It orchestrates tool registration, handles incoming client requests (via Stdio or HTTP), and manages the lifecycle of the server. It connects the core logic (tools, graph) to the external world.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.34.0

type Option func(*Server)

Option defines a functional option for configuring a Server.

func WithServerConfig added in v0.34.0

func WithServerConfig(cfg config.ServerConfig) Option

WithServerConfig configures allowed origins and timeouts from config.ServerConfig.

type Server

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

Server encapsulates the MCP server and its lifecycle configuration.

func New

func New(version string, opts ...Option) *Server

New creates a new Server instance.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers() error

RegisterHandlers wires all tools idempotently.

func (*Server) Run

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

Run starts the MCP server using Stdio transport.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(ctx context.Context, addr string) error

ServeHTTP starts the server over HTTP using StreamableHTTP.

Jump to

Keyboard shortcuts

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