FastestMCP.Provider (fastest_mcp v0.1.2)

Copy Markdown View Source

Shared wrapper for provider-backed component sources.

Providers are how a server exposes components that do not live directly on the %FastestMCP.Server{} struct. Common examples are:

This module wraps provider implementations so the runtime can ask every provider the same questions:

  • what components do you expose?
  • can you resolve this identifier directly?
  • for a concrete resource URI, what is the backing target?
  • do you expose extra HTTP routes?

Transforms

A provider can also be wrapped with transforms. Transforms rewrite component identifiers on the way out and translate them back on the way in. That is how namespacing and tool renaming are applied without changing the underlying provider implementation.

Summary

Functions

Adds a transform to the current definition.

Resolves one component by type and identifier.

Resolves the backing resource target for a concrete URI.

Returns additional HTTP routes exposed by this provider.

Lists the components exposed by this module.

Builds a new value for this module from the supplied options.

Returns the component or provider type.

Types

inner()

@type inner() :: struct()

t()

@type t() :: %FastestMCP.Provider{inner: inner(), transforms: [struct()]}

Functions

add_transform(provider, transform)

Adds a transform to the current definition.

get_component(provider, component_type, identifier, operation)

Resolves one component by type and identifier.

get_resource_target(provider, uri, operation)

Resolves the backing resource target for a concrete URI.

http_routes(provider)

Returns additional HTTP routes exposed by this provider.

list_components(provider, component_type, operation)

Lists the components exposed by this module.

new(provider)

Builds a new value for this module from the supplied options.

type(provider)

Returns the component or provider type.