From ef31b59a15e8580407989db1b2c4bd9993802494 Mon Sep 17 00:00:00 2001 From: 1999AZZAR <48999412+1999AZZAR@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:49:50 +0700 Subject: [PATCH] feat: support Antigravity agent in MCP installer Co-authored-by: Mema --- README.md | 2 +- src/agent.rs | 4 ++++ src/agent/config.rs | 8 +++++--- src/agent/tests.rs | 28 +++++++++++++++++++++++----- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c56770c..5721bf9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ is available. An explicit bus address or runtime directory keeps precedence. ### MCP agent registration -To register MCP without a prompt, run `proofline agent install CLIENT --yes`. Supported clients include `claude-code` (or `claude`), `cursor`, `codex`, `gemini`, and `kiro`. Without `--yes`, the command previews the entry and asks for confirmation, while `--print` previews without writing. Existing Proofline entries remain unchanged. New entries use this executable's absolute path and store no credentials. Claude Code uses the top-level `mcpServers` in `~/.claude.json`; a custom `CLAUDE_CONFIG_DIR` requires manual configuration with `--print`. +To register MCP without a prompt, run `proofline agent install CLIENT --yes`. Supported clients include `antigravity` (or `agy`), `claude-code` (or `claude`), `cursor`, `codex`, `gemini`, and `kiro`. Without `--yes`, the command previews the entry and asks for confirmation, while `--print` previews without writing. Existing Proofline entries remain unchanged. New entries use this executable's absolute path and store no credentials. Claude Code uses the top-level `mcpServers` in `~/.claude.json`; a custom `CLAUDE_CONFIG_DIR` requires manual configuration with `--print`. Antigravity uses the shared global `mcpServers` in `~/.gemini/config/mcp_config.json`, which both the Antigravity editor and the `agy` CLI read. Native knowledge, plan, fix and configuration commands send the selected organization as `organization_id` in each MCP tool call. With `PROOFLINE_TOKEN`, select an authorized UUID using `--org ORGANIZATION_ID` or `PROOFLINE_ORGANIZATION_ID`; the flag takes precedence. A stored device sign-in uses its approved organization and refuses a different selection. For example, `proofline --org ORGANIZATION_ID wiki list --repo owner/name` and `proofline --org ORGANIZATION_ID config get` target that organization with a shared MCP OAuth credential. Selection grants no authority: the server checks each call, and a foreign target returns its refusal with a nonzero exit. MCP OAuth credentials remain limited to MCP and cannot use REST commands. The raw `proofline mcp` bridge preserves the caller's messages and per-call target unchanged. diff --git a/src/agent.rs b/src/agent.rs index 1bb3ca0..48b8d72 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -42,6 +42,8 @@ struct InstallArgs { #[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] enum Client { + #[value(alias = "agy")] + Antigravity, #[value(alias = "claude")] ClaudeCode, Codex, @@ -53,6 +55,7 @@ enum Client { impl Client { const fn relative_path(self) -> &'static str { match self { + Self::Antigravity => ".gemini/config/mcp_config.json", Self::ClaudeCode => ".claude.json", Self::Codex => ".codex/config.toml", Self::Cursor => ".cursor/mcp.json", @@ -65,6 +68,7 @@ impl Client { impl fmt::Display for Client { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str(match self { + Self::Antigravity => "Antigravity", Self::ClaudeCode => "Claude Code", Self::Codex => "Codex", Self::Cursor => "Cursor", diff --git a/src/agent/config.rs b/src/agent/config.rs index 43b20c6..31c628b 100644 --- a/src/agent/config.rs +++ b/src/agent/config.rs @@ -46,9 +46,11 @@ pub(super) fn prepare( ) -> Result { match client { Client::Codex => codex(original, origin), - Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => { - json(client, original, origin) - } + Client::Antigravity + | Client::ClaudeCode + | Client::Cursor + | Client::Gemini + | Client::Kiro => json(client, original, origin), } } diff --git a/src/agent/tests.rs b/src/agent/tests.rs index 8a67e1d..e8ee3db 100644 --- a/src/agent/tests.rs +++ b/src/agent/tests.rs @@ -19,7 +19,8 @@ use crate::origin::Origin; use crate::{Cli, Command as CliCommand}; const PRIVATE: &str = "installer-private-config-canary"; -const CLIENTS: [Client; 5] = [ +const CLIENTS: [Client; 6] = [ + Client::Antigravity, Client::ClaudeCode, Client::Codex, Client::Cursor, @@ -95,7 +96,11 @@ fn configuration(client: Client) -> Vec { Client::Codex => format!( "# keep this comment\nmodel = \"chosen-model\"\nlabels = [\"one\", \"two\"]\n\n[mcp_servers.other]\ncommand = \"other-server\"\nargs = [\"a b\"]\n\n[mcp_servers.other.env]\nSECRET = \"{PRIVATE}\"\n" ).into_bytes(), - Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => serde_json::to_vec_pretty(&json!({ + Client::Antigravity + | Client::ClaudeCode + | Client::Cursor + | Client::Gemini + | Client::Kiro => serde_json::to_vec_pretty(&json!({ "theme": "chosen-theme", "policy": {"trust": false, "autoApprove": [], "excluded": ["untrusted"]}, "mcpServers": { @@ -191,7 +196,11 @@ fn all_clients_preserve_private_settings_and_add_only_the_launcher() { assert_eq!(server.as_table().unwrap().len(), 2); assert_eq!(parsed, expected); } - Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => { + Client::Antigravity + | Client::ClaudeCode + | Client::Cursor + | Client::Gemini + | Client::Kiro => { let expected: Value = serde_json::from_slice(&original).unwrap(); let mut parsed: Value = serde_json::from_str(&actual).unwrap(); let server = parsed["mcpServers"] @@ -308,7 +317,11 @@ fn custom_existing_entries_and_codex_home_are_never_overwritten() { let home = TempDir::new().unwrap(); let original = match client { Client::Codex => format!("# {PRIVATE}\nmcp_servers.proofline = {{ command = \"custom-launcher\", args = [\"custom\"] }}\n").into_bytes(), - Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => format!("{{\"mcpServers\":{{\"proofline\":null}},\"private\":\"{PRIVATE}\"}}").into_bytes(), + Client::Antigravity + | Client::ClaudeCode + | Client::Cursor + | Client::Gemini + | Client::Kiro => format!("{{\"mcpServers\":{{\"proofline\":null}},\"private\":\"{PRIVATE}\"}}").into_bytes(), }; let path = seed(home.path(), client, &original); let modified = fs::metadata(&path).unwrap().modified().unwrap(); @@ -412,6 +425,7 @@ fn toml_inline_tables_and_separate_arguments_round_trip_in_unicode_homes() { assert_eq!(cli.base_url, "http://[::1]:8080"); assert!(matches!(cli.command, CliCommand::Mcp)); for client in [ + Client::Antigravity, Client::ClaudeCode, Client::Cursor, Client::Gemini, @@ -698,7 +712,11 @@ fn invalid_duplicate_oversized_and_readonly_documents_stay_private_and_intact() "mcp_servers = 42\n".to_owned(), "mcp_servers = []\nmcp_servers = {}\n".to_owned(), ], - Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => vec![ + Client::Antigravity + | Client::ClaudeCode + | Client::Cursor + | Client::Gemini + | Client::Kiro => vec![ format!("{{\"private\":\"{PRIVATE}\", \"unfinished\": "), "[]".to_owned(), "{\"mcpServers\": []}".to_owned(),