diff --git a/crates/apollo-mcp-server/src/main.rs b/crates/apollo-mcp-server/src/main.rs index 1bca39b0..971eeb5c 100644 --- a/crates/apollo-mcp-server/src/main.rs +++ b/crates/apollo-mcp-server/src/main.rs @@ -73,11 +73,16 @@ struct Args { introspection: bool, /// Enable use of uplink to get the schema and persisted queries (requires APOLLO_KEY and APOLLO_GRAPH_REF) - #[arg(long, short = 'u')] + #[arg( + long, + short = 'u', + requires = "apollo_key", + requires = "apollo_graph_ref" + )] uplink: bool, - /// Expose a tool to open queries in Apollo Explorer (requires APOLLO_KEY and APOLLO_GRAPH_REF) - #[arg(long, short = 'x')] + /// Expose a tool to open queries in Apollo Explorer (requires APOLLO_GRAPH_REF) + #[arg(long, short = 'x', requires = "apollo_graph_ref")] explorer: bool, /// Operation files to expose as MCP tools @@ -117,7 +122,7 @@ struct Args { http_port: Option, /// collection id to expose as MCP tools (requires APOLLO_KEY) - #[arg(long, conflicts_with_all(["operations", "manifest"]))] + #[arg(long, conflicts_with_all(["operations", "manifest"]), requires = "apollo_key")] collection: Option, /// The endpoints (comma separated) polled to fetch the latest supergraph schema. @@ -129,11 +134,11 @@ struct Args { apollo_registry_url: Option, /// Your Apollo key. - #[clap(skip = std::env::var("APOLLO_KEY").ok())] + #[clap(env = "APOLLO_KEY", long)] apollo_key: Option, /// Your Apollo graph reference. - #[clap(skip = std::env::var("APOLLO_GRAPH_REF").ok())] + #[clap(env = "APOLLO_GRAPH_REF", long)] apollo_graph_ref: Option, }