Skip to main content

IntrospectServerParams

Struct IntrospectServerParams 

Source
pub struct IntrospectServerParams {
    pub server_id: String,
    pub command: String,
    pub args: Vec<String>,
    pub env: HashMap<String, String>,
    pub output_dir: Option<PathBuf>,
    pub connect_timeout_secs: Option<u64>,
    pub discover_timeout_secs: Option<u64>,
}
Expand description

Parameters for introspecting an MCP server.

This type only ever builds a stdio ServerConfig (see GeneratorService::introspect_server, which calls ServerConfig::builder().command(...) and never sets a transport of Http or Sse). It must never gain a field capable of setting ServerConfig’s transport to Http/Sse (e.g. url, http, sse, headers) without SSRF allowlisting logic added alongside it: ServerConfig::url (crates/mcp-core/src/server_config.rs) documents that this crate does not apply SSRF allowlisting itself and expects a server-context embedder - which is exactly what mcp-execution-server is - to add its own before connecting. tests::introspect_server_params_shape_is_pinned pins the current field set so a silent addition fails to compile instead of merely widening the attack surface unnoticed.

§Examples

use mcp_execution_server::types::IntrospectServerParams;
use std::collections::HashMap;

let params = IntrospectServerParams {
    server_id: "github".to_string(),
    command: "npx".to_string(),
    args: vec!["-y".to_string(), "@anthropic/mcp-server-github".to_string()],
    env: HashMap::new(),
    output_dir: None,
    connect_timeout_secs: None,
    discover_timeout_secs: None,
};

Fields§

§server_id: String

Unique identifier for the server (e.g., “github”, “filesystem”).

Must be 1-64 lowercase letters, digits, or hyphens (see validate_server_id’s MAX_SERVER_ID_LENGTH, mirrored here as a literal since schemars attributes cannot reference a const).

§command: String

Command to start the server (e.g., “npx”, “docker”).

Capped at mcp_execution_core::MAX_ARG_LEN (4096 bytes) at runtime; mirrored here as a literal since schemars attributes cannot reference a const.

§args: Vec<String>

Arguments to pass to the command.

Capped at mcp_execution_core::MAX_ARG_COUNT (256) entries at runtime (enforced when this becomes part of the ServerConfig built from these params); mirrored here as a literal since schemars attributes cannot reference a const.

§env: HashMap<String, String>

Environment variables for the server process.

Capped at mcp_execution_core::MAX_ENV_COUNT (256) entries and mcp_execution_core::MAX_ENV_VALUE_LEN (32KB) per value at runtime. No schemars attribute is set here: schemars’ length validation only emits minProperties/ maxProperties for object-typed schemas via the map/set traits it does not yet support for derived struct fields, so a map-size constraint would be a silent no-op.

§output_dir: Option<PathBuf>

Custom output subdirectory, relative to ~/.claude/servers/{server_id}/ (default: ~/.claude/servers/{server_id} itself). Confined to that directory: an absolute path, a .. component, or a path that escapes it via a symlink is rejected.

§connect_timeout_secs: Option<u64>

Connection (handshake) timeout in seconds, overriding the 30-second default when set.

§discover_timeout_secs: Option<u64>

Tool discovery timeout in seconds, overriding the 30-second default when set.

Trait Implementations§

Source§

impl Clone for IntrospectServerParams

Source§

fn clone(&self) -> IntrospectServerParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntrospectServerParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for IntrospectServerParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for IntrospectServerParams

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more