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: 24 Imported by: 0

Documentation

Overview

Package mcp compiles route exposures into an immutable Datly MCP catalog and a fresh upstream protocol registry.

Index

Constants

View Source
const (
	SkillListTool = "skills/list"
	SkillGetTool  = "skills/get"
)
View Source
const DefaultResourceBaseURI = "datly://localhost"

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog added in v1.0.0

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

func (*Catalog) ResourceCatalog added in v1.0.0

func (c *Catalog) ResourceCatalog() *mcpresource.Catalog

func (*Catalog) Tool added in v1.0.0

func (c *Catalog) Tool(name string) (*tool.Plan, bool)

func (*Catalog) ToolNames added in v1.0.0

func (c *Catalog) ToolNames() []string

type ComponentLoader added in v1.0.0

type ComponentLoader interface {
	LoadComponent(context.Context, spec.Key) (*registry.RegisteredComponent, error)
}

type ComponentRouteResolver added in v1.0.0

type ComponentRouteResolver interface {
	ResolveComponentRoute(method, path string) (spec.Key, *spec.Route, bool)
}

type Config added in v1.0.0

type Config struct {
	Folders           []mcpresource.Folder
	Components        []*registry.RegisteredComponent
	Invoker           exec.ComponentInvoker
	Client            xmcp.Client
	Resources         *bindresource.Store
	ResourceBaseURI   string
	Authorization     *authorization.Policy
	AuthorizeTool     func(context.Context, exec.ComponentTarget) error
	AuthorizeResource func(context.Context, string) error
	// Indexed publishes tool identities without eager component contracts.
	Indexed []*spec.Component
	Loader  ComponentLoader
}

func (Config) Compile added in v1.0.0

func (config Config) Compile(ctx context.Context) (*Service, error)

Compile stages resource snapshots in the caller's generation context.

type Service added in v1.0.0

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

func New added in v1.0.0

func New(config Config) (*Service, error)

func (*Service) Authorization added in v1.0.0

func (s *Service) Authorization() *authorization.Policy

Authorization returns a detached copy of the validated transport policy.

func (*Service) Catalog added in v1.0.0

func (s *Service) Catalog() *Catalog

func (*Service) PrepareTool added in v1.0.0

func (s *Service) PrepareTool(ctx context.Context, name string) error

func (*Service) PrepareTools added in v1.0.0

func (s *Service) PrepareTools(ctx context.Context) error

func (*Service) ReadResource added in v1.0.0

func (*Service) Registry added in v1.0.0

func (s *Service) Registry() *mcpserver.Registry

Directories

Path Synopsis
Package developer exposes explicitly configured authoring tools separately from Datly's business component catalog and runtime invocation engine.
Package developer exposes explicitly configured authoring tools separately from Datly's business component catalog and runtime invocation engine.
skills
Package skills contains the complete canonical authoring skill snapshot.
Package skills contains the complete canonical authoring skill snapshot.
Package input projects compiled MCP payloads into canonical Bindly request providers.
Package input projects compiled MCP payloads into canonical Bindly request providers.
Package invocation adapts MCP calls to the protocol-neutral component port.
Package invocation adapts MCP calls to the protocol-neutral component port.
Package resource compiles and resolves MCP resource route exposures.
Package resource compiles and resolves MCP resource route exposures.
Package server adapts a compiled Datly MCP service to the upstream protocol handler.
Package server adapts a compiled Datly MCP service to the upstream protocol handler.
Package tool compiles route-effective component contracts into MCP tools.
Package tool compiles route-effective component contracts into MCP tools.

Jump to

Keyboard shortcuts

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