API

The public surface

Every type, function, method and value moonmcp exposes, drawn straight from the compiled package interfaces. Generated from source — it cannot drift from the code.

Three capability kinds give the reference its colours: tools, resources, prompts. Everything else is the server, the wire, or the errors in between.

MCP 2026-07-28 · 2025-11-25 · 2024-11-05 · Streamable HTTP · stdio

Facade

The names a server is written with. Re-exports the server and the three capability types, plus argument decoding.

Documentation page

The page a server serves beside its endpoint, listing what it offers and calling it, in two looks.

fn
pub fn page(endpoint? : String, theme? : Theme) -> String

The page as HTML, for a server whose endpoint answers at endpoint: a path on the same origin, or an absolute URL. It lists the tools, resources, resource templates and prompts the server offers and calls them over the endpoint, showing the JSON-RPC request it built and the reply it got back, in either era of the protocol, chosen on the page. Server::to_asgi serves it at /docs unless told otherwise; this hands the same document to a router of your own.

let
pub let theme : Theme

The look page and Server::to_asgi use unless told otherwise: the one the moonmcp website wears.

enum
pub(all) enum Theme { Site Plain } derive(Eq, @debug.Debug)

The two looks the page comes in.

fn
pub fn Theme::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Theme::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Theme::to_repr(Self) -> @debug.Repr

Debug representation of this value.

Server

One server holds tools, resources, templates and prompts, and speaks both protocol eras over Streamable HTTP and stdio.

fn
pub fn[T : @json.FromJson] decode(Map[String, Json], String) -> T raise @json.JsonDecodeError

The argument name of a call, read as T; the code #mcp.tool generates calls this for each required parameter. A string read where something else is wanted is read again as JSON, which is how the {id} of a resource template, always text, reaches an Int parameter.

fn
pub fn[T : @json.FromJson] decode_option(Map[String, Json], String) -> T? raise @json.JsonDecodeError

The argument name of a call when it may be left out: None when it is missing or null, else the value read as decode reads it. The code #mcp.tool generates calls this for optional parameters.

enum
pub(all) enum Scope { Public Private } derive(Eq, @debug.Debug)

Who may keep a cached list result: any intermediary, or only caches inside the same authorisation context (the cacheScope of a cacheable result).

