pub struct McpConfig {
pub title: Option<String>,
pub description: Option<String>,
pub instructions: Option<String>,
pub tool_prefix: Option<ToolPrefix>,
}Expand description
Optional overrides for the text mcpls reports about itself over MCP.
Every field is None by default, which keeps today’s hardcoded
serverInfo.title/description and built-in capability blurb
unchanged. serverInfo.name, version, and website_url are not
configurable here: name is the MCP-spec machine identifier asserted in
integration tests, and version/website_url are project metadata, not
presentation text.
A configured instructions replaces the
built-in capability blurb in ServerInfo.instructions rather than
appending to it – an agent that reads instructions at connection time
(see skills/mcpls/SKILL.md) sees only the configured text, plus the
unrelated untrusted-project-config NOTE (see
ServerConfig::project_config_ignored), which is always appended
afterward regardless of this field.
Every field reaches an MCP client verbatim on every initialize
response, into what is typically an LLM context window – this is why
ServerConfig::validate enforces the MAX_MCP_* byte caps on all
three.
§Examples
use mcpls_core::config::ServerConfig;
let toml = r#"
[mcp]
title = "My Custom Bridge"
description = "Internal LSP bridge for Acme Corp"
instructions = "Use get_hover before get_definition."
"#;
let config: ServerConfig = toml::from_str(toml).unwrap();
assert_eq!(config.mcp.title.as_deref(), Some("My Custom Bridge"));Fields§
§title: Option<String>Overrides serverInfo.title. Omit to keep the built-in title.
description: Option<String>Overrides serverInfo.description. Omit to keep the built-in
description (CARGO_PKG_DESCRIPTION).
instructions: Option<String>Replaces the built-in ServerInfo.instructions capability blurb.
Omit to keep the built-in text. The untrusted-project-config NOTE
(see ServerConfig::project_config_ignored) is still appended
after this value when set.
tool_prefix: Option<ToolPrefix>Prefixes every MCP tool name with {tool_prefix}_, so an MCP client
running multiple mcpls bridges concurrently (one per project) can
tell their tools apart. Omit to keep the default, unprefixed tool
names.