Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .docs/wiki/Agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ For every project, add it to your user account instead: in the formMCP window, p
```bash
./formmcp cli agents install # Claude Code, Codex, Cursor and Antigravity
./formmcp cli agents install codex,cursor # some of them: claude, codex, cursor, antigravity
./formmcp cli agents status # connected, not connected, taken by another server, or no client
./formmcp cli agents status # connected, missing, not connected, taken by another server, or no client
./formmcp cli agents remove
```

Claude Code is set up with `claude mcp add --scope user formmcp` (only a user-scope entry counts as connected; a project's `.mcp.json`, like this repository's, is left alone); Codex gets `[mcp_servers.formmcp]` in `~/.codex/config.toml` (or `$CODEX_HOME`); Cursor gets `mcpServers.formmcp` in `~/.cursor/mcp.json`; Antigravity (Google's `agy` program) gets `mcpServers.formmcp` in `~/.gemini/config/mcp_config.json`, edited the way Cursor's file is (an older `~/.gemini/antigravity-cli/mcp_config.json` is never read or changed; the status says when only that one exists). formMCP finds the `claude` program on the PATH it was started with, in the known install folders, or on your shell's PATH, so the window finds it however it was opened; `FORMMCP_CLAUDE_BIN` names it when it is somewhere else. Each file is copied to `<name>.bak-<time>` before it changes, other servers are left as they are (in mcp.json only the `formmcp` entry's text changes, every other byte stays), and a server named `formmcp` that formMCP did not write is reported `taken` and left alone. A config.toml that is not valid TOML, and an mcp.json that is not plain JSON (comments or trailing commas), are never changed; the status says why. The entry starts the `./formmcp` launcher of this checkout and carries the formMCP settings that are set in your shell (`FORMMCP_DEV_ROOTS`, `FORMPORTAL_ROOT`, `FORMPORTAL_BIN`, `FORMMCP_CATALOG`, `FORMAI_CATALOG_PUBKEY`).

An agent counts as connected only while the program its entry starts is still there. When that program has been moved or deleted, or sat on a disk that is no longer attached, the agent's card says Not found with the program's path, `agents status` reports `missing` with the path in `program`, and Connect (or `agents install`) writes this copy of formMCP in its place; `agents remove` takes the entry out.

On macOS, formMCP will not connect an agent while it runs from a disk image (a mounted `.dmg` under `/Volumes`), because the agent could no longer start it once the image is ejected: drag formMCP to Applications, open it from there and press Connect again. Disconnect (and `agents remove`) still works from a disk image. Running from an external drive under `/Volumes` is fine. A volume counts as a disk image when macOS mounted it quarantined (as it does for a downloaded `.dmg`) or read-only with a Mac file system; a read-only FAT, exFAT or NTFS drive counts as an external drive.

## Tools

| Tool | Changes anything | Returns |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- An agent no longer shows Connected when the program its entry starts has gone, for example after FormMCP was moved or deleted, or the disk it ran from was ejected. The card says Not found with that program's path, and `formmcp-cli agents status` reports `missing` with the path. Press Connect to point the agent at the FormMCP you are running.
- On macOS, FormMCP will not connect an agent while it runs from a disk image: install it first by dragging it to Applications, then open it from there and press Connect. Disconnect still works from a disk image, and running it from an external drive still works.

## v0.14.1 · 2026-11-20

