Skip to main content

Module http

Module http 

Source
Expand description

HTTP backend primitives for config-driven OpenAPI MCP servers (Phase 90).

Gated behind the opt-in http feature so the curated / no-http toolkit build stays light (RESEARCH Pitfall 4). HTTP backend primitives for config-driven OpenAPI MCP servers.

This module is the backend seam the single-call synthesizer (Plan 03), the code-mode executor (Plan 04), and the binary dispatch (Plan 06) build on. It mirrors crate::sql in shape:

  • HttpConnector — the #[async_trait] Send + Sync + 'static trait that executes a REST Operation and returns JSON (analog of SqlConnector).
  • HttpConnectorError — the #[non_exhaustive] error enum whose Display reaches MCP clients and therefore MUST NOT echo credentials or URLs (analog of ConnectorError, mirrors its Connection Security doc-comment).
  • Operation / [Parameter] / [ParameterLocation] — the request model the trait signature needs. AUTHORITATIVE in [schema] (the openapiv3 parser is their producer) and re-exported here so the trait signature and every later plan reference one stable type path (Plan 03 / OAPI-02).
  • [join_url] — the ONE shared base_url + path concatenation helper. Both [client::HttpClient] (this plan) and Plan 04’s HttpCodeExecutor call it instead of re-inlining the trim logic — it preserves an API-Gateway stage prefix (/v1) where Url::join would silently drop it (Pitfall 2).

The whole module is gated behind the opt-in http feature so the curated / no-http toolkit build stays light (RESEARCH Pitfall 4).

Modules§

auth
Authentication providers for OUTGOING HTTP requests (OAPI-03 / D-05). Authentication providers for OUTGOING HTTP requests (OAPI-03 / D-05 / H1).
client
reqwest-backed HttpConnector implementation (OAPI-01). reqwest-backed HttpConnector implementation (OAPI-01).
schema
OpenAPI schema parsing seam — forward stub filled by Plan 03 (OAPI-02). OpenAPI schema parser — the AUTHORITATIVE home of Operation (OAPI-04).

Structs§

HttpClient
reqwest-backed HttpConnector.
HttpConfig
HTTP client configuration (OWNED here in http, mirroring super::AuthConfig ownership so Plan 02 re-exports it rather than redefining).
OpenApiSchema
A parsed OpenAPI document with its Operation values indexed by (path, METHOD) (OAPI-04 / D-03).
Operation
An extracted REST operation backed by an OpenAPI definition.
Parameter
A single OpenAPI operation parameter.

Enums§

AuthConfig
Outgoing-HTTP authentication configuration (OAPI-03 / D-05).
HttpConnectorError
Errors an HttpConnector implementation may surface.
ParameterLocation
Where an Operation parameter is carried in the outgoing request.

Traits§

HttpAuthProvider
Outbound HTTP authentication provider (OAPI-03).
HttpConnector
Backend-agnostic HTTP connector trait (OAPI-01).

Functions§

create_auth_provider
create_passthrough_auth_provider
Build an auth provider, capturing an incoming_token for the AuthConfig::OAuthPassthrough per-request path (H1).