# OzMcp v0.9.0 - API Reference

## Modules

- Server
  - [OzMcp.Config.Server](OzMcp.Config.Server.md): Behaviour of a server module. A server module declares one MCP
server: its information, its capabilities and the modules of its
tools, resources, templates and prompts.
  - [OzMcp.Config.Server.DSL](OzMcp.Config.Server.DSL.md): Compile-time macros of a server module (`use OzMcp.Config.Server`).

- Entities
  - [OzMcp.Config.Prompt](OzMcp.Config.Prompt.md): Behaviour for MCP prompt modules.
  - [OzMcp.Config.Prompt.DSL](OzMcp.Config.Prompt.DSL.md): Compile-time macros of a prompt module (`use OzMcp.Config.Prompt`).
  - [OzMcp.Config.Resource](OzMcp.Config.Resource.md): Behaviour for MCP resource modules.
  - [OzMcp.Config.Resource.DSL](OzMcp.Config.Resource.DSL.md): Compile-time macros of a resource module (`use OzMcp.Config.Resource`).
  - [OzMcp.Config.Template](OzMcp.Config.Template.md): Behaviour for MCP resource template modules.
  - [OzMcp.Config.Template.DSL](OzMcp.Config.Template.DSL.md): Compile-time macros of a resource template module (`use
OzMcp.Config.Template`).
  - [OzMcp.Config.Tool](OzMcp.Config.Tool.md): Behaviour for MCP tool modules.
  - [OzMcp.Config.Tool.DSL](OzMcp.Config.Tool.DSL.md): Compile-time macros of a tool module (`use OzMcp.Config.Tool`).

- Runtime and transports
  - [OzMcp](OzMcp.md): OzMcp is an Elixir framework to write MCP servers. It supports the
revision `2025-11-25` of the Model Context Protocol only. The
[README](README.md), the main page of these docs, lists the guides.
  - [OzMcp.Instance](OzMcp.Instance.md): Supervisor of a single MCP server instance.
  - [OzMcp.Router](OzMcp.Router.md): HTTP endpoint of an MCP server: the Streamable HTTP transport.
  - [OzMcp.Transport.Stdio](OzMcp.Transport.Stdio.md): The MCP stdio transport: newline-delimited JSON-RPC on stdin and stdout.
  - [OzMcp.Transport.Stdio.Console](OzMcp.Transport.Stdio.Console.md): Puts the standard input and output of the process in a shape the stdio
transport can use.

- Callback API
  - [OzMcp.Client](OzMcp.Client.md): What a callback can ask of the client: input from the user (elicitation),
a model completion (sampling) and the roots of the client.
  - [OzMcp.Context](OzMcp.Context.md): The context of one JSON-RPC message and the `ctx` map that the
callbacks of the entities receive.
  - [OzMcp.LogLevel](OzMcp.LogLevel.md): The levels of `notifications/message` (RFC 5424 severities), from the
lowest to the highest.
  - [OzMcp.Notify](OzMcp.Notify.md): The notifications that a server sends to its clients.
  - [OzMcp.Outbound](OzMcp.Outbound.md): Requests the server sends to the client.
  - [OzMcp.Sessions](OzMcp.Sessions.md): The sessions of an instance: start, find, stop.
  - [OzMcp.Tasks](OzMcp.Tasks.md): The tasks of an instance (MCP 2025-11-25, "Tasks").
  - [OzMcp.Tasks.Context](OzMcp.Tasks.Context.md): Task helpers for tool authors.
  - [OzMcp.Utils.Error](OzMcp.Utils.Error.md): A JSON-RPC error that a callback returns.

- Authorization
  - [OzMcp.Auth](OzMcp.Auth.md): Contract for the token check of a protected MCP server.
  - [OzMcp.Auth.Challenge](OzMcp.Auth.Challenge.md): A refusal of a request. It becomes an HTTP status and a
`WWW-Authenticate` header value.

  - [OzMcp.Auth.Metadata](OzMcp.Auth.Metadata.md): Protected Resource Metadata (RFC 9728) of a protected MCP server.
  - [OzMcp.Auth.Principal](OzMcp.Auth.Principal.md): The authenticated caller.
  - [OzMcp.Auth.Scopes](OzMcp.Auth.Scopes.md): The scopes that a tool, a resource, a template or a prompt requires.
  - [OzMcp.Pipeline.Bound](OzMcp.Pipeline.Bound.md): The entity of a request, found by the bind stage of the pipeline
(OzMcp.Pipeline.Bind). The stage puts the struct in the field
`bound` of the context and the `authorize/3` callback of a verifier
receives it as its third argument.

- Stores
  - [OzMcp.PubSub](OzMcp.PubSub.md): The broadcast of the session notifications. The default implementation
