mirror of
https://github.com/samvallad33/vestige.git
synced 2026-04-25 00:36:22 +02:00
feat(mcp): add VESTIGE_DASHBOARD_ENABLED with default false
- Dashboard now disabled by default to reduce memory footprint - Enable with VESTIGE_DASHBOARD_ENABLED=true - Update --help text to document new env var
This commit is contained in:
parent
37af5059c9
commit
5f4f2fe8a6
1 changed files with 9 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ use server::McpServer;
|
||||||
struct Config {
|
struct Config {
|
||||||
data_dir: Option<PathBuf>,
|
data_dir: Option<PathBuf>,
|
||||||
http_port: u16,
|
http_port: u16,
|
||||||
|
dashboard_enabled: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse command-line arguments into a `Config`.
|
/// Parse command-line arguments into a `Config`.
|
||||||
|
|
@ -59,6 +60,9 @@ fn parse_args() -> Config {
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|s| s.parse().ok())
|
.and_then(|s| s.parse().ok())
|
||||||
.unwrap_or(3928);
|
.unwrap_or(3928);
|
||||||
|
let dashboard_enabled = std::env::var("VESTIGE_DASHBOARD_ENABLED")
|
||||||
|
.map(|v| v.eq_ignore_ascii_case("true") || v == "1")
|
||||||
|
.unwrap_or(false);
|
||||||
let mut i = 1;
|
let mut i = 1;
|
||||||
|
|
||||||
while i < args.len() {
|
while i < args.len() {
|
||||||
|
|
@ -81,6 +85,7 @@ fn parse_args() -> Config {
|
||||||
println!(" RUST_LOG Log level filter (e.g., debug, info, warn, error)");
|
println!(" RUST_LOG Log level filter (e.g., debug, info, warn, error)");
|
||||||
println!(" VESTIGE_AUTH_TOKEN Override the bearer token for HTTP transport");
|
println!(" VESTIGE_AUTH_TOKEN Override the bearer token for HTTP transport");
|
||||||
println!(" VESTIGE_HTTP_PORT HTTP transport port (default: 3928)");
|
println!(" VESTIGE_HTTP_PORT HTTP transport port (default: 3928)");
|
||||||
|
println!(" VESTIGE_DASHBOARD_ENABLED Enable dashboard (default: disabled)");
|
||||||
println!(" VESTIGE_DASHBOARD_PORT Dashboard port (default: 3927)");
|
println!(" VESTIGE_DASHBOARD_PORT Dashboard port (default: 3927)");
|
||||||
println!();
|
println!();
|
||||||
println!("EXAMPLES:");
|
println!("EXAMPLES:");
|
||||||
|
|
@ -148,7 +153,7 @@ fn parse_args() -> Config {
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Config { data_dir, http_port }
|
Config { data_dir, http_port, dashboard_enabled }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|
@ -271,7 +276,7 @@ async fn main() {
|
||||||
let (event_tx, _) = tokio::sync::broadcast::channel::<vestige_mcp::dashboard::events::VestigeEvent>(1024);
|
let (event_tx, _) = tokio::sync::broadcast::channel::<vestige_mcp::dashboard::events::VestigeEvent>(1024);
|
||||||
|
|
||||||
// Spawn dashboard HTTP server alongside MCP server (now with CognitiveEngine access)
|
// Spawn dashboard HTTP server alongside MCP server (now with CognitiveEngine access)
|
||||||
{
|
if config.dashboard_enabled {
|
||||||
let dashboard_port = std::env::var("VESTIGE_DASHBOARD_PORT")
|
let dashboard_port = std::env::var("VESTIGE_DASHBOARD_PORT")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|s| s.parse::<u16>().ok())
|
.and_then(|s| s.parse::<u16>().ok())
|
||||||
|
|
@ -294,6 +299,8 @@ async fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
info!("Dashboard disabled by VESTIGE_DASHBOARD_ENABLED=false");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start HTTP MCP transport (Streamable HTTP for Claude.ai / remote clients)
|
// Start HTTP MCP transport (Streamable HTTP for Claude.ai / remote clients)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue