pub struct Config {
pub port: u16,
pub name: String,
pub version: String,
pub title: Option<String>,
pub description: Option<String>,
pub website_url: Option<String>,
pub icons: Option<Vec<Icon>>,
pub instructions: Option<String>,
pub sse_keep_alive: Option<Duration>,
}Expand description
Fields§
§port: u16The port the plugin’s manifest declares under mcp.port.
The host publishes exactly that port, so this and the manifest are two halves that have to agree: a mismatch means the host publishes a port nothing is listening on, and the plugin looks dead rather than misconfigured.
name: StringThe server name — load-bearing, not cosmetic.
The proxy builds each upstream’s ROUTING PREFIX from it
(_ and . normalize to -), and prepends <prefix>_ to
every tool name the agent sees. It is also the key the
agent-SDK runners file this server under in their mcpServers
config.
Prefixes escalate only as far as uniqueness demands: name,
then name-version on collision, then name-version-index.
Two plugins sharing a name AND version therefore fall through
to a positional index — legal, but unreadable and tied to sort
order. Pick a distinct name.
version: StringThe server version — the prefix collision tie-breaker (see
name), and reported by servers/list.
title: Option<String>Human-readable title. Reporting only.
description: Option<String>What this server is. Reporting only.
website_url: Option<String>Where to read more. Reporting only.
icons: Option<Vec<Icon>>Icons for a UI to show. Reporting only.
instructions: Option<String>How a model should use this server — the one field here written
FOR the agent rather than about the plugin. Surfaced through
agents mcp servers list.
sse_keep_alive: Option<Duration>How often to ping an idle SSE stream, or None to never.
Worth having because the connection crosses podman’s port publish and whatever sits between: an idle stream can be reaped by something in the middle that has no idea the plugin is simply thinking.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
port: u16,
name: impl Into<String>,
version: impl Into<String>,
) -> Self
pub fn new( port: u16, name: impl Into<String>, version: impl Into<String>, ) -> Self
The config for a plugin whose manifest declares
mcp.port = port, identifying itself as name/version.
Both identifiers are required for the reason on
name: defaulting them would silently hand every
plugin the same routing prefix.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the human-readable title.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set what this server is.
Sourcepub fn with_website_url(self, website_url: impl Into<String>) -> Self
pub fn with_website_url(self, website_url: impl Into<String>) -> Self
Set where to read more.
Sourcepub fn with_icons(self, icons: impl IntoIterator<Item = Icon>) -> Self
pub fn with_icons(self, icons: impl IntoIterator<Item = Icon>) -> Self
Set the icons a UI may show.
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_instructions(self, instructions: impl Into<String>) -> Self
Set how a model should use this server.
Trait Implementations§
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more