FastestMCP.ServerExtension (fastest_mcp v0.3.0)

Copy Markdown View Source

Declarative behavior for an executable MCP server extension.

This is deliberately separate from the open Server.extensions capability map. A server extension may contribute modern request/response methods, a negotiated tools/call interceptor, and one ordinary FastestMCP lifespan. The server builder validates ownership and lowers these declarations into the existing operation pipeline and lifespan machinery.

Summary

Functions

Builds one extension method declaration.

Builds an executable extension declaration.

Types

t()

@type t() :: %FastestMCP.ServerExtension{
  identifier: String.t(),
  lifespan: term() | nil,
  methods: [FastestMCP.ServerExtension.Method.t()],
  settings: map(),
  tool_interceptor:
    nil
    | (FastestMCP.Operation.t(), (FastestMCP.Operation.t() -> any()) -> any())
}

Functions

method(name, handler, opts \\ [])

Builds one extension method declaration.

new(identifier, opts \\ [])

Builds an executable extension declaration.