fn
pub fn Scope::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Scope::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Scope::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub struct Server { info : @types.Implementation instructions : String? ttl_ms : Int32 scope : Scope

An MCP server: the tools, resources, resource templates and prompts it offers, and who it says it is. It speaks both eras of the protocol. A request carrying its protocol version in _meta is served statelessly under the 2026-07-28 revision; an initialize request opens the handshake of the revisions before it. The same server is reached over Streamable HTTP with to_asgi, over stdio with run_stdio, or by any transport of your own through handle. ttl_ms and scope are the caching hints every list result carries under the 2026-07-28 revision. The presets say "stale at once" and "this caller only", the cautious end of both, since a server that changes what it lists per caller would otherwise leak one caller's list to the next.

fn
pub fn Server::add_prompt(Self, @prompts.Prompt) -> Unit

Offer prompt. A second prompt under the same name replaces the first.

fn
pub fn Server::add_resource(Self, @resources.Resource) -> Unit

Offer resource at its URI. A second resource at the same URI replaces the first.

fn
pub fn Server::add_template(Self, @resources.ResourceTemplate) -> Unit

Offer template; a URI no fixed resource answers is matched against the templates in the order they were added.

fn
pub fn Server::add_tool(Self, @tools.Tool) -> Unit

Offer tool. Its input schema is compiled here, so a call is checked against it before the tool runs. A schema that does not compile is a mistake in the program, not in a request, so it aborts now rather than failing the first call. A second tool under the same name replaces the first.

fn
pub async fn Server::handle(Self, Json) -> Json?

Answer one JSON-RPC message, the way every transport does (← the low-level server's message loop). None is the answer to a notification. A message that is not JSON-RPC at all is answered with the error JSON-RPC prescribes, under a null id.

fn
pub fn Server::new(String, version? : String, title? : String, instructions? : String, ttl_ms? : Int32, scope? : Scope) -> Self

Construct a value with the given fields.

fn
pub fn Server::prompt(Self, String, async (Map[String, Json]) -> String, title? : String, description? : String, arguments? : Array[@types.PromptArgument]) -> Unit

Offer a prompt rendered as one user message (← @mcp.prompt).

fn
pub fn Server::resource(Self, String, async () -> String, name? : String, title? : String, description? : String, mime_type? : String) -> Unit

Offer a resource read as text (← @mcp.resource(uri)).

fn
pub async fn Server::serve_lines(Self, async () -> String?, async (String) -> Unit) -> Unit

Serve newline-delimited JSON-RPC: read a line with read until it gives None, answer it, and write the reply as one line (← the stdio transport, over any pair of streams). A line that is not JSON is answered with a parse error; a blank one is skipped. Requests are answered one at a time, in the order they arrive.

fn
pub fn Server::template(Self, String, async (Map[String, Json]) -> String, name? : String, title? : String, description? : String, mime_type? : String) -> Unit

Offer the resources an RFC 6570 template names, read as text with the parameters the URI matched (← @mcp.resource("users://{id}")). A template that does not parse aborts at registration.

fn
pub fn Server::to_asgi(Self, path? : String, origins? : Array[String], docs? : String?, theme? : @docs.Theme) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit

The server as an ASGI application serving the MCP endpoint at path. Run it with mooncat, or mount it beside a moonapi app. Every message is its own POST, answered with one JSON object, or 202 for a notification. Sessions, the GET stream and DELETE belong to the revisions before 2026-07-28 and are optional there; this server keeps no session, so GET and DELETE answer 405. A request whose Origin header names another site is refused with 403, as the transport requires against DNS rebinding. An origin passes when its host is the request's own Host, a loopback address, or one listed in origins. docs names the path the documentation page is served at, beside the endpoint: a browser opened on it lists what the server offers and calls it, in both eras of the protocol. It is on at /docs unless told otherwise, as an API framework's interactive docs are; docs=None leaves it off, and a path equal to the endpoint's is ignored. theme picks its look, the moonmcp website's by default. The page carries no credentials of its own.

fn
pub fn Server::tool(Self, String, async (Map[String, Json]) -> Json, input_schema? : Json, title? : String, description? : String, output_schema? : Json, annotations? : @types.ToolAnnotations) -> Unit

Offer a tool whose handler returns any JSON value (← @mcp.tool). An object becomes structured content as well as text; anything else becomes text. An error the handler raises becomes a result marked isError, which the model reads and can correct itself from. A name the protocol does not allow aborts at registration.

fn
pub async fn Server::run_stdio(self : Server) -> Unit

Serve over the process's standard input and output: one message per line each way, until standard input closes. Anything else the program prints belongs on standard error, since standard output carries nothing but messages.

Tools

A tool: a handler, an input schema, and a typed result.

fn
pub fn convert_to_content(Json) -> Array[@types.ContentBlock] raise @json.JsonDecodeError

Convert a raw result to a sequence of content blocks.

fn
pub fn default_title(String) -> String

A title derived from a tool name.

fn
pub fn is_valid_tool_name(String) -> Bool

Whether a tool name is valid per the MCP specification (SEP-986): 1-64 characters of letters, digits, underscores and hyphens.

struct
pub(all) struct Tool { component : @component.ComponentBase parameters : Json output_schema : Json? annotations : @types.ToolAnnotations? execution : @types.ToolExecution? timeout : Double? run_fn : async (Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError }

A registered tool.

fn
pub fn Tool::base(Self) -> @component.ComponentBase

The shared component metadata.

fn
pub fn Tool::convert_result(Self, Json) -> ToolResult raise @exceptions.FastMCPError

Convert a raw return value to a ToolResult, honouring the declared output schema.

fn
pub async fn Tool::dispatch(Self, Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError

Server entry point for tool execution; subclasses customise dispatch by supplying a different run_fn at construction.

fn
pub fn Tool::get_meta(Self) -> Map[String, Json]

Arbitrary metadata carried with the component.

fn
pub fn Tool::identifier(Self) -> String

The stable identifier used in listings.

fn
pub fn Tool::key(Self) -> String

The de-duplication key used in the registry.

fn
pub fn Tool::new(String, parameters~ : Json, run_fn~ : async (Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.ToolAnnotations, output_schema? : Json, execution? : @types.ToolExecution, timeout? : Double, task_config? : @tasks.TaskConfig) -> Self raise @exceptions.FastMCPError

Register a tool. parameters is the JSON schema of its arguments and run_fn executes it.

fn
pub async fn Tool::run(Self, Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError

Run the tool with arguments.

fn
pub fn Tool::to_mcp_tool(Self) -> @types.Tool

Convert the tool to its wire representation. Title precedence: explicit title, then annotation title, then a title derived from the name.

item
pub impl @component.Component for Tool

A public item of this server framework.

struct
pub(all) struct ToolResult { content : Array[@types.ContentBlock] structured_content : Map[String, Json]? meta : Map[String, Json]? is_error : Bool raw_mcp_result : @types.CallToolResult? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)

The canonical result of running a tool.

fn
pub fn ToolResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ToolResult::from_mcp_result(@types.CallToolResult) -> Self

Wrap a protocol result while preserving its exact wire representation.

fn
pub fn ToolResult::input_required(@types.InputRequiredResult) -> Self

Wrap a client-input ask (SEP-2322) as an ordinary tool result.

fn
pub fn ToolResult::is_input_required(Self) -> Bool

Whether this result carries a client-input ask (SEP-2322).

fn
pub fn ToolResult::new(content? : Array[@types.ContentBlock], structured_content? : Map[String, Json], meta? : Map[String, Json], is_error? : Bool) -> Self raise @exceptions.FastMCPError

Register a tool. parameters is the JSON schema of its arguments and run_fn executes it.

fn
pub fn ToolResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ToolResult::to_mcp_result(Self) -> @types.CallToolResult

Convert to the protocol result, keeping the original wire representation when one was preserved.

fn
pub fn ToolResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

Resources

A resource: a URI and a reader. Templates fill a URI pattern from arguments.

fn
pub fn contains_path_traversal(String) -> Bool

Whether value contains .. as a path component, considering both separators. Dots inside a single segment are not traversal.

fn
pub fn convert_raw_to_resource_result(RawResourceValue, mime_type? : String, meta? : Map[String, Json]) -> ResourceResult

Wrap a resource function's return value in a ResourceResult. Shared by Resource and ResourceTemplate so both honour the MIME type the component declares in listings: a component that advertises text/csv must not serve text/plain on read.

fn
pub fn encode_literal(String) -> String

A public item of this server framework.

fn
pub fn expand_uri_template(String, Map[String, Json]) -> String

Expand a URI template with parameters — the inverse of match_uri_template. Params use underscored keys but templates may use hyphens, so both spellings are tried.

fn
pub fn extract_exploded_query_params(String) -> Array[String]

Extract query parameter names declared with the explode modifier: {?tags*} marks tags as repeatable.

fn
pub fn extract_query_params(String) -> Array[String]

Extract query parameter names from RFC 6570 {?param1,param2} syntax. The explode modifier is stripped, so {?tags*} yields tags.

fn
pub fn forward_uri(String, Map[String, Json], String) -> String

Build the URI a forwarding layer (mount or proxy) sends to the server behind it: the path is expanded from the template, but the query string is carried over from the incoming URI byte for byte.

fn
pub fn is_absolute_path(String) -> Bool

Whether value looks like an absolute filesystem path: rooted at / or \\, UNC-prefixed, or a Windows drive letter path.

fn
pub fn match_uri_template(String, String, list_params? : Array[String], segments? : Array[TemplateSegment]) -> Map[String, Json]?

Match a URI against a template and extract both path and query parameters, percent-decoded. list_params names non-exploded query parameters that hold lists; their first value is comma-split per RFC 6570 section 3.2.8. Pass pre-parsed segments when the caller already holds them.

fn
pub fn parse_template(String) -> Array[TemplateSegment]

Parse the path portion of a URI template into literal and variable segments; query blocks are dropped for path matching.

fn
pub fn parse_template_params(String) -> @set.Set[String]

All parameter names a template declares, hyphens normalised to underscores, path and query parameters combined.

fn
pub fn pct_encode(String, safe? : String) -> String

A public item of this server framework.

fn
pub fn resolve_security(ResourceSecuritySetting, ResourceSecurity?) -> ResourceSecurity?

Resolve the effective security policy for this template.

enum
pub(all) enum ContentPayload { Text(String) Blob(Bytes) } derive(Eq, @debug.Debug)

The payload of a resource content item: inline text or raw bytes.

fn
pub fn ContentPayload::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ContentPayload::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ContentPayload::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum RawResourceValue { Text(String) Blob(Bytes) Ready(ResourceResult) }

What a resource read function may return: text, bytes or a full result.

struct
pub(all) struct Resource { component : @component.ComponentBase uri : String mime_type : String annotations : @types.Annotations? read_fn : async () -> RawResourceValue raise @exceptions.FastMCPError }

A registered resource.

fn
pub fn Resource::base(Self) -> @component.ComponentBase

The shared component metadata.

fn
pub fn Resource::binary(String, data~ : Bytes, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self

A resource backed by inline bytes.

fn
pub fn Resource::convert_result(Self, RawResourceValue) -> ResourceResult

Convert a raw result to a ResourceResult, forwarding the template's declared MIME type so reads match what it advertises in listings.

fn
pub fn Resource::from_function(String, read_fn~ : async () -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self

A resource backed by a closure computing its value on read.

fn
pub fn Resource::get_meta(Self) -> Map[String, Json]

Arbitrary metadata carried with the component.

fn
pub fn Resource::identifier(Self) -> String

The stable identifier used in listings.

fn
pub fn Resource::key(Self) -> String

The de-duplication key used in the registry.

fn
pub fn Resource::new(String, read_fn~ : async () -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self

Register a resource template; read_fn receives the parameters matched from the request URI.

fn
pub async fn Resource::read(Self) -> RawResourceValue raise @exceptions.FastMCPError

Read the resource content with the matched parameters.

fn
pub async fn Resource::read_result(Self) -> ResourceResult raise @exceptions.FastMCPError

Server entry point for template reads.

fn
pub fn Resource::text(String, text~ : String, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self

A resource backed by inline text.

fn
pub fn Resource::to_mcp_resource(Self) -> @types.Resource

Convert the resource to its wire representation.

item
pub impl @component.Component for Resource

A public item of this server framework.

struct
pub(all) struct ResourceContent { content : ContentPayload mime_type : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A single resource content item with optional MIME type and metadata.

fn
pub fn ResourceContent::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceContent::new(ContentPayload, mime_type? : String, meta? : Map[String, Json]) -> Self

Register a resource template; read_fn receives the parameters matched from the request URI.

fn
pub fn ResourceContent::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceContent::to_mcp_resource_contents(Self, String) -> @types.ResourceContents

Convert to the wire resource contents type; bytes are base64-encoded.

fn
pub fn ResourceContent::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct ResourceResult { contents : Array[ResourceContent] meta : Map[String, Json]? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)

The canonical result of a resource read.

fn
pub fn ResourceResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceResult::input_required(@types.InputRequiredResult) -> Self

Wrap a client-input ask (SEP-2322) as an ordinary resource result.

fn
pub fn ResourceResult::is_input_required(Self) -> Bool

Whether this result carries a client-input ask (SEP-2322).

fn
pub fn ResourceResult::new(Array[ResourceContent], meta? : Map[String, Json]) -> Self

Register a resource template; read_fn receives the parameters matched from the request URI.

fn
pub fn ResourceResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceResult::to_mcp_result(Self, String) -> @types.ReadResourceResult

Convert to the wire read-resource result.

fn
pub fn ResourceResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct ResourceSecurity { reject_path_traversal : Bool reject_absolute_paths : Bool reject_null_bytes : Bool exempt_params : @set.Set[String] } derive(Eq, @debug.Debug)

Security policy applied to extracted resource template parameters. The checks run after a URI has matched a template and its parameter values have been extracted and percent-decoded; they catch path-traversal and absolute-path injection regardless of how the value was encoded in the URI.

fn
pub fn ResourceSecurity::default() -> Self

Secure-by-default policy: traversal, absolute paths and null bytes all rejected.

fn
pub fn ResourceSecurity::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceSecurity::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceSecurity::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn ResourceSecurity::validate(Self, Map[String, Json]) -> String?

Check all parameter values against the policy. String values (and lists of strings, from wildcard parameters) are screened; non-string values are ignored. Returns the name of the first failing parameter, if any.

enum
pub(all) enum ResourceSecuritySetting { Inherit Explicit(ResourceSecurity) Disabled } derive(Eq, @debug.Debug)

Per-component security setting: inherit the server-wide default, apply an explicit policy, or disable screening.

fn
pub fn ResourceSecuritySetting::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceSecuritySetting::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceSecuritySetting::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct ResourceTemplate { component : @component.ComponentBase uri_template : String mime_type : String parameters : Json annotations : @types.Annotations? security : ResourceSecuritySetting list_query_params : @set.Set[String] segments : Array[TemplateSegment] read_fn : async (Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError }

A template for dynamically creating resources.

fn
pub fn ResourceTemplate::base(Self) -> @component.ComponentBase

The shared component metadata.

fn
pub fn ResourceTemplate::convert_result(Self, RawResourceValue) -> ResourceResult

Convert a raw result to a ResourceResult, forwarding the template's declared MIME type so reads match what it advertises in listings.

fn
pub fn ResourceTemplate::create_resource(Self, String, Map[String, Json]) -> Resource

Create a concrete resource from the template for the given parameters.

fn
pub fn ResourceTemplate::from_mcp_template(@types.ResourceTemplate) -> Self raise @exceptions.FastMCPError

Create a template from a raw wire template, for remote servers whose original function is lost.

fn
pub fn ResourceTemplate::get_meta(Self) -> Map[String, Json]

Arbitrary metadata carried with the component.

fn
pub fn ResourceTemplate::identifier(Self) -> String

The stable identifier used in listings.

fn
pub fn ResourceTemplate::key(Self) -> String

The de-duplication key used in the registry.

fn
pub fn ResourceTemplate::matches(Self, String, ResourceSecurity?) -> Map[String, Json]? raise @exceptions.FastMCPError

Check if a URI matches this template and extract its parameters, screening extracted values against the effective security policy.

fn
pub fn ResourceTemplate::new(String, parameters~ : Json, read_fn~ : async (Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations, security? : ResourceSecuritySetting, list_query_params? : @set.Set[String]) -> Self raise @exceptions.FastMCPError

Register a resource template; read_fn receives the parameters matched from the request URI.

fn
pub async fn ResourceTemplate::read(Self, Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError

Read the resource content with the matched parameters.

fn
pub async fn ResourceTemplate::read_result(Self, String, Map[String, Json]) -> ResourceResult raise @exceptions.FastMCPError

Server entry point for template reads.

fn
pub fn ResourceTemplate::resolve_security(Self, ResourceSecurity?) -> ResourceSecurity?

Resolve the effective security policy for this template.

fn
pub fn ResourceTemplate::to_mcp_template(Self) -> @types.ResourceTemplate

Convert the template to its wire representation.

item
pub impl @component.Component for ResourceTemplate

A public item of this server framework.

enum
pub(all) enum TemplateSegment { Literal(Array[Char]) PathVar(name~ : String, wildcard~ : Bool) }

One parsed chunk of a template's path portion.

Prompts

A prompt: a renderer that turns arguments into messages.

struct
pub(all) struct Message { role : @types.Role content : @types.ContentBlock } derive(Eq, @debug.Debug)

A wrapper for a prompt message with a role.

fn
pub fn Message::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Message::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Message::of_content(@types.ContentBlock, role? : @types.Role) -> Self

Create a message from an existing content block, user role by default.

fn
pub fn Message::text(String, role? : @types.Role) -> Self

Create a message from plain text, user role by default.

fn
pub fn Message::to_mcp_prompt_message(Self) -> @types.PromptMessage

Convert to the wire prompt message.

fn
pub fn Message::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct Prompt { component : @component.ComponentBase arguments : Array[@types.PromptArgument]? render_fn : async (Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError }

A prompt template that can be rendered with arguments.

fn
pub fn Prompt::base(Self) -> @component.ComponentBase

The shared component metadata.

fn
pub fn Prompt::convert_result(Self, RenderedPrompt) -> PromptResult

Convert a rendered value to a canonical result.

fn
pub fn Prompt::get_meta(Self) -> Map[String, Json]

Arbitrary metadata carried with the component.

fn
pub fn Prompt::identifier(Self) -> String

The stable identifier used in listings.

fn
pub fn Prompt::key(Self) -> String

The de-duplication key used in the registry.

fn
pub fn Prompt::new(String, render_fn~ : async (Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], arguments? : Array[@types.PromptArgument]) -> Self

Register a prompt; render_fn renders it with the given arguments.

fn
pub async fn Prompt::render(Self, Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError

Render the prompt with arguments.

fn
pub async fn Prompt::render_result(Self, Map[String, Json]) -> PromptResult raise @exceptions.FastMCPError

Server entry point for prompt rendering.

fn
pub fn Prompt::to_mcp_prompt(Self) -> @types.Prompt

Convert the prompt to its wire representation.

item
pub impl @component.Component for Prompt

A public item of this server framework.

struct
pub(all) struct PromptResult { messages : Array[Message] description : String? meta : Map[String, Json]? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)

The canonical result of rendering a prompt.

fn
pub fn PromptResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn PromptResult::input_required(@types.InputRequiredResult) -> Self

Wrap a client-input ask (SEP-2322) as an ordinary prompt result.

fn
pub fn PromptResult::is_input_required(Self) -> Bool

Whether this result carries a client-input ask (SEP-2322).

fn
pub fn PromptResult::new(Array[Message], description? : String, meta? : Map[String, Json]) -> Self

Register a prompt; render_fn renders it with the given arguments.

fn
pub fn PromptResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn PromptResult::to_mcp_prompt_result(Self) -> @types.GetPromptResult

Convert to the wire get-prompt result.

fn
pub fn PromptResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum RenderedPrompt { Text(String) Messages(Array[Message]) Ready(PromptResult) }

What a prompt's render function may return: plain text, a message list, or an already-assembled result.

Wire types

The JSON-RPC and MCP data shapes, method constants and protocol-version helpers shared with the wire.

let
pub let client_capabilities_meta_key : String

A constant value.

let
pub let client_info_meta_key : String

A constant value.

fn
pub fn client_request_frame(RequestId, ClientRequest) -> Json

A public item of this server framework.

fn
pub fn core_result_types() -> Array[String]

Result type names that may appear as the resultType of a discover reply.

fn
pub fn handshake_protocol_versions() -> Array[String]

A public item of this server framework.

let
pub let internal_error : Int32

A constant value.

let
pub let invalid_params : Int32

A constant value.

let
pub let invalid_request : Int32

A constant value.

let
pub let latest_protocol_version : String

The protocol version this implementation speaks.

fn
pub fn logging_level_from_wire(String) -> LoggingLevel?

A public item of this server framework.

let
pub let method_completion_complete : String

A constant value.

let
pub let method_elicitation_create : String

A constant value.

let
pub let method_elicitation_create_form : String

A constant value.

let
pub let method_initialize : String

Canonical JSON-RPC method and notification names.

let
pub let method_input_response : String

A constant value.

let
pub let method_logging_set_level : String

A constant value.

let
pub let method_not_found : Int32

A constant value.

let
pub let method_ping : String

A constant value.

let
pub let method_prompts_get : String

A constant value.

let
pub let method_prompts_list : String

A constant value.

let
pub let method_resources_list : String

A constant value.

let
pub let method_resources_read : String

A constant value.

let
pub let method_resources_subscribe : String

A constant value.

let
pub let method_resources_unsubscribe : String

A constant value.

let
pub let method_roots_list : String

A constant value.

let
pub let method_sampling_create_message : String

A constant value.

let
pub let method_server_discover : String

A constant value.

let
pub let method_tools_call : String

A constant value.

let
pub let method_tools_list : String

A constant value.

fn
pub fn modern_protocol_versions() -> Array[String]

Protocol versions with modern semantics (used for capability gating).

let
pub let notification_cancelled : String

A constant value.

let
pub let notification_initialized : String

A constant value.

let
pub let notification_message : String

A constant value.

let
pub let notification_progress : String

A constant value.

let
pub let notification_prompt_list_changed : String

A constant value.

let
pub let notification_resource_list_changed : String

A constant value.

let
pub let notification_resource_updated : String

A constant value.

let
pub let notification_roots_list_changed : String

A constant value.

let
pub let notification_tool_list_changed : String

A constant value.

fn
pub fn parse_client_request(Json) -> ClientRequest raise @json.JsonDecodeError

Decode a request frame into a typed ClientRequest.

let
pub let parse_error : Int32

JSON-RPC error codes defined by the MCP specification.

fn
pub fn parse_message(Json) -> JSONRPCMessage raise @json.JsonDecodeError

Parse one wire frame.

fn
pub fn parse_server_request(Json) -> ServerRequest raise @json.JsonDecodeError

Decode a request frame into a typed ServerRequest.

let
pub let protocol_version_meta_key : String

A constant value.

fn
pub fn role_from_wire(String) -> Role?

A public item of this server framework.

let
pub let server_info_meta_key : String

Request _meta keys used to propagate session facts.

fn
pub fn server_request_frame(RequestId, ServerRequest) -> Json

A public item of this server framework.

fn
pub fn text_block(String) -> ContentBlock

Shorthand for a plain text block without annotations.

struct
pub(all) struct Annotations { audience : Array[String]? priority : Double? } derive(Eq, @debug.Debug)

Audience and priority hints attached to content.

fn
pub fn Annotations::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Annotations::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Annotations::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Annotations::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Annotations::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Annotations

A public item of this server framework.

item
pub impl @json.FromJson for Annotations

A public item of this server framework.

struct
pub(all) struct CallToolRequestParams { name : String arguments : Map[String, Json]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

tools/call request parameters.

fn
pub fn CallToolRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CallToolRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CallToolRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CallToolRequestParams::progress_token(Self) -> String?

The progress token carried in the request meta.

fn
pub fn CallToolRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CallToolRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CallToolRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for CallToolRequestParams

A public item of this server framework.

struct
pub(all) struct CallToolResult { content : Array[ContentBlock] structured_content : Map[String, Json]? is_error : Bool cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a tools/call call.

fn
pub fn CallToolResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CallToolResult::error(String) -> Self

Build an error result with the given message.

fn
pub fn CallToolResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CallToolResult::new(Array[ContentBlock]) -> Self

Construct a value with the given fields.

fn
pub fn CallToolResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CallToolResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CallToolResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CallToolResult

A public item of this server framework.

item
pub impl @json.FromJson for CallToolResult

A public item of this server framework.

struct
pub(all) struct CancelledNotificationParams { request_id : RequestId reason : String? } derive(Eq, @debug.Debug)

A cancelled request, sent by the side that issued it.

fn
pub fn CancelledNotificationParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CancelledNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CancelledNotificationParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CancelledNotificationParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CancelledNotificationParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CancelledNotificationParams

A public item of this server framework.

item
pub impl @json.FromJson for CancelledNotificationParams

A public item of this server framework.

struct
pub(all) struct ClientCapabilities { experimental : Map[String, Json]? roots_list_changed : Bool? sampling : Bool? elicitation : Bool? tasks : Bool? } derive(Eq, @debug.Debug)

What a client supports.

fn
pub fn ClientCapabilities::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ClientCapabilities::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ClientCapabilities::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ClientCapabilities::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ClientCapabilities::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ClientCapabilities

A public item of this server framework.

item
pub impl @json.FromJson for ClientCapabilities

A public item of this server framework.

enum
pub(all) enum ClientRequest { Initialize(InitializeRequestParams) Ping(meta~ : Map[String, Json]?) ListTools(PaginatedRequestParams) CallTool(CallToolRequestParams) ListResources(PaginatedRequestParams) ReadResource(ReadResourceRequestParams) Subscribe(SubscribeRequestParams) Unsubscribe(SubscribeRequestParams) ListPrompts(PaginatedRequestParams) GetPrompt(GetPromptRequestParams) Complete(CompleteRequestParams) SetLevel(SetLevelRequestParams) InputResponse(InputResponseRequestParams) } derive(Eq, @debug.Debug)

A typed request a client can send to a server.

fn
pub fn ClientRequest::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ClientRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ClientRequest::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ClientRequest::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn ClientRequest::verb(Self) -> String

The method name a typed request will be sent under.

item
pub impl @json.FromJson for ClientRequest

A public item of this server framework.

struct
pub(all) struct CompleteRequestParams { context : CompletionContext meta : Map[String, Json]? } derive(Eq, @debug.Debug)

completion/complete request parameters.

fn
pub fn CompleteRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CompleteRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CompleteRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CompleteRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CompleteRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CompleteRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for CompleteRequestParams

A public item of this server framework.

struct
pub(all) struct CompleteResult { completion : Completion cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a completion/complete call.

fn
pub fn CompleteResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CompleteResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CompleteResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CompleteResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CompleteResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CompleteResult

A public item of this server framework.

item
pub impl @json.FromJson for CompleteResult

A public item of this server framework.

struct
pub(all) struct Completion { values : Array[String] total : Int32? has_more : Bool? } derive(Eq, @debug.Debug)

Completion values returned by completion/complete.

fn
pub fn Completion::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Completion::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Completion::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Completion::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Completion::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Completion

A public item of this server framework.

item
pub impl @json.FromJson for Completion

A public item of this server framework.

struct
pub(all) struct CompletionArgument { name : String value : String } derive(Eq, @debug.Debug)

A data shape. The fields below are its wire and in-memory members.

fn
pub fn CompletionArgument::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CompletionArgument::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CompletionArgument::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CompletionArgument::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CompletionArgument::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CompletionArgument

A public item of this server framework.

item
pub impl @json.FromJson for CompletionArgument

A public item of this server framework.

struct
pub(all) struct CompletionContext { reference : Reference argument : CompletionArgument } derive(Eq, @debug.Debug)

A data shape. The fields below are its wire and in-memory members.

fn
pub fn CompletionContext::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CompletionContext::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CompletionContext::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CompletionContext::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CompletionContext::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CompletionContext

A public item of this server framework.

item
pub impl @json.FromJson for CompletionContext

A public item of this server framework.

enum
pub(all) enum ContentBlock { Text(text~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) Image(data~ : String, mime_type~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) Audio(data~ : String, mime_type~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) ResourceLink(uri~ : String, name~ : String, title~ : String?, description~ : String?, mime_type~ : String?, size~ : Int32?, annotations~ : Annotations?, meta~ : Map[String, Json]?) EmbeddedResource(resource~ : ResourceContents, annotations~ : Annotations?, meta~ : Map[String, Json]?) } derive(Eq, @debug.Debug)

A block of content in a tool result, sampling message or prompt message.

fn
pub fn ContentBlock::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ContentBlock::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ContentBlock::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ContentBlock::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ContentBlock::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ContentBlock

A public item of this server framework.

item
pub impl @json.FromJson for ContentBlock

A public item of this server framework.

struct
pub(all) struct CreateMessageRequestParams { messages : Array[SamplingMessage] system_message : String? include_context : String? max_tokens : Int32 temperature : Double? stop_sequences : Array[String]? model_preferences : ModelPreferences? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

sampling/createMessage request parameters.

fn
pub fn CreateMessageRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CreateMessageRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CreateMessageRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CreateMessageRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CreateMessageRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CreateMessageRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for CreateMessageRequestParams

A public item of this server framework.

struct
pub(all) struct CreateMessageResult { model : String stop_reason : String? role : Role content : ContentBlock cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a sampling/createMessage call.

fn
pub fn CreateMessageResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CreateMessageResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CreateMessageResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CreateMessageResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CreateMessageResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CreateMessageResult

A public item of this server framework.

item
pub impl @json.FromJson for CreateMessageResult

A public item of this server framework.

struct
pub(all) struct CreateTaskResult { task : Json meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A task handle minted for task-augmented execution (SEP-2663).

fn
pub fn CreateTaskResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CreateTaskResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn CreateTaskResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CreateTaskResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn CreateTaskResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for CreateTaskResult

A public item of this server framework.

item
pub impl @json.FromJson for CreateTaskResult

A public item of this server framework.

struct
pub(all) struct DiscoverResult { result_type : String result : Json meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A discovery reply wrapping any core result, tagged with its type.

fn
pub fn DiscoverResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn DiscoverResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn DiscoverResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn DiscoverResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn DiscoverResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for DiscoverResult

A public item of this server framework.

item
pub impl @json.FromJson for DiscoverResult

A public item of this server framework.

struct
pub(all) struct ElicitRequestParams { message : String requested_schema : Map[String, Json]? url : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

elicitation/create request parameters, covering both the form- and URL-based variants.

fn
pub fn ElicitRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ElicitRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ElicitRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ElicitRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ElicitRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ElicitRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for ElicitRequestParams

A public item of this server framework.

struct
pub(all) struct ElicitResult { action : String content : Map[String, Json]? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of an elicitation round trip.

fn
pub fn ElicitResult::accept(Map[String, Json]) -> Self

Accept an elicitation with the given content.

fn
pub fn ElicitResult::cancel() -> Self

Cancel an elicitation.

fn
pub fn ElicitResult::decline() -> Self

Decline an elicitation.

fn
pub fn ElicitResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ElicitResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ElicitResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ElicitResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ElicitResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ElicitResult

A public item of this server framework.

item
pub impl @json.FromJson for ElicitResult

A public item of this server framework.

struct
pub(all) struct EmptyResult { meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A bare result with no payload.

fn
pub fn EmptyResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn EmptyResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn EmptyResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn EmptyResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn EmptyResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for EmptyResult

A public item of this server framework.

item
pub impl @json.FromJson for EmptyResult

A public item of this server framework.

struct
pub(all) struct ErrorData { code : Int32 message : String data : Json? } derive(Eq, ToJson, @debug.Debug, @json.FromJson)

Wire-format error payload carried by JSON-RPC error responses.

fn
pub fn ErrorData::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ErrorData::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ErrorData::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ErrorData::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ErrorData::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct GetPromptRequestParams { name : String arguments : Map[String, Json]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

prompts/get request parameters.

fn
pub fn GetPromptRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn GetPromptRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn GetPromptRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn GetPromptRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn GetPromptRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for GetPromptRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for GetPromptRequestParams

A public item of this server framework.

struct
pub(all) struct GetPromptResult { description : String? messages : Array[PromptMessage] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a prompts/get call.

fn
pub fn GetPromptResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn GetPromptResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn GetPromptResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn GetPromptResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn GetPromptResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for GetPromptResult

A public item of this server framework.

item
pub impl @json.FromJson for GetPromptResult

A public item of this server framework.

struct
pub(all) struct Icon { src : String mime_type : String? sizes : Array[String]? } derive(Eq, @debug.Debug)

An icon for display in user interfaces.

fn
pub fn Icon::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Icon::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Icon::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Icon::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Icon::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Icon

A public item of this server framework.

item
pub impl @json.FromJson for Icon

A public item of this server framework.

struct
pub(all) struct Implementation { name : String title : String? version : String } derive(Eq, @debug.Debug)

The name and version of an MCP implementation.

fn
pub fn Implementation::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Implementation::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Implementation::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Implementation::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Implementation::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Implementation

A public item of this server framework.

item
pub impl @json.FromJson for Implementation

A public item of this server framework.

struct
pub(all) struct InitializeRequestParams { protocol_version : String capabilities : ClientCapabilities client_info : Implementation meta : Map[String, Json]? } derive(Eq, @debug.Debug)

initialize request parameters.

fn
pub fn InitializeRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InitializeRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InitializeRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InitializeRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InitializeRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InitializeRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for InitializeRequestParams

A public item of this server framework.

struct
pub(all) struct InitializeResult { protocol_version : String capabilities : ServerCapabilities server_info : Implementation instructions : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

initialize result: capabilities and server description.

fn
pub fn InitializeResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InitializeResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InitializeResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InitializeResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InitializeResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InitializeResult

A public item of this server framework.

item
pub impl @json.FromJson for InitializeResult

A public item of this server framework.

struct
pub(all) struct InputRequest { id : String request : Json } derive(Eq, @debug.Debug)

One guard-channel request a client must answer (SEP-2322).

fn
pub fn InputRequest::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InputRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InputRequest::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InputRequest::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InputRequest::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InputRequest

A public item of this server framework.

item
pub impl @json.FromJson for InputRequest

A public item of this server framework.

struct
pub(all) struct InputRequiredResult { input_requests : Array[InputRequest] request_state : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

Tells the client to answer the carried requests and re-issue the call.

fn
pub fn InputRequiredResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InputRequiredResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InputRequiredResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InputRequiredResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InputRequiredResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InputRequiredResult

A public item of this server framework.

item
pub impl @json.FromJson for InputRequiredResult

A public item of this server framework.

struct
pub(all) struct InputResponse { request_id : String action : String content : Map[String, Json]? } derive(Eq, @debug.Debug)

A client answer to a guard-channel input request (SEP-2322).

fn
pub fn InputResponse::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InputResponse::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InputResponse::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InputResponse::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InputResponse::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InputResponse

A public item of this server framework.

item
pub impl @json.FromJson for InputResponse

A public item of this server framework.

struct
pub(all) struct InputResponseRequestParams { input_responses : Map[String, Json] request_state : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

input/response request parameters: answers keyed by request id.

fn
pub fn InputResponseRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn InputResponseRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn InputResponseRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn InputResponseRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn InputResponseRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for InputResponseRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for InputResponseRequestParams

A public item of this server framework.

enum
pub(all) enum JSONRPCMessage { Request(id~ : RequestId, verb~ : String, params~ : Json?) Notification(verb~ : String, params~ : Json?) Response(id~ : RequestId, result~ : Json) Error(id~ : RequestId, error~ : ErrorData) } derive(Eq, @debug.Debug)

Any message frame on the wire.

fn
pub fn JSONRPCMessage::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn JSONRPCMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn JSONRPCMessage::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn JSONRPCMessage::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn JSONRPCMessage::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for JSONRPCMessage

A public item of this server framework.

item
pub impl @json.FromJson for JSONRPCMessage

A public item of this server framework.

struct
pub(all) struct ListPromptsResult { prompts : Array[Prompt] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a prompts/list call.

fn
pub fn ListPromptsResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ListPromptsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ListPromptsResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ListPromptsResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ListPromptsResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ListPromptsResult

A public item of this server framework.

item
pub impl @json.FromJson for ListPromptsResult

A public item of this server framework.

struct
pub(all) struct ListResourceTemplatesResult { resource_templates : Array[ResourceTemplate] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a resources/templates/list call.

fn
pub fn ListResourceTemplatesResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ListResourceTemplatesResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ListResourceTemplatesResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ListResourceTemplatesResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ListResourceTemplatesResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ListResourceTemplatesResult

A public item of this server framework.

item
pub impl @json.FromJson for ListResourceTemplatesResult

A public item of this server framework.

struct
pub(all) struct ListResourcesResult { resources : Array[Resource] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a resources/list call.

fn
pub fn ListResourcesResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ListResourcesResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ListResourcesResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ListResourcesResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ListResourcesResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ListResourcesResult

A public item of this server framework.

item
pub impl @json.FromJson for ListResourcesResult

A public item of this server framework.

struct
pub(all) struct ListRootsResult { roots : Array[Root] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a roots/list call.

fn
pub fn ListRootsResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ListRootsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ListRootsResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ListRootsResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ListRootsResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ListRootsResult

A public item of this server framework.

item
pub impl @json.FromJson for ListRootsResult

A public item of this server framework.

struct
pub(all) struct ListToolsResult { tools : Array[Tool] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a tools/list call.

fn
pub fn ListToolsResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ListToolsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ListToolsResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ListToolsResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ListToolsResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ListToolsResult

A public item of this server framework.

item
pub impl @json.FromJson for ListToolsResult

A public item of this server framework.

enum
pub(all) enum LoggingLevel { Debug Info Notice Warning Error Critical Alert Emergency } derive(Eq, @debug.Debug)

Verbosity levels for notifications/message, ordered debug → emergency.

fn
pub fn LoggingLevel::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn LoggingLevel::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn LoggingLevel::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn LoggingLevel::to_wire(Self) -> String

Encode this value to its wire string.

struct
pub(all) struct LoggingMessageNotificationParams { level : LoggingLevel logger : String? data : Json } derive(Eq, @debug.Debug)

A log entry streamed by the server.

fn
pub fn LoggingMessageNotificationParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn LoggingMessageNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn LoggingMessageNotificationParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn LoggingMessageNotificationParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn LoggingMessageNotificationParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for LoggingMessageNotificationParams

A public item of this server framework.

item
pub impl @json.FromJson for LoggingMessageNotificationParams

A public item of this server framework.

struct
pub(all) struct ModelHint { name : String } derive(Eq, @debug.Debug)

Client hints steering server-side model selection.

fn
pub fn ModelHint::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ModelHint::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ModelHint::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ModelHint::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ModelHint::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ModelHint

A public item of this server framework.

item
pub impl @json.FromJson for ModelHint

A public item of this server framework.

struct
pub(all) struct ModelPreferences { hints : Array[ModelHint]? cost_priority : Double? speed_priority : Double? intelligence_priority : Double? } derive(Eq, @debug.Debug)

A data shape. The fields below are its wire and in-memory members.

fn
pub fn ModelPreferences::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ModelPreferences::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ModelPreferences::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ModelPreferences::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ModelPreferences::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ModelPreferences

A public item of this server framework.

item
pub impl @json.FromJson for ModelPreferences

A public item of this server framework.

struct
pub(all) struct PaginatedRequestParams { cursor : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

List requests with cursor-based pagination.

fn
pub fn PaginatedRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn PaginatedRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn PaginatedRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn PaginatedRequestParams::progress_token(Self) -> String?

The progress token carried in the request meta.

fn
pub fn PaginatedRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn PaginatedRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for PaginatedRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for PaginatedRequestParams

A public item of this server framework.

struct
pub(all) struct ProgressNotificationParams { progress_token : String progress : Double message : String? total : Double? } derive(Eq, @debug.Debug)

Progress reported for an in-flight request.

fn
pub fn ProgressNotificationParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ProgressNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ProgressNotificationParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ProgressNotificationParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ProgressNotificationParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ProgressNotificationParams

A public item of this server framework.

item
pub impl @json.FromJson for ProgressNotificationParams

A public item of this server framework.

struct
pub(all) struct Prompt { name : String title : String? description : String? arguments : Array[PromptArgument]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A prompt template exposed to the client.

fn
pub fn Prompt::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Prompt::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Prompt::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Prompt::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Prompt::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Prompt

A public item of this server framework.

item
pub impl @json.FromJson for Prompt

A public item of this server framework.

struct
pub(all) struct PromptArgument { name : String title : String? description : String? required : Bool? } derive(Eq, @debug.Debug)

One argument of a prompt template.

fn
pub fn PromptArgument::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn PromptArgument::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn PromptArgument::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn PromptArgument::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn PromptArgument::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for PromptArgument

A public item of this server framework.

item
pub impl @json.FromJson for PromptArgument

A public item of this server framework.

struct
pub(all) struct PromptMessage { role : Role content : ContentBlock } derive(Eq, @debug.Debug)

One message in a rendered prompt.

fn
pub fn PromptMessage::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn PromptMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn PromptMessage::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn PromptMessage::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn PromptMessage::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for PromptMessage

A public item of this server framework.

item
pub impl @json.FromJson for PromptMessage

A public item of this server framework.

struct
pub(all) struct PromptsCapabilities { list_changed : Bool? } derive(Eq, @debug.Debug)

Prompt listings only need list-change notifications.

fn
pub fn PromptsCapabilities::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn PromptsCapabilities::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn PromptsCapabilities::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct ReadResourceRequestParams { uri : String meta : Map[String, Json]? } derive(Eq, @debug.Debug)

resources/read request parameters.

fn
pub fn ReadResourceRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ReadResourceRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ReadResourceRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ReadResourceRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ReadResourceRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ReadResourceRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for ReadResourceRequestParams

A public item of this server framework.

struct
pub(all) struct ReadResourceResult { contents : Array[ResourceContents] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

The result of a resources/read call.

fn
pub fn ReadResourceResult::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ReadResourceResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ReadResourceResult::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ReadResourceResult::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ReadResourceResult::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ReadResourceResult

A public item of this server framework.

item
pub impl @json.FromJson for ReadResourceResult

A public item of this server framework.

enum
pub(all) enum Reference { PromptReference(name~ : String) ResourceTemplateReference(uri~ : String) } derive(Eq, @debug.Debug)

A prompt reference used for completion.

fn
pub fn Reference::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Reference::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Reference::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Reference::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Reference::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Reference

A public item of this server framework.

item
pub impl @json.FromJson for Reference

A public item of this server framework.

enum
pub(all) enum RequestId { Number(id~ : Int32) Text(id~ : String) } derive(Eq, @debug.Debug)

A JSON-RPC request id: either a number or a string.

fn
pub fn RequestId::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn RequestId::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn RequestId::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn RequestId::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn RequestId::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for RequestId

A public item of this server framework.

item
pub impl @json.FromJson for RequestId

A public item of this server framework.

struct
pub(all) struct RequestParamsMeta { meta : Map[String, Json]? } derive(Eq, @debug.Debug)

Parameters common to every request; _meta.progressToken drives progress.

fn
pub fn RequestParamsMeta::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn RequestParamsMeta::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn RequestParamsMeta::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn RequestParamsMeta::progress_token(Self) -> String?

The progress token carried in the request meta.

fn
pub fn RequestParamsMeta::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn RequestParamsMeta::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for RequestParamsMeta

A public item of this server framework.

item
pub impl @json.FromJson for RequestParamsMeta

A public item of this server framework.

struct
pub(all) struct Resource { uri : String name : String title : String? description : String? mime_type : String? size : Int32? annotations : Annotations? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A resource exposed for reading.

fn
pub fn Resource::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Resource::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Resource::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Resource::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Resource::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Resource

A public item of this server framework.

item
pub impl @json.FromJson for Resource

A public item of this server framework.

enum
pub(all) enum ResourceContents { Text(uri~ : String, mime_type~ : String?, text~ : String) Blob(uri~ : String, mime_type~ : String?, blob~ : String) } derive(Eq, @debug.Debug)

The contents of a resource, either inline text or base64-encoded bytes.

fn
pub fn ResourceContents::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceContents::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ResourceContents::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceContents::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ResourceContents::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn ResourceContents::uri(Self) -> String

The URI this content or reference points at.

item
pub impl ToJson for ResourceContents

A public item of this server framework.

item
pub impl @json.FromJson for ResourceContents

A public item of this server framework.

struct
pub(all) struct ResourceTemplate { uri_template : String name : String title : String? description : String? mime_type : String? annotations : Annotations? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A parameterised resource address pattern.

fn
pub fn ResourceTemplate::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourceTemplate::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ResourceTemplate::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourceTemplate::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ResourceTemplate::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ResourceTemplate

A public item of this server framework.

item
pub impl @json.FromJson for ResourceTemplate

A public item of this server framework.

struct
pub(all) struct ResourcesCapabilities { subscribe : Bool? list_changed : Bool? } derive(Eq, @debug.Debug)

Resource capability flags.

fn
pub fn ResourcesCapabilities::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ResourcesCapabilities::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ResourcesCapabilities::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum Role { User Assistant } derive(Eq, @debug.Debug)

One message in a sampling round trip.

fn
pub fn Role::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Role::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Role::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn Role::to_wire(Self) -> String

Encode this value to its wire string.

struct
pub(all) struct Root { uri : String name : String? } derive(Eq, @debug.Debug)

A filesystem root the client exposes to the server.

fn
pub fn Root::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Root::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Root::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Root::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Root::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Root

A public item of this server framework.

item
pub impl @json.FromJson for Root

A public item of this server framework.

struct
pub(all) struct SamplingMessage { role : Role content : ContentBlock } derive(Eq, @debug.Debug)

A data shape. The fields below are its wire and in-memory members.

fn
pub fn SamplingMessage::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn SamplingMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn SamplingMessage::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn SamplingMessage::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn SamplingMessage::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for SamplingMessage

A public item of this server framework.

item
pub impl @json.FromJson for SamplingMessage

A public item of this server framework.

struct
pub(all) struct ServerCapabilities { experimental : Map[String, Json]? logging : Bool? completions : Bool? prompts : PromptsCapabilities? resources : ResourcesCapabilities? tools : ToolCapabilities? tasks : Bool? } derive(Eq, @debug.Debug)

What a server supports; absent groups mean the feature is off.

fn
pub fn ServerCapabilities::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ServerCapabilities::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ServerCapabilities::new() -> Self

Construct a value with the given fields.

fn
pub fn ServerCapabilities::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ServerCapabilities::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ServerCapabilities::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ServerCapabilities

A public item of this server framework.

item
pub impl @json.FromJson for ServerCapabilities

A public item of this server framework.

enum
pub(all) enum ServerNotification { Cancelled(CancelledNotificationParams) Progress(ProgressNotificationParams) Message(LoggingMessageNotificationParams) ResourceUpdated(uri~ : String) ResourceListChanged ToolListChanged PromptListChanged Initialized RootsListChanged } derive(Eq, @debug.Debug)

A notification frame the server can send to a client.

fn
pub fn ServerNotification::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ServerNotification::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ServerNotification::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ServerNotification::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ServerNotification

A public item of this server framework.

enum
pub(all) enum ServerRequest { Ping(meta~ : Map[String, Json]?) CreateMessage(CreateMessageRequestParams) Elicit(ElicitRequestParams) ListRoots(meta~ : Map[String, Json]?) } derive(Eq, @debug.Debug)

A typed request a server can send to a client.

fn
pub fn ServerRequest::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ServerRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ServerRequest::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ServerRequest::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl @json.FromJson for ServerRequest

A public item of this server framework.

struct
pub(all) struct SetLevelRequestParams { level : LoggingLevel meta : Map[String, Json]? } derive(Eq, @debug.Debug)

logging/setLevel request parameters.

fn
pub fn SetLevelRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn SetLevelRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn SetLevelRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn SetLevelRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn SetLevelRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for SetLevelRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for SetLevelRequestParams

A public item of this server framework.

struct
pub(all) struct SubscribeRequestParams { uri : String meta : Map[String, Json]? } derive(Eq, @debug.Debug)

resources/subscribe request parameters.

fn
pub fn SubscribeRequestParams::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn SubscribeRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn SubscribeRequestParams::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn SubscribeRequestParams::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn SubscribeRequestParams::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for SubscribeRequestParams

A public item of this server framework.

item
pub impl @json.FromJson for SubscribeRequestParams

A public item of this server framework.

struct
pub(all) struct Tool { name : String title : String? description : String? input_schema : Json output_schema : Json? icons : Array[Icon]? annotations : ToolAnnotations? execution : ToolExecution? meta : Map[String, Json]? } derive(Eq, @debug.Debug)

A tool exposed to the client.

fn
pub fn Tool::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Tool::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn Tool::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Tool::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn Tool::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for Tool

A public item of this server framework.

item
pub impl @json.FromJson for Tool

A public item of this server framework.

struct
pub(all) struct ToolAnnotations { title : String? read_only_hint : Bool? destructive_hint : Bool? idempotent_hint : Bool? open_world_hint : Bool? } derive(Eq, @debug.Debug)

UI hints for a tool.

fn
pub fn ToolAnnotations::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ToolAnnotations::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ToolAnnotations::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ToolAnnotations::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ToolAnnotations::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ToolAnnotations

A public item of this server framework.

item
pub impl @json.FromJson for ToolAnnotations

A public item of this server framework.

struct
pub(all) struct ToolCapabilities { list_changed : Bool? } derive(Eq, @debug.Debug)

Tool listings only need list-change notifications.

fn
pub fn ToolCapabilities::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ToolCapabilities::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ToolCapabilities::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct ToolExecution { task_support : @tasks.TaskMode } derive(Eq, @debug.Debug)

Task execution configuration advertised on a tool (SEP-1686).

fn
pub fn ToolExecution::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ToolExecution::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn ToolExecution::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ToolExecution::to_json(Self) -> Json

Encode this shape to JSON.

fn
pub fn ToolExecution::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for ToolExecution

A public item of this server framework.

item
pub impl @json.FromJson for ToolExecution

A public item of this server framework.

Errors

The error type the handlers raise, and how it maps onto JSON-RPC error codes.

fn
pub fn insufficient_scope(Array[String]) -> FastMCPError

Construct an InsufficientScope error with the standard message.

fn
pub fn to_mcp_error(FastMCPError, default_code? : Int32) -> @types.ErrorData

Translate a moonmcp error into a wire-format error payload. NotFound, Disabled and Validation map to invalid_params (-32602); an existing Mcp payload is returned unchanged so an explicit code chosen upstream survives translation; everything else falls back to default_code (internal_error by default).

error
pub(all) suberror FastMCPError { Mcp(@types.ErrorData) Validation(String) Resource(String) Tool(String) Prompt(String) InvalidSignature(String) Client(String) NotFound(String) Disabled(String) ResourceSecurity(String) Authorisation(String) InsufficientScope(required_scopes~ : Array[String], message~ : String) } derive(Eq, @debug.Debug)

Custom errors for moonmcp, mirroring fastmcp/exceptions.py.

fn
pub fn FastMCPError::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn FastMCPError::message(Self) -> String

Render the human-readable message carried by the error.

fn
pub fn FastMCPError::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn FastMCPError::output(Self, &Logger) -> Unit

The message alone, as a person reads it.

fn
pub fn FastMCPError::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn FastMCPError::to_string(Self) -> String

Render the error as a string.

item
pub impl Show for FastMCPError

A public item of this server framework.

Component

The shared metadata every capability carries: name, title, description, tags and icons.

fn
pub fn coerce_version(Json?) -> String? raise @exceptions.FastMCPError

Coerce a JSON scalar to a version string. Raises Validation for non-scalar values or versions containing @ (used as the key delimiter).

fn
pub fn get_fastmcp_metadata(Map[String, Json]?) -> FastMCPMeta

Extract moonmcp metadata from a component's meta object. Handles both the current fastmcp namespace and the legacy _fastmcp namespace for compatibility with older servers.

fn
pub fn public_result_meta(Map[String, Json]?) -> Map[String, Json]?

Strip moonmcp's internal bookkeeping out of component meta. Returns None when nothing public remains, so components without user metadata keep an absent _meta rather than an empty object.

struct
pub(all) struct ComponentBase { key_prefix : String name : String version : String? title : String? description : String? icons : Array[@types.Icon]? tags : @set.Set[String] meta : Map[String, Json]? task_config : @tasks.TaskConfig }

Common state shared by all moonmcp components.

fn
pub fn ComponentBase::get_meta(Self) -> Map[String, Json]

The public meta information about the component. Always includes a fastmcp key containing the sorted tags list and the version (when set); internal keys (prefixed with _) are stripped from the fastmcp namespace.

fn
pub fn ComponentBase::key(Self, String) -> String

The globally unique lookup key for a component. Format: "{key_prefix}:{identifier}@{version}"; the @ delimiter is always present so keys parse unambiguously even when the identifier itself contains @.

fn
pub fn ComponentBase::make_key(String, String) -> String

Construct the lookup key for a component type, e.g. "tool:name".

fn
pub fn ComponentBase::new(String, String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], task_config? : @tasks.TaskConfig) -> Self

Construct a value with the given fields.

struct
pub(all) struct FastMCPMeta { tags : Array[String] version : String? versions : Array[String] } derive(Eq, @debug.Debug)

Namespaced metadata carried in a component's _meta.

fn
pub fn FastMCPMeta::empty() -> Self

A public item of this server framework.

fn
pub fn FastMCPMeta::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn FastMCPMeta::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn FastMCPMeta::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub(open) trait Component { fn base(Self) -> ComponentBase fn identifier(Self) -> String = _ fn key(Self) -> String = _ fn get_meta(Self) -> Map[String, Json] = _ }

A moonmcp component: tool, prompt, resource or resource template.

Tasks

Configuration for tools that hand long work to a task and answer later.

let
pub let default_poll_interval_ms : Int32

A constant value.

let
pub let default_ttl_ms : Int32

A constant value.

fn
pub fn task_mode_from_wire(String) -> TaskMode?

A public item of this server framework.

let
pub let tasks_extension_id : String

Reverse-DNS identifier of the SEP-2663 tasks extension.

struct
pub(all) struct TaskConfig { mode : TaskMode poll_interval_ms : Int32 } derive(Eq, @debug.Debug)

Configuration for MCP background task execution.

fn
pub fn TaskConfig::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn TaskConfig::from_bool(Bool) -> Self

Convert a boolean task flag to a TaskConfig.

fn
pub fn TaskConfig::new(mode? : TaskMode, poll_interval_ms? : Int32) -> Self

Construct a value with the given fields.

fn
pub fn TaskConfig::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn TaskConfig::supports_tasks(Self) -> Bool

Whether this component supports task execution.

fn
pub fn TaskConfig::to_repr(Self) -> @debug.Repr

Debug representation of this value.

struct
pub(all) struct TaskMeta { ttl : Int32? fn_key : String? } derive(Eq, @debug.Debug)

Metadata for task-augmented execution requests.

fn
pub fn TaskMeta::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn TaskMeta::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn TaskMeta::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum TaskMode { Forbidden Optional Required } derive(Eq, @debug.Debug)

How a component handles task-augmented execution requests.

fn
pub fn TaskMode::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn TaskMode::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn TaskMode::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn TaskMode::to_wire(Self) -> String

Encode this value to its wire string.

Settings

Build-time settings surfaced to the running server.

fn
pub fn log_level_from_wire(String) -> LogLevel?

A public item of this server framework.

fn
pub fn session_idle_timeout_from_wire(String) -> SessionIdleTimeout?

A public item of this server framework.

fn
pub fn telemetry_mode_from_wire(String) -> TelemetryMode?

A public item of this server framework.

let
pub let ten_mb_in_bytes : Int32

A constant value.

fn
pub fn transport_kind_from_wire(String) -> TransportKind?

A public item of this server framework.

enum
pub(all) enum CheckForUpdates { Stable Prerelease Off } derive(Eq, @debug.Debug)

An alternative type. Each variant is listed below.

fn
pub fn CheckForUpdates::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn CheckForUpdates::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn CheckForUpdates::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum LogLevel { Debug Info Warning Error Critical } derive(Eq, @debug.Debug)

An alternative type. Each variant is listed below.

fn
pub fn LogLevel::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn LogLevel::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn LogLevel::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn LogLevel::to_wire(Self) -> String

The http_session_idle_timeout wire forms: "auto", "none", or a number.

enum
pub(all) enum SessionIdleTimeout { Auto Never Seconds(Double) } derive(Eq, @debug.Debug)

An alternative type. Each variant is listed below.

fn
pub fn SessionIdleTimeout::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn SessionIdleTimeout::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn SessionIdleTimeout::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn SessionIdleTimeout::to_wire(Self) -> String

The http_session_idle_timeout wire forms: "auto", "none", or a number.

struct
pub(all) struct Settings { home : String oauth_encryption_key : String? test_mode : Bool log_enabled : Bool log_level : LogLevel enable_rich_logging : Bool enable_rich_tracebacks : Bool deprecation_warnings : Bool telemetry_mode : TelemetryMode client_init_timeout : Double? client_disconnect_timeout : Double transport : TransportKind host : String port : Int32 sse_path : String message_path : String streamable_http_path : String debug : Bool mask_error_details : Bool client_log_level : @types.LoggingLevel? strict_input_validation : Bool ssrf_trust_proxy : Bool server_dependencies : Array[String] json_response : Bool stateless_http : Bool http_host_origin_protection : Bool http_allowed_hosts : Array[String]? http_allowed_origins : Array[String]? http_session_idle_timeout : SessionIdleTimeout mounted_components_raise_on_load_error : Bool show_server_banner : Bool check_for_updates : CheckForUpdates } derive(Eq, @debug.Debug)

Everything the framework reads from FASTMCP_* environment variables.

fn
pub fn Settings::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn Settings::from_env() -> Self

Load settings, applying FASTMCP_* environment overrides.

fn
pub fn Settings::new() -> Self

Construct a value with the given fields.

fn
pub fn Settings::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn Settings::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum TelemetryMode { Native PropagationOnly Off } derive(Eq, @debug.Debug)

How moonmcp's native telemetry behaves.

fn
pub fn TelemetryMode::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn TelemetryMode::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn TelemetryMode::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn TelemetryMode::to_wire(Self) -> String

The http_session_idle_timeout wire forms: "auto", "none", or a number.

enum
pub(all) enum TransportKind { Stdio Http Sse StreamableHttp } derive(Eq, @debug.Debug)

An alternative type. Each variant is listed below.

fn
pub fn TransportKind::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn TransportKind::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn TransportKind::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn TransportKind::to_wire(Self) -> String

The http_session_idle_timeout wire forms: "auto", "none", or a number.

Config

Default ports and other knobs the server reads at start.

fn
pub fn config_from_json(Json) -> MCPConfig raise @json.JsonDecodeError

Parse MCP configuration from a JSON document.

fn
pub fn infer_transport_type_from_url(String) -> Result[String, String]

Infer "sse" or "http" from a remote server URL.

struct
pub(all) struct MCPConfig { mcp_servers : Map[String, MCPServerEntry] } derive(Eq, @debug.Debug)

A configuration object for MCP servers.

fn
pub fn MCPConfig::add_server(Self, String, MCPServerEntry) -> Unit

Add or update a server in the configuration.

fn
pub fn MCPConfig::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn MCPConfig::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn MCPConfig::new() -> Self

Construct a value with the given fields.

fn
pub fn MCPConfig::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn MCPConfig::to_json(Self) -> Json

Convert the configuration to a JSON document, omitting empty fields.

fn
pub fn MCPConfig::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl @json.FromJson for MCPConfig

A public item of this server framework.

struct
pub(all) struct MCPServerEntry { kind : MCPServerKind timeout : Int32? description : String? icon : String? authentication : Map[String, Json]? transform : ServerTransform? } derive(Eq, @debug.Debug)

A data shape. The fields below are its wire and in-memory members.

fn
pub fn MCPServerEntry::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn MCPServerEntry::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError

Decode this shape from JSON.

fn
pub fn MCPServerEntry::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn MCPServerEntry::to_json(Self) -> Json

Convert the configuration to a JSON document, omitting empty fields.

fn
pub fn MCPServerEntry::to_repr(Self) -> @debug.Repr

Debug representation of this value.

item
pub impl ToJson for MCPServerEntry

A public item of this server framework.

item
pub impl @json.FromJson for MCPServerEntry

A public item of this server framework.

enum
pub(all) enum MCPServerKind { Stdio(command~ : String, args~ : Array[String], env~ : Map[String, Json], cwd~ : String?, keep_alive~ : Bool?) Remote(url~ : String, transport~ : RemoteTransport?, headers~ : Map[String, String], auth~ : String?, sse_read_timeout_ms~ : Int32?) } derive(Eq, @debug.Debug)

One server entry: either a stdio command or a remote URL.

fn
pub fn MCPServerKind::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn MCPServerKind::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn MCPServerKind::to_repr(Self) -> @debug.Repr

Debug representation of this value.

enum
pub(all) enum RemoteTransport { Http StreamableHttp Sse } derive(Eq, @debug.Debug)

An alternative type. Each variant is listed below.

fn
pub fn RemoteTransport::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn RemoteTransport::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn RemoteTransport::to_repr(Self) -> @debug.Repr

Debug representation of this value.

fn
pub fn RemoteTransport::to_wire(Self) -> String

Encode this value to its wire string.

struct
pub(all) struct ServerTransform { tools : Map[String, Json] include_tags : @set.Set[String]? exclude_tags : @set.Set[String]? } derive(Eq, @debug.Debug)

Tool transforms and tag filters for a proxied server.

fn
pub fn ServerTransform::equal(Self, Self) -> Bool

Equality with another value of the same type.

fn
pub fn ServerTransform::not_equal(Self, Self) -> Bool

Inequality with another value of the same type.

fn
pub fn ServerTransform::to_repr(Self) -> @debug.Repr

Debug representation of this value.

Utilities

Small helpers, chiefly media-type handling for binary content.

fn
pub fn encode_base64(Bytes) -> String

Base64-encode raw bytes for wire transport.

struct
pub(all) struct Audio { path : String? data : Bytes? format : String? mime_type : String annotations : @types.Annotations? }

A helper for returning audio from tools.

fn
pub fn Audio::new(path? : String, data? : Bytes, format? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError

Create a file payload from a path or raw data, not both.

fn
pub fn Audio::to_audio_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError

Convert to an audio content block.

struct
pub(all) struct File { path : String? data : Bytes? format : String? name : String? mime_type : String annotations : @types.Annotations? }

A helper for returning file data from tools.

fn
pub fn File::new(path? : String, data? : Bytes, format? : String, name? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError

Create a file payload from a path or raw data, not both.

fn
pub fn File::to_resource_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError

Convert to an embedded resource content block.

struct
pub(all) struct Image { path : String? data : Bytes? format : String? mime_type : String annotations : @types.Annotations? }

A helper for returning images from tools.

fn
pub fn Image::new(path? : String, data? : Bytes, format? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError

Create a file payload from a path or raw data, not both.

fn
pub fn Image::to_data_uri(Self, mime_type? : String) -> String raise @exceptions.FastMCPError

Render as a data: URI.

fn
pub fn Image::to_image_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError

Convert to an image content block.