Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package server builds the MCP server and wires each registered tools.Tool into it: New's AddTool call supplies the SDK with the tool's name, description, and input schema — which the SDK uses on its own to answer ListTools — plus a CallTool handler built by adapt. adapt runs the tool's Validate/Execute contract, recovers from panics so one tool's bug can't take down the connection, and sanitizes execution errors (via handleError) before they reach the client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name, version string, logger *slog.Logger, registeredTools []tools.Tool, resources *tools.Resources) *mcp.Server

New builds the sync82 MCP server and registers every tool in registeredTools, with its toolAnnotations, and every prompt in tools.Prompts. When resources is not nil it also serves the resources and completes the arguments of the prompts and resource templates. name/version identify the server to connecting clients; logger receives every diagnostic message and must write only to stderr — stdout is the JSON-RPC channel over the stdio transport.

Types

This section is empty.

Jump to

Keyboard shortcuts

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