Documentation
¶
Overview ¶
Package mcp compiles route exposures into an immutable Datly MCP catalog and a fresh upstream protocol registry.
Index ¶
- Constants
- type Catalog
- type ComponentLoader
- type ComponentRouteResolver
- type Config
- type Service
- func (s *Service) Authorization() *authorization.Policy
- func (s *Service) AuthorizeCatalogResource(ctx context.Context, uri, action string) error
- func (s *Service) AuthorizeCatalogTool(ctx context.Context, name, action string) error
- func (s *Service) AuthorizeResourceRead(ctx context.Context, uri string) error
- func (s *Service) Catalog() *Catalog
- func (s *Service) ListVisibleSkills(ctx context.Context, cursor *string) (*schema.ListSkillsResult, *jsonrpc.Error)
- func (s *Service) PrepareTool(ctx context.Context, name string) error
- func (s *Service) PrepareTools(ctx context.Context) error
- func (s *Service) ReadResource(ctx context.Context, request *schema.ReadResourceRequest) (*schema.ReadResourceResult, *jsonrpc.Error)
- func (s *Service) Registry() *mcpserver.Registry
- type ToolSourceIdentity
Constants ¶
const ( SkillListTool = "skills/list" SkillGetTool = "skills/get" )
const DefaultResourceBaseURI = "datly://localhost"
const ToolSourceMetaKey = "viant.datly/source"
ToolSourceMetaKey is the MCP tool metadata entry identifying the exact published Datly component that backs a tool. Hosts supply this entry from their authoritative publication catalog; ordinary Datly components do not synthesize a source version.
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
type ComponentLoader ¶ added in v1.0.0
type ComponentRouteResolver ¶ added in v1.0.0
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
// ToolMetadata supplies host-owned, exact component identity metadata for
// MCP tools. The compiler merges it into schema.Tool.Meta without allowing
// a host to replace the tool name or input/output contract.
ToolMetadata func(context.Context, exec.ComponentTarget) (map[string]interface{}, error)
// Catalog callbacks authorize metadata independently of execution. They are
// evaluated for the request's pinned generation, never from skill frontmatter.
AuthorizeCatalogTool func(context.Context, exec.ComponentTarget, string) error
AuthorizeCatalogResource func(context.Context, string, string) error
// Indexed publishes tool identities without eager component contracts.
Indexed []*spec.Component
Loader ComponentLoader
}
type Service ¶ added in v1.0.0
type Service struct {
// contains filtered or unexported fields
}
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) AuthorizeCatalogResource ¶ added in v1.1.0
func (*Service) AuthorizeCatalogTool ¶ added in v1.1.0
func (*Service) AuthorizeResourceRead ¶ added in v1.1.0
func (*Service) ListVisibleSkills ¶ added in v1.1.0
func (*Service) PrepareTool ¶ added in v1.0.0
func (*Service) PrepareTools ¶ added in v1.0.0
func (*Service) ReadResource ¶ added in v1.0.0
func (s *Service) ReadResource(ctx context.Context, request *schema.ReadResourceRequest) (*schema.ReadResourceResult, *jsonrpc.Error)
type ToolSourceIdentity ¶ added in v1.1.0
type ToolSourceIdentity struct {
Tenant string `json:"tenant"`
ReportID string `json:"reportId"`
Version int `json:"version"`
}
ToolSourceIdentity is the host-attested component identity carried under ToolSourceMetaKey. A consumer must still evaluate its own current ACL and require an exact match with the configured resource before calling the tool.
Source Files
¶
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. |