Documentation
¶
Overview ¶
Package refscheme is the one reader and writer of the scheme platform references start with (#2776): mcp:asset:<id>, mcp:dataset:(...), and every other kind. A deployment names its scheme once (server.reference_scheme); every reference the platform hands out is written under it, every reference it reads is accepted under it and under mcp:, and everything stored keeps the canonical mcp: form, so changing the setting changes only what is written out. With no setting the scheme is mcp and nothing is rewritten.
Index ¶
- Constants
- Variables
- func Canon(s string) string
- func CanonBytes(b []byte) []byte
- func Configure(scheme, uriScheme string) error
- func Display(s string) string
- func DisplayBytes(b []byte) []byte
- func HTTP(next http.Handler) http.Handler
- func Middleware() mcp.Middleware
- func Of(kind, rest string) string
- func Rewrites() bool
- func Scheme() string
- func StoredResourceScheme() string
- func Validate(scheme string) error
Constants ¶
const ( Prefix = "mcp:" URIPrefix = "mcp://" )
Prefix is the canonical start of a reference, and URIPrefix of a resource URI stored under the default scheme.
const ( Asset = "mcp:asset:" Prompt = "mcp:prompt:" Collection = "mcp:collection:" KnowledgePage = "mcp:knowledge_page:" Connection = "mcp:connection:" Insight = "mcp:insight:" Resource = "mcp:resource:" Memory = "mcp:memory:" Script = "mcp:script:" Call = "mcp:call:" Session = "mcp:session:" Form = "mcp:form:" Endpoint = "mcp:endpoint:" Site = "mcp:site:" Tag = "mcp:tag:" )
The canonical start of each kind of reference, written out whole so a search of the source for one finds where it is made.
const Canonical = "mcp"
Canonical is the scheme every stored reference uses.
Variables ¶
var Kinds = []string{
"asset", "prompt", "collection", "knowledge_page", "connection", "insight", "resource", "memory", "script", "call", "session",
"dataset", "column", "glossary_term", "glossary_node", "tag", "domain", "data_product", "schema_document",
"form", "endpoint", "site", "catalog",
}
Kinds are every kind a reference names.
Functions ¶
func Canon ¶
Canon is a text with every reference under the deployment's scheme written in the canonical form: what the platform reads, before it stores or compares it.
func Configure ¶
Configure sets the scheme references are written under; "" is mcp. uriScheme is resources.managed.uri_scheme: with none set, resource URIs are stored as mcp:// and written out as <scheme>:// too.
func Display ¶
Display is a text with every canonical reference written under the deployment's scheme: what the platform hands out.
func HTTP ¶
HTTP is the HTTP boundary of the scheme for the JSON API (#2776): a reference under the deployment's scheme in a request's path, query or JSON body reaches the handler canonical, and every reference in a JSON answer leaves under the deployment's scheme. Any other answer (a file, a stream) is sent as it is. With no scheme set it is the handler itself.
func Middleware ¶
func Middleware() mcp.Middleware
Middleware is the MCP boundary of the scheme: every reference a request carries under the deployment's scheme reaches the platform in the canonical form, and every reference a result carries leaves under the deployment's scheme: tool results, tool descriptions and schemas, prompts, resources and the server's instructions. With no scheme set it passes everything through untouched.
func Rewrites ¶
func Rewrites() bool
Rewrites reports whether references are written under a scheme other than mcp, so that anything is rewritten at all.
func StoredResourceScheme ¶
func StoredResourceScheme() string
StoredResourceScheme is the scheme resource URIs are stored under: resources.managed.uri_scheme, or mcp. A body is read for this one and mcp:// both.
Types ¶
This section is empty.