diff --git a/rust/crates/sift_cli/CHANGELOG.md b/rust/crates/sift_cli/CHANGELOG.md index 6e910df96f..8c2fb08e77 100644 --- a/rust/crates/sift_cli/CHANGELOG.md +++ b/rust/crates/sift_cli/CHANGELOG.md @@ -7,6 +7,13 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### What's New +## [v0.7.2] - September 29, 2026 + +### What's New + +- `sift-cli mcp` now sends a `User-Agent` when it fetches account feature flags. + Hosts that reject requests without one no longer disable flag-gated tools. + ## [v0.7.1] - September 22, 2026 ### What's New diff --git a/rust/crates/sift_cli/Cargo.toml b/rust/crates/sift_cli/Cargo.toml index c441612d9b..a439bc3f60 100644 --- a/rust/crates/sift_cli/Cargo.toml +++ b/rust/crates/sift_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sift_cli" -version = "0.7.1" +version = "0.7.2" authors.workspace = true edition.workspace = true categories.workspace = true diff --git a/rust/crates/sift_cli/src/cmd/mcp.rs b/rust/crates/sift_cli/src/cmd/mcp.rs index 84afc1c857..91f001b2f7 100644 --- a/rust/crates/sift_cli/src/cmd/mcp.rs +++ b/rust/crates/sift_cli/src/cmd/mcp.rs @@ -52,15 +52,21 @@ pub async fn run(ctx: Context, args: McpArgs, app_uri: String) -> Result Result Result { + pub async fn fetch( + rest_uri: &str, + api_key: &str, + client_name: ClientName, + cli_version: &str, + ) -> Result { let endpoint = format!("{}{FEATURE_FLAGS_PATH}", rest_uri.trim_end_matches('/')); reqwest::Client::new() .get(endpoint) .timeout(REQUEST_TIMEOUT) .bearer_auth(api_key) + .header( + USER_AGENT, + format!("{}/{cli_version}", client_name.as_str()), + ) .send() .await .context("feature flag request failed")? @@ -63,7 +75,7 @@ mod tests { use std::collections::HashMap; use super::{FeatureFlagVariant, FeatureFlags}; - use crate::client_event::start_http_server; + use crate::{ClientName, client_event::start_http_server}; fn response(status: &str, body: &str) -> Vec { format!( @@ -121,9 +133,14 @@ mod tests { )) .await; - let flags = FeatureFlags::fetch(&format!("{rest_uri}/"), "test-key") - .await - .unwrap(); + let flags = FeatureFlags::fetch( + &format!("{rest_uri}/"), + "test-key", + ClientName::SiftMcp, + "1.2.3", + ) + .await + .unwrap(); assert!(flags.enabled("test-reports")); let request = String::from_utf8(server.await.unwrap()).unwrap(); @@ -134,10 +151,19 @@ mod tests { .lines() .any(|line| line.eq_ignore_ascii_case("authorization: Bearer test-key")) ); + assert!( + headers + .lines() + .any(|line| line.eq_ignore_ascii_case("user-agent: sift_mcp/1.2.3")) + ); let (rest_uri, server) = start_http_server(response("500 Internal Server Error", "{}")).await; - assert!(FeatureFlags::fetch(&rest_uri, "test-key").await.is_err()); + assert!( + FeatureFlags::fetch(&rest_uri, "test-key", ClientName::SiftMcp, "1.2.3") + .await + .is_err() + ); server.await.unwrap(); } }