server

package
v0.0.0-...-8b3e11c Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package server implements the Model Context Protocol (MCP) server for godoctor. It orchestrates the 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 Server

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

Server encapsulates the MCP server and its configuration.

func New

func New(cfg *config.Config, version string) *Server

New creates a new Server instance.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers() error

RegisterHandlers wires all tools, resources, and prompts.

func (*Server) Run

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

Run starts the MCP server using Stdio.

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