mcp

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.0.31

func Close(session ClientSession) error

func ErrorResult

func ErrorResult(msg string) any

func New

func New(name string, version string) *mcp.Server

func Required

func Required(schema any, names []string) any

func Schema

func Schema(props []SchemaProperty) map[string]any

func Serve

func Serve(server *mcp.Server) error

func TextResult

func TextResult(text string) any

func Tool

func Tool(server *mcp.Server, name string, description string, schema any, handler ToolHandler)

Types

type CallToolResult added in v0.0.31

type CallToolResult struct {
	Text    string
	IsError bool
}

func CallTool added in v0.0.31

func CallTool(ctx context.Context, session ClientSession, name string, args map[string]any) (CallToolResult, error)

type ClientSession added in v0.0.31

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

func Connect added in v0.0.31

func Connect(ctx context.Context, endpoint string) (ClientSession, error)

type ClientTool added in v0.0.31

type ClientTool struct {
	Name        string
	Description string
	InputSchema map[string]any
}

func ListTools added in v0.0.31

func ListTools(ctx context.Context, session ClientSession) ([]ClientTool, error)

type SchemaProperty

type SchemaProperty struct {
	Name        string
	Type        string
	Description string
}

func Prop

func Prop(name string, typ string, description string) SchemaProperty

type ToolHandler

type ToolHandler func(map[string]any) (any, error)

Jump to

Keyboard shortcuts

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