Documentation
¶
Index ¶
Constants ¶
const Format = 1
const PageBytes = 256 << 10
PageBytes bounds the name, title, description and input schema bytes of the tools one tools/list page holds; a single tool larger than PageBytes is still a page of its own.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶ added in v0.0.3
type Credential interface {
// contains filtered or unexported methods
}
type Document ¶ added in v0.0.3
type Document struct {
Format int `json:"om"`
Title string `json:"title"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Server string `json:"server"`
Inputs []Input `json:"inputs"`
Operations []Operation `json:"operations"`
}
Document is a compiled OpenAPI document: one MCP tool per operation. Its JSON encoding is the model a host stores between compiling and serving.
func (Document) Handler ¶ added in v0.0.3
func (d Document) Handler(lookup func(name string) (string, bool), transport http.RoundTripper) (http.Handler, error)
Handler serves the document's operations as MCP tools over Streamable HTTP, statelessly. lookup supplies an input's value by name; transport carries the upstream requests.
type Input ¶
type Input struct {
Name string `json:"name"`
Default *string `json:"default,omitempty"`
Choices []string `json:"choices,omitempty"`
}
Input is a value the host supplies by name: a server variable when it has a default, a credential when it has none.
type Location ¶ added in v0.0.3
type Location string
Location is where an argument is sent, serialized in the style OpenAPI defines for it there: simple in a path or header, form in a query or cookie, and deepObject for a query object. https://spec.openapis.org/oas/v3.2.0.html#style-values
func (*Location) UnmarshalText ¶ added in v0.0.3
type Operation ¶ added in v0.0.3
type Operation struct {
Name string `json:"name"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Method string `json:"method"`
Path string `json:"path"`
InputSchema json.RawMessage `json:"inputSchema"`
Parameters []Parameter `json:"parameters,omitempty"`
Body bool `json:"body,omitempty"`
Security Security `json:"security,omitempty"`
}
type Security ¶ added in v0.0.3
type Security []Credential