Kuberwastaken/claurst · error
MCP server ' ' is configured as ' ' but missing URL
Error message
MCP server '{}' is configured as '{}' but missing URL What it means
The MCP connection manager rejects connecting to a server whose type is 'sse' or 'http' when the config has no `url` field. These transport types require a remote HTTP endpoint, and the OAuth token acquisition step needs that URL, so a missing URL is a fatal configuration error. The library bails before any network connection is attempted.
Solutions
- Add the "url" field to the MCP server config entry, e.g. "url": "https://example.com/sse"
- Verify server_type matches the intended transport; if the server is local, use type "stdio" with a command instead of sse/http
- Re-run provider/config discovery to ensure the expanded config actually contains the URL
Example fix
// before (.mcp.json)
{ "mcpServers": { "docs": { "type": "sse" } } }
// after
{ "mcpServers": { "docs": { "type": "sse", "url": "https://docs.example.com/sse" } } } Defensive patterns
Strategy: validation
Validate before calling
fn ensure_remote_config_ok(cfg: &McpServerConfig) -> anyhow::Result<()> {
if matches!(cfg.server_type.as_str(), "sse" | "http") && cfg.url.is_none() {
anyhow::bail!("server '{}' of type '{}' requires a url", cfg.name, cfg.server_type);
}
Ok(())
} Prevention
- Validate MCP config entries at startup before attempting connections
- Use a JSON schema or typed config loader that requires url for sse/http types
- Never switch a stdio server entry to sse/http without adding its URL
When it happens
Trigger: Calling connect (via connect_expanded_config) with an McpServerConfig where server_type is "sse" or "http" and config.url is None.
Common situations: Hand-edited .mcp.json or settings entry omitted the url key; a template was copied and the url placeholder removed; a server was switched from stdio (command-based) to sse/http without adding a URL.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Failed to parse redirect URI
- Redirect URI ' ' is missing host
- Bridge session registration failed: authentication error
- No query string in callback
- invalid legacy SSE base URL
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/8df03afcad8c35ac.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/mcp/src/connection_manager.rs:124
}
/// Connect to all configured servers (env-vars expanded, errors non-fatal).
pub async fn connect_all(&self) -> anyhow::Result<()> {
let names: Vec<String> = self.state.iter().map(|e| e.key().clone()).collect();
for name in names {
if let Err(e) = self.connect(&name).await {
error!(server = %name, error = %e, "MCP server failed to connect during startup");
}
}
Ok(())
}
async fn connect_expanded_config(name: &str, config: &McpServerConfig) -> anyhow::Result<McpClient> {
let auth_token = if matches!(config.server_type.as_str(), "sse" | "http") {
match config.url.as_deref() {
Some(server_url) => oauth::get_valid_mcp_access_token(name, server_url).await?,
None => {
anyhow::bail!(
"MCP server '{}' is configured as '{}' but missing URL",
name,
config.server_type
)
}
}
} else {
None
};
McpClient::connect(config, auth_token).await
}
// -----------------------------------------------------------------------
// Connect / disconnect / restart
// -----------------------------------------------------------------------
/// Connect to a single server by name, marking status along the way.
pub async fn connect(&self, name: &str) -> anyhow::Result<()> {
View on GitHub (pinned to b0637c97ec)