Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "corgea"
version = "1.11.1"
version = "1.12.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
54 changes: 54 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod images;
mod inspect;
mod list;
mod log;
mod mcp;
mod scan;
mod setup_hooks;
mod skill;
Expand Down Expand Up @@ -307,6 +308,11 @@ enum Commands {
#[command(subcommand)]
command: SkillCommands,
},
/// Install the Corgea MCP server into an agent's config
Mcp {
#[command(subcommand)]
command: McpCommands,
},
/// Offline dependency inventory: scan, graph, explain, diff, sbom, policy
Deps {
#[command(subcommand)]
Expand Down Expand Up @@ -496,6 +502,37 @@ enum SkillCommands {
},
}

#[derive(Subcommand, Debug)]
enum McpCommands {
/// Install (or reinstall) the Corgea MCP server in an agent's JSON config
Install {
#[arg(
long,
help = "Agent to install for (e.g. cursor, claude, claude-code). Defaults to the configured default agent."
)]
agent: Option<String>,

#[arg(
long,
default_value = "user",
help = "Installation scope: user or project."
)]
scope: String,

#[arg(
long,
help = "Write to a custom JSON file (overrides the agent's default path)."
)]
dir: Option<String>,

#[arg(
long,
help = "Persist the provided --agent as the default for future installs."
)]
set_default: bool,
},
}

#[derive(Subcommand, Debug, Clone, PartialEq)]
enum Scanner {
Snyk,
Expand Down Expand Up @@ -960,6 +997,23 @@ fn main() {
skill::run_set_default_agent(&mut corgea_config, agent);
}
},
Some(Commands::Mcp { command }) => match command {
McpCommands::Install {
agent,
scope,
dir,
set_default,
} => {
verify_token_and_exit_when_fail(&corgea_config);
mcp::run_install(
&mut corgea_config,
agent.clone(),
scope,
dir.clone(),
*set_default,
);
}
},
Some(Commands::Deps { command }) => {
// Offline: no token / network. Exit code propagates fail-on policy.
std::process::exit(i32::from(corgea::deps::run::run(command.clone())));
Expand Down
Loading
Loading