mcpserver

package
v1.6.16 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProjectsTool = &Tool{
	Name:        "projects",
	Description: "Returns the projects managed by " + util.AppName,
	Args: util.FieldDescs{
		{Key: "id", Description: "Optional project id. If omitted, all projects will be returned"},
	},
	Fn: projectsHandler,
}

Functions

func InitMCP

func InitMCP(bi *app.BuildInfo, debug bool)

Types

type Server

type Server struct {
	MCP   *server.MCPServer
	Tools map[string]*Tool
}

func NewServer

func NewServer(ctx context.Context, version string) (*Server, error)

func (*Server) AddTools

func (s *Server) AddTools(tools ...*Tool) error

func (*Server) Serve

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

type Tool

type Tool struct {
	Name        string
	Description string
	Args        util.FieldDescs
	Fn          ToolHandler
}

func (Tool) Handler

func (t Tool) Handler() server.ToolHandlerFunc

func (Tool) ToMCP

func (t Tool) ToMCP() (mcp.Tool, error)

type ToolHandler

type ToolHandler func(ctx context.Context, args util.ValueMap, req mcp.CallToolRequest) (string, error)

Jump to

Keyboard shortcuts

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