(`OzMcp.PubSub.Registry`) uses a `Registry` of the instance. The option
`:pubsub` of `OzMcp` gives the module. A custom module can send the
messages through another system. OzMcp also has `OzMcp.PubSub.PG`,
which uses `:pg` and reaches the sessions of the connected nodes.
  - [OzMcp.PubSub.PG](OzMcp.PubSub.PG.md): An `OzMcp.PubSub` that uses `:pg` (Erlang process groups).
  - [OzMcp.PubSub.Registry](OzMcp.PubSub.Registry.md): The default `OzMcp.PubSub`: a duplicate `Registry` of the instance.
  - [OzMcp.Session.Snapshot](OzMcp.Session.Snapshot.md): The persistent part of a session, for a restart or a cluster. The
session process calls the module (the option `:session_snapshot` of
`OzMcp`). The default `OzMcp.Session.Snapshot.None` keeps nothing.
  - [OzMcp.Session.Snapshot.None](OzMcp.Session.Snapshot.None.md): The default snapshot module: no persistence.
  - [OzMcp.Tasks.EtsStore](OzMcp.Tasks.EtsStore.md): ETS record store of the tasks of one instance: the default store of
the option `:task_store` and it implements
`OzMcp.Tasks.StoreBehaviour`. One named table per instance (the
records table, `table/1`). The index of the records lives in
OzMcp.Tasks.Index: this store implements none of the optional
callbacks of the contract, so the facade OzMcp.Tasks.Records keeps
that index for it.
  - [OzMcp.Tasks.StoreBehaviour](OzMcp.Tasks.StoreBehaviour.md): The contract of a task store (the `:task_store` option of
`OzMcp`, default `OzMcp.Tasks.EtsStore`).

- Structs
  - [OzMcp.Structs.Annotations](OzMcp.Structs.Annotations.md): Helper module used to build `Annotations` structure.
  - [OzMcp.Structs.AudioContent](OzMcp.Structs.AudioContent.md): Helper module used to build `AudioContent` structure.
  - [OzMcp.Structs.BlobResourceContents](OzMcp.Structs.BlobResourceContents.md): Helper module used to build `BlobResourceContents` structure.
  - [OzMcp.Structs.BooleanSchema](OzMcp.Structs.BooleanSchema.md): Helper module used to build `BooleanSchema` structure: a yes/no field of
an elicitation form.
  - [OzMcp.Structs.CallToolResult](OzMcp.Structs.CallToolResult.md): Helper module used to build `CallToolResult` structure.
  - [OzMcp.Structs.CompleteResult](OzMcp.Structs.CompleteResult.md): Helper module used to build the `CompleteResult` structure.
  - [OzMcp.Structs.Completion](OzMcp.Structs.Completion.md): Helper module used to build the `Completion` structure.
  - [OzMcp.Structs.ContentBlock](OzMcp.Structs.ContentBlock.md): Helper module used to define the `ContentBlock` structure.
  - [OzMcp.Structs.CreateMessageRequestParams](OzMcp.Structs.CreateMessageRequestParams.md): Helper module used to build the params of a `sampling/createMessage`
request.
  - [OzMcp.Structs.CreateTaskResult](OzMcp.Structs.CreateTaskResult.md): Helper module used to build `CreateTaskResult` structure.
  - [OzMcp.Structs.ElicitRequestFormParams](OzMcp.Structs.ElicitRequestFormParams.md): Helper module used to build the params of an `elicitation/create` request
in form mode.
  - [OzMcp.Structs.ElicitRequestURLParams](OzMcp.Structs.ElicitRequestURLParams.md): Helper module used to build the params of an `elicitation/create` request
in URL mode: the user is sent to a web page, the data never passes
through the client.
  - [OzMcp.Structs.ElicitationSchema](OzMcp.Structs.ElicitationSchema.md): Helper module used to build the `requestedSchema` of a form elicitation:
a flat object whose properties are primitive fields.
  - [OzMcp.Structs.EmbeddedResource](OzMcp.Structs.EmbeddedResource.md): Helper module used to build `EmbeddedResource` structure.
  - [OzMcp.Structs.EnumOptions](OzMcp.Structs.EnumOptions.md): Helper module shared by `OzMcp.Structs.EnumSchema` and
`OzMcp.Structs.MultiSelectEnumSchema`.
  - [OzMcp.Structs.EnumSchema](OzMcp.Structs.EnumSchema.md): Helper module used to build a single-select enum field of an elicitation
form (`UntitledSingleSelectEnumSchema` or `TitledSingleSelectEnumSchema`).
  - [OzMcp.Structs.GetPromptResult](OzMcp.Structs.GetPromptResult.md): Helper module used to build `GetPromptResult` structure.
  - [OzMcp.Structs.Icon](OzMcp.Structs.Icon.md): Helper module used to build `Icon` structure.
  - [OzMcp.Structs.ImageContent](OzMcp.Structs.ImageContent.md): Helper module used to build `ImageContent` structure.
  - [OzMcp.Structs.Implementation](OzMcp.Structs.Implementation.md): Helper module used to build `Implementation` structure.
  - [OzMcp.Structs.InitializeResult](OzMcp.Structs.InitializeResult.md): Helper module used to build `InitializeResult` structure.
  - [OzMcp.Structs.ModelPreferences](OzMcp.Structs.ModelPreferences.md): Helper module used to build `ModelPreferences` structure: what the server
prefers when the client chooses a model. The client has the last word.
  - [OzMcp.Structs.MultiSelectEnumSchema](OzMcp.Structs.MultiSelectEnumSchema.md): Helper module used to build a multi-select enum field of an elicitation
form (`UntitledMultiSelectEnumSchema` or `TitledMultiSelectEnumSchema`).
  - [OzMcp.Structs.NotificationParams](OzMcp.Structs.NotificationParams.md): Helper module used to build `NotificationParams` structure.
  - [OzMcp.Structs.NumberSchema](OzMcp.Structs.NumberSchema.md): Helper module used to build `NumberSchema` structure: a numeric field of
an elicitation form. The type is `number` by default; use `type/2` with
`:integer` for a whole number.
  - [OzMcp.Structs.Prompt](OzMcp.Structs.Prompt.md): Helper module used to build `Prompt` structure.
  - [OzMcp.Structs.PromptArgument](OzMcp.Structs.PromptArgument.md): Helper module used to build `PromptArgument` structure.
  - [OzMcp.Structs.PromptMessage](OzMcp.Structs.PromptMessage.md): Helper module used to build `PromptMessage` structure.
  - [OzMcp.Structs.ReadResourceResult](OzMcp.Structs.ReadResourceResult.md): Helper module used to build `ReadResourceResult` structure.
  - [OzMcp.Structs.RelatedTaskMetadata](OzMcp.Structs.RelatedTaskMetadata.md): Helper module used to build `RelatedTaskMetadata` structure.
  - [OzMcp.Structs.Resource](OzMcp.Structs.Resource.md): Helper module used to build `Resource` structure.
  - [OzMcp.Structs.ResourceContents](OzMcp.Structs.ResourceContents.md): Helper module used to define the `ResourceContents` structure.
  - [OzMcp.Structs.ResourceLink](OzMcp.Structs.ResourceLink.md): Helper module used to build `ResourceLink` structure.
  - [OzMcp.Structs.ResourceTemplate](OzMcp.Structs.ResourceTemplate.md): Helper module used to build `ResourceTemplate` structure.
  - [OzMcp.Structs.Root](OzMcp.Structs.Root.md): Helper module used to build `Root` structure: a directory or file the
client lets the server work in.
  - [OzMcp.Structs.SamplingMessage](OzMcp.Structs.SamplingMessage.md): Helper module used to build `SamplingMessage` structure: a message of the
conversation the server asks the client to complete.
  - [OzMcp.Structs.ServerCapabilities](OzMcp.Structs.ServerCapabilities.md): Helper module used to build `ServerCapabilities` structure.
  - [OzMcp.Structs.StringSchema](OzMcp.Structs.StringSchema.md): Helper module used to build `StringSchema` structure: a text field of an
elicitation form.
  - [OzMcp.Structs.Task](OzMcp.Structs.Task.md): Helper module used to build `Task` structure.
  - [OzMcp.Structs.TaskMetadata](OzMcp.Structs.TaskMetadata.md): Helper module used to build `TaskMetadata` structure.
  - [OzMcp.Structs.TextContent](OzMcp.Structs.TextContent.md): Helper module used to build `TextContent` structure.
  - [OzMcp.Structs.TextResourceContents](OzMcp.Structs.TextResourceContents.md): Helper module used to build `TextResourceContents` structure.
  - [OzMcp.Structs.Tool](OzMcp.Structs.Tool.md): Helper module used to build `Tool` structure.
  - [OzMcp.Structs.ToolAnnotations](OzMcp.Structs.ToolAnnotations.md): Helper module used to build `ToolAnnotations` structure.
  - [OzMcp.Structs.ToolChoice](OzMcp.Structs.ToolChoice.md): Helper module used to build `ToolChoice` structure: how the model uses the
tools of a sampling request.
  - [OzMcp.Structs.ToolExecution](OzMcp.Structs.ToolExecution.md): Helper module used to build `ToolExecution` structure.
  - [OzMcp.Structs.ToolResultContent](OzMcp.Structs.ToolResultContent.md): Helper module used to build `ToolResultContent` structure: the result of a
tool call, inside a sampling message.
  - [OzMcp.Structs.ToolUseContent](OzMcp.Structs.ToolUseContent.md): Helper module used to build `ToolUseContent` structure: a request of the
model to call a tool, inside a sampling message.
  - [OzMcp.Structs.Types](OzMcp.Structs.Types.md): Helper module used to define shared types for the `OzMcp.Structs` modules.

- Testing
  - [OzMcp.Testing](OzMcp.Testing.md): A client for the tests of an MCP server. It starts the server in the
test, opens a session through `OzMcp.Router` and gives the answers as
a client reads them.

## Mix Tasks

- Runtime and transports
  - [mix oz_mcp.stdio](Mix.Tasks.OzMcp.Stdio.md): Runs an MCP server on the stdio transport, for a local client that
starts this command as a subprocess.

