mcp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package mcp defines the MCP capabilities and lifecycle contracts exposed to xdatly handlers without coupling them to a Datly runtime implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, value Context) context.Context

WithContext attaches MCP capabilities to an invocation context.

Types

type Client

type Client interface {
	CanElicit() bool
	CanGenerateContent() bool
	Elicit(ctx context.Context, params *schema.ElicitRequestParams) (*schema.ElicitResult, error)
	GenerateContent(ctx context.Context, params *schema.CreateMessageRequestParams) (*schema.CreateMessageResult, error)
}

Client exposes the MCP client capabilities available to a handler hook.

type Context

type Context interface {
	Client() Client
}

Context carries request-scoped MCP capabilities.

func LookupContext

func LookupContext(ctx context.Context) (Context, bool)

LookupContext returns the MCP capabilities attached to ctx.

type Finalizer

type Finalizer interface {
	FinalizeMCP(ctx context.Context, mcp Context) error
}

Finalizer is an MCP-aware output hook. The unified handler engine invokes it after ordinary successful finalization when MCP context is present.

type Initializer

type Initializer interface {
	InitMCP(ctx context.Context, mcp Context) error
}

Initializer is an MCP-aware input hook. The unified handler engine invokes it after the ordinary input initializer when MCP context is present.

Jump to

Keyboard shortcuts

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