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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct InstallArgs {

#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
enum Client {
#[value(alias = "agy")]
Antigravity,
#[value(alias = "claude")]
ClaudeCode,
Codex,
Expand All @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/agent/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ pub(super) fn prepare(
) -> Result<Update, InstallError> {
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),
}
}

Expand Down
28 changes: 23 additions & 5 deletions src/agent/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -95,7 +96,11 @@ fn configuration(client: Client) -> Vec<u8> {
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": {
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down