builder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package builder provides a builder for the MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerBuilder

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

ServerBuilder is a builder for creating an MCP server.

func NewServerBuilder

func NewServerBuilder() *ServerBuilder

NewServerBuilder creates a new ServerBuilder.

func (*ServerBuilder) AddPrompt

func (b *ServerBuilder) AddPrompt(ctx context.Context, prompt *domain.Prompt) *ServerBuilder

AddPrompt adds a prompt to the server's prompt repository

func (*ServerBuilder) AddResource

func (b *ServerBuilder) AddResource(ctx context.Context, resource *domain.Resource) *ServerBuilder

AddResource adds a resource to the server's resource repository

func (*ServerBuilder) AddTool

func (b *ServerBuilder) AddTool(ctx context.Context, tool *domain.Tool) *ServerBuilder

AddTool adds a tool to the server's tool repository

func (*ServerBuilder) BuildMCPServer

func (b *ServerBuilder) BuildMCPServer() *rest.MCPServer

BuildMCPServer builds and returns an MCP server

func (*ServerBuilder) BuildService

func (b *ServerBuilder) BuildService() *usecases.ServerService

BuildService builds and returns the server service

func (*ServerBuilder) BuildStdioServer

func (b *ServerBuilder) BuildStdioServer(opts ...stdio.StdioOption) *stdio.StdioServer

BuildStdioServer builds a stdio server that uses the MCP server

func (*ServerBuilder) ServeStdio

func (b *ServerBuilder) ServeStdio(opts ...stdio.StdioOption) error

ServeStdio builds and starts serving a stdio server

func (*ServerBuilder) WithAddress

func (b *ServerBuilder) WithAddress(address string) *ServerBuilder

WithAddress sets the server address

func (*ServerBuilder) WithInstructions

func (b *ServerBuilder) WithInstructions(instructions string) *ServerBuilder

WithInstructions sets the server instructions

func (*ServerBuilder) WithName

func (b *ServerBuilder) WithName(name string) *ServerBuilder

WithName sets the server name

func (*ServerBuilder) WithNotificationSender

func (b *ServerBuilder) WithNotificationSender(sender domain.NotificationSender) *ServerBuilder

WithNotificationSender sets the notification sender

func (*ServerBuilder) WithPromptRepository

func (b *ServerBuilder) WithPromptRepository(repo domain.PromptRepository) *ServerBuilder

WithPromptRepository sets the prompt repository

func (*ServerBuilder) WithResourceRepository

func (b *ServerBuilder) WithResourceRepository(repo domain.ResourceRepository) *ServerBuilder

WithResourceRepository sets the resource repository

func (*ServerBuilder) WithSessionRepository

func (b *ServerBuilder) WithSessionRepository(repo domain.SessionRepository) *ServerBuilder

WithSessionRepository sets the session repository

func (*ServerBuilder) WithToolRepository

func (b *ServerBuilder) WithToolRepository(repo domain.ToolRepository) *ServerBuilder

WithToolRepository sets the tool repository

func (*ServerBuilder) WithVersion

func (b *ServerBuilder) WithVersion(version string) *ServerBuilder

WithVersion sets the server version

Jump to

Keyboard shortcuts

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