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: 1 module, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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