server

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package server implements the MCP protocol server with stdio and HTTP transports.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set via ldflags at build time: -ldflags "-X ...server.Version=..." Falls back to "dev" if not set.

Functions

func RunHTTP

func RunHTTP(ctx context.Context, server *MCPServer) error

RunHTTP runs the server in HTTP mode, blocking until ctx is cancelled and then gracefully shutting down.

func RunStdio

func RunStdio(server *MCPServer) error

RunStdio runs the server in stdio mode, reading JSON-RPC requests from stdin.

Types

type MCPServer

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

MCPServer implements the MCP protocol server with RAG and memory capabilities.

func New

func New(cfg config.Config, guard *paths.Guard) *MCPServer

New creates a new MCPServer with the given configuration and path guard.

func (*MCPServer) ReloadConfig added in v0.8.1

func (s *MCPServer) ReloadConfig(newCfg config.Config)

ReloadConfig swaps the server's effective config and restarts the RAG engine. Always updates s.config first so non-RAG-bound fields (e.g. TaskArchiveRoots) reflect the new file even when RAG is disabled or fails to initialize. The ragMu (RWMutex) doubles as the config write barrier — read paths that touch s.config must take s.ragMu.RLock() if they require a consistent snapshot.

func (*MCPServer) ReloadRAG deprecated added in v0.5.0

func (s *MCPServer) ReloadRAG(newCfg config.Config)

ReloadRAG is the legacy entry point kept for any external callers. New code should use ReloadConfig.

Deprecated: use ReloadConfig.

func (*MCPServer) Shutdown

func (s *MCPServer) Shutdown()

Shutdown gracefully shuts down the server, closing all resources.

Jump to

Keyboard shortcuts

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