- Demo 2 shows what FormMCP says when only an older Antigravity file is there: its virtual home starts with `~/.gemini/antigravity-cli/mcp_config.json`, the file earlier Antigravity versions used, and no file at `~/.gemini/config/mcp_config.json`. As in the app, the Antigravity card's Connect button tells you the older file was seen and left alone and where FormMCP writes; the Agent setup pane says the same under the file's name. The older file is never changed.
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Its dependencies are MIT, Apache-2.0 or dual MIT and Apache-2.0, with some BSD-3
| regex 1 (regex-automata, regex-syntax, aho-corasick, memchr) | finding token-shaped text to hide in results and the log (`core`, v0.7.0); MIT OR Apache-2.0, aho-corasick and memchr Unlicense OR MIT |
| sha2 0.10 | the digests of an installed app's files (`core`, v0.7.0); MIT OR Apache-2.0, already in the graph through the dalek crates |
| toml_edit 0.25 (toml_parser, toml_datetime, winnow, indexmap), parse feature only | checking that Codex's config.toml is valid TOML before and after formMCP edits it (`core`, v0.10.4); toml_edit, toml_parser and toml_datetime MIT OR Apache-2.0, winnow MIT, indexmap Apache-2.0 OR MIT; all already in Cargo.lock through the desktop shell's build crates (proc-macro-crate, tauri-build), so nothing new is downloaded; now shipped in the CLI and the app |
| libc 0.2, macOS only | asking macOS (`statfs`) whether the volume formMCP runs from is a disk image or an external drive before it connects an agent (`core`); MIT OR Apache-2.0, already in Cargo.lock through getrandom, keyring and the desktop shell, so nothing new is downloaded |
| tauri 2, tauri-build | the desktop shell |
| Vite, TypeScript, @tauri-apps/cli, @types/node (build only) | building the window and the app; not shipped |
| `demo/index.html` and `demo/assets/` (v0.8.0) | the offline browser demo, compiled by Vite (MIT) from this repository's own window, tokens, family list and the TypeScript in `demo/src/`; the icon is the app's own; no third-party code, font or media is added |
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ fn main() -> ExitCode {
ExitCode::SUCCESS
}
"install" | "remove" => {
let launcher = match Launcher::current() {
let launcher = match Launcher::current_for(action == "install") {
Ok(l) => l,
Err(e) => {
eprintln!("formmcp: {e}");
Expand Down
15 changes: 13 additions & 2 deletions cli/tests/agent_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,19 @@ fn the_tests_reach_only_a_stand_in_for_claude_code() {
assert_eq!(s.agent_starts(), ["mcp get formmcp"]);

let other = s.path("elsewhere/claude-dev");
stand_in(&other, &format!("#!/bin/sh\necho \"chosen $*\" >> '{}'\necho 'Scope: User config'\necho 'Command: /x/formmcp'\n", s.path(AGENT_STARTS).display()));
let status = s.json(&["agents", "status", "claude"], &[("FORMMCP_CLAUDE_BIN", other.to_str().unwrap())]);
let server = s.path("installed/formmcp");
stand_in(&server, "#!/bin/sh\n");
stand_in(&other, &format!("#!/bin/sh\necho \"chosen $*\" >> '{}'\necho 'Scope: User config'\necho 'Command: {}'\n", s.path(AGENT_STARTS).display(), server.display()));
let chosen = [("FORMMCP_CLAUDE_BIN", other.to_str().unwrap())];
let status = s.json(&["agents", "status", "claude"], &chosen);
assert_eq!(status["clients"][0]["state"], json!("connected"), "{status}");
assert_eq!(status["clients"][0]["note"], json!(null), "{status}");
assert_eq!(s.agent_starts(), ["mcp get formmcp", "chosen mcp get formmcp"]);

std::fs::remove_file(&server).unwrap();
let status = s.json(&["agents", "status", "claude"], &chosen);
assert_eq!(status["clients"][0]["state"], json!("missing"), "{status}");
let note = status["clients"][0]["note"].as_str().unwrap_or_default();
assert!(note.contains(&format!("{}, is not on this computer any more", server.display())), "{status}");
assert_eq!(s.agent_starts(), ["mcp get formmcp", "chosen mcp get formmcp", "chosen mcp get formmcp"]);
}
3 changes: 3 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ keyring = { version = "3", features = ["apple-native", "windows-native", "sync-s
regex = "1"
sha2 = "0.10"
toml_edit = { version = "0.25", default-features = false, features = ["parse"] }

[target.'cfg(target_os = "macos")'.dependencies]
libc = "0.2"
16 changes: 16 additions & 0 deletions core/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ Living log for `formmcp-core`, `formmcp-cli` and `setup/family.py`. Source files
Current build version: v0.14.1
Last updated: 2026-11-20 · v0.14.1 no engine changes; v0.14.0 no engine changes; v0.13.0 Antigravity has its own switches and profiles; 2026-11-19 · v0.12.0 Antigravity is the fourth client, Claude Code is found on PATH, in the known install folders or on the shell's PATH, the tests reach only a stand-in for it; 2026-11-19 · v0.11.0 own answers sent once as text, a failed app start answered at once for 60 seconds, 120 seconds to start, one slow call no longer holds up every HTTP session, the catalogue can mark an app unreleased, hooks cover resource reads and prompts, suggest_app stems and weighs words, the family list generated from the family spec and the spec kept beside it, the list carries no registry version; 2026-11-11 · v0.10.4 Codex sections never found inside multi-line strings, an invalid config.toml refused, every Codex edit checked before it is saved, Cursor edits change only the formmcp entry's bytes, the plain-JSON reason in the Cursor status; 2026-11-10 · v0.10.3 imported profiles keyed by app id, launchers pass every argument, host files written whole with unique backups, comments after the Codex section kept, Cursor files with a byte order mark, hook commands keep Windows backslashes, an unreadable host file is refused, programs found by Windows extensions, ownership from the entry's command, Codex entries in any TOML form; 2026-11-10 · v0.10.2 the agent check no longer matches its own header, formmcp.bat branches run at run time; 2026-11-09 · v0.10.0 demo_open; 2026-11-02 · the catalogue from the public download store; 2026-10-26 · the test suite (cli/tests, core/tests); 2026-10-25 · the file check against FormPortal's record; keychain secrets, redaction, the file check, hooks and tracing; profiles and start policies; HTTP, apps per agent, tool switches, resources and prompts; formMCP in the registry, never in its own list; skills out of formMCP; the activity log and Claude Code's user scope; the signed catalogue, suggest_app, always-expose, agents install; the gateway; the family list and the MCP server

## Unreleased · a gone program and a disk image {#unreleased}

### clients.rs · an entry whose program is gone reads as missing
- refers-to: core/src/clients.rs :: Link::Missing, ClientState::program, recorded, noted, claude_state, codex_state, json_state, state, connect · core/tests/host_files.rs :: an_entry_whose_program_is_gone_shows_not_found_with_the_path, an_entry_somebody_else_wrote_names_no_program
- kind: change
- logged: unreleased · 2026-11-29

An entry counts as formMCP's by the command's name (`formmcp`, `formmcp-cli`) or as this program's path, as before. Such an entry is now `missing` when its command is an absolute path that is not a file, and `connected` otherwise; a bare name is not looked up and stays connected. `ClientState.program` carries the recorded command for `connected` and `missing` only, never for an entry somebody else wrote, and the note for `missing` names the path. Connect writes over a missing entry and remove takes it out, the same as a connected one. The host_files tests used `/x/formmcp`, a path that is not there; each scratch home now holds a stand-in file at `FormMCP/formmcp` and the tests write that path, and the two tests that start from an old entry (`/old/formmcp`) now expect `missing` before they connect.

### mounts.rs, clients.rs · no agent is connected from a disk image
- refers-to: core/src/mounts.rs :: Mount, Mount::volume, Volume, mount_of · core/src/clients.rs :: Launcher::current_for, Launcher::for_exe, Launcher::for_exe_on · cli/src/main.rs :: agents install, agents remove · src-tauri/src/lib.rs :: connect · core/tests/host_files.rs :: a_volume_is_told_apart_from_a_disk_image_by_its_mount, the_launcher_refuses_a_disk_image_and_takes_an_external_drive, an_agent_can_still_be_disconnected_while_running_from_a_disk_image, the_startup_disk_reads_as_neither_an_image_nor_a_drive
- kind: change
- logged: unreleased · 2026-11-29

`for_exe` asks `statfs` (libc, macOS only; `mount_of` is `None` elsewhere) about a program under `/Volumes` and `for_exe_on` refuses a disk image with a note to install the app first. statfs has no flag that names a disk image, so `Mount::volume` decides from what it does give: a mount point outside `/Volumes/` is the startup disk; under it, a volume mounted quarantined (macOS marks a downloaded `.dmg` that way) or read-only with any file system but `msdos`, `exfat` or `ntfs` is a disk image; everything else is an external drive. A writable image that was never quarantined (a sparse bundle made on this Mac) reads as an external drive. When statfs fails the program is taken as it is. The refusal applies to connecting only: `Launcher::current_for(on)` passes `on` through, and the window's Disconnect and `agents remove` ask with `on` false, because taking an entry out writes no program path.

## v0.13.0 · Antigravity is its own choice {#v0-13-0}

### settings.rs, mcp.rs, cli main.rs · Antigravity has its own switches and profiles
Expand Down
Loading
Loading