mcp

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Waiter

func Waiter(id string) (chan *schema.ElicitResult, bool)

Waiter returns the registered channel for a given message ID, if present. It is used by the HTTP callback handler to deliver the user's response and unblock the goroutine waiting inside Client.Elicit.

Types

type Client

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

Client adapts MCP operations to local execution.

func NewClient

func NewClient(el *elicitation.Service, conv apiconv.Client, openURL func(string) error) *Client

NewClient returns a ready client with explicit dependencies. - el: elicitation service (required) - conv: conversation client used for direct updates (required) - newAwaiter: factory for interactive prompts in CLI; pass nil for server mode - openURL: override URL opener; pass nil to use default or to disable

func (*Client) Elicit

func (*Client) Implements

func (c *Client) Implements(method string) bool

Implements tells dispatcher which methods we support.

func (*Client) Init

func (c *Client) Init(ctx context.Context, capabilities *schema.ClientCapabilities)

func (*Client) LastRequestID

func (*Client) LastRequestID() jsonrpc.RequestId

func (*Client) NextRequestID

func (*Client) NextRequestID() jsonrpc.RequestId

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, notification *jsonrpc.Notification) error

func (*Client) OnNotification

func (c *Client) OnNotification(ctx context.Context, notification *jsonrpc.Notification)

func (*Client) ProtocolVersion

func (c *Client) ProtocolVersion() string

func (*Client) SetConversationID added in v0.2.0

func (c *Client) SetConversationID(id string)

SetConversationID assigns conversation id used for conv-scoped elicitation routing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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