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 @@ -28,7 +28,7 @@ set as `PROOFLINE_TOKEN`. A token that works in one organization needs no

### 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 `claude-code` (or `claude`), `cursor`, `codex`, `gemini`, `kiro`, and `windsurf`. 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`.

Native knowledge, plan, fix and configuration commands send the selected organization as `organization_id` in each MCP tool call. With a `PROOFLINE_TOKEN` that works in more than one organization, select an authorized UUID using `--org ORGANIZATION_ID` or `PROOFLINE_ORGANIZATION_ID`; the flag takes precedence. A token that works in exactly one, such as a personal token, needs neither. 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
3 changes: 3 additions & 0 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum Client {
Cursor,
Gemini,
Kiro,
Windsurf,
}

impl Client {
Expand All @@ -58,6 +59,7 @@ impl Client {
Self::Cursor => ".cursor/mcp.json",
Self::Gemini => ".gemini/settings.json",
Self::Kiro => ".kiro/settings/mcp.json",
Self::Windsurf => ".codeium/windsurf/mcp_config.json",
}
}
}
Expand All @@ -70,6 +72,7 @@ impl fmt::Display for Client {
Self::Cursor => "Cursor",
Self::Gemini => "Gemini CLI",
Self::Kiro => "Kiro",
Self::Windsurf => "Windsurf",
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/agent/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub(super) fn prepare(
) -> Result<Update, InstallError> {
match client {
Client::Codex => codex(original, origin),
Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro => {
Client::ClaudeCode | Client::Cursor | Client::Gemini | Client::Kiro | Client::Windsurf => {
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,12 +19,13 @@ 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::ClaudeCode,
Client::Codex,
Client::Cursor,
Client::Gemini,
Client::Kiro,
Client::Windsurf,
];

#[derive(Debug)]
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::ClaudeCode
| Client::Cursor
| Client::Gemini
| Client::Kiro
| Client::Windsurf => 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::ClaudeCode
| Client::Cursor
| Client::Gemini
| Client::Kiro
| Client::Windsurf => {
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::ClaudeCode
| Client::Cursor
| Client::Gemini
| Client::Kiro
| Client::Windsurf => 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 @@ -416,6 +429,7 @@ fn toml_inline_tables_and_separate_arguments_round_trip_in_unicode_homes() {
Client::Cursor,
Client::Gemini,
Client::Kiro,
Client::Windsurf,
] {
let precision = "{\"mcpServers\":{\"other\":{\"value\":184467440737095516170}},\"precision\":1.2345678901234567890123456789}";
seed(&home, client, precision.as_bytes());
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::ClaudeCode
| Client::Cursor
| Client::Gemini
| Client::Kiro
| Client::Windsurf => vec![
format!("{{\"private\":\"{PRIVATE}\", \"unfinished\": "),
"[]".to_owned(),
"{\"mcpServers\": []}".to_owned(),
Expand Down