adapter

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package adapter wraps mark3labs/mcp-go, isolating direct library usage to this layer.

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 wraps an MCP server instance.

func NewServer

func NewServer(name, version string) *Server

NewServer creates a new MCP server with the given name and version.

func (*Server) AddTool

func (s *Server) AddTool(name, description string, params []ToolParam, handler ToolHandler)

AddTool registers a tool with the server.

func (*Server) ServeStdio

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

ServeStdio starts the MCP server using stdin/stdout transport. Logs must be written to stderr by callers to avoid polluting the MCP protocol stream.

type ToolHandler

type ToolHandler func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

ToolHandler is a function that handles a tool call.

type ToolParam

type ToolParam struct {
	Name        string
	Description string
	Required    bool
	// Type is "string" or "number"
	Type string
}

ToolParam describes a single parameter for a tool.

Jump to

Keyboard shortcuts

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