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: StringUnique 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: StringCommand 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
impl Clone for IntrospectServerParams
Source§fn clone(&self) -> IntrospectServerParams
fn clone(&self) -> IntrospectServerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntrospectServerParams
impl Debug for IntrospectServerParams
Source§impl<'de> Deserialize<'de> for IntrospectServerParams
impl<'de> Deserialize<'de> for IntrospectServerParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for IntrospectServerParams
impl JsonSchema for IntrospectServerParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more