Documentation
¶
Overview ¶
Package http implements a single-tool HTTP source. Connect takes a `connect:` map carrying a description, URL, HTTP method, and optional headers, validates the configuration, and returns one MCP tool ("http") that proxies the configured endpoint.
The output schema is intentionally permissive (`{"type": "object"}`) because the source returns the upstream response body verbatim as raw JSON; the caller is expected to know the response shape.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect( _ context.Context, connect map[string]any, opts ...tool.Option, ) (tool.Response, error)
Connect decodes the source's `connect:` map, validates the configuration, and returns the single http tool. The tool's Annotations are derived from the HTTP method: safe methods (GET, HEAD, OPTIONS, TRACE) set ReadOnlyHint: true; mutating methods set ReadOnlyHint: false with DestructiveHint: new(true).
Types ¶
type HTTPToolRequest ¶
type HTTPToolRequest struct {
Body any `json:"body,omitempty"`
Query map[string]string `json:"query,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Form map[string]string `json:"form,omitempty"`
}
HTTPToolRequest is the request shape accepted by the http tool.
type HTTPToolResponse ¶
type HTTPToolResponse = json.RawMessage
HTTPToolResponse is the response shape: the raw JSON body returned by the upstream endpoint.