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
36 changes: 36 additions & 0 deletions docs/MCP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,42 @@ Agents should search or gather facts before asserting. Use
agents should recall, and always include a stable dimension, confidence reason,
and evidence.

### Fathom CUA MCP

Maestro can attach the local Fathom computer-use MCP shim as a plugin-managed
stdio server. This keeps desktop-control tools available through the same
Maestro MCP manager and agent tool bridge used for other MCP servers.

Enable it for a local run:

```bash
export MAESTRO_FATHOM_CUA_ENABLED=1
export MAESTRO_FATHOM_CUA_REPO=/path/to/fathom
export MAESTRO_FATHOM_CUA_WORKSPACE_ID=workspace_1
```

Optional runtime settings:

| Variable | Purpose |
| --- | --- |
| `MAESTRO_FATHOM_CUA_MCP_NAME` | MCP server name; defaults to `fathom-cua`. |
| `MAESTRO_FATHOM_CUA_CLIENT_COMMAND` | Installed `fathom-client` command. If omitted and a repo is configured or found, Maestro uses `go run ./cmd/fathom-client`. |
| `MAESTRO_FATHOM_CUA_CLIENT_ARGS_JSON` | Extra JSON string array of `fathom-client` arguments. |
| `MAESTRO_FATHOM_CUA_IPC_ROOT` | Helper IPC root for live desktop actions. |
| `MAESTRO_FATHOM_CUA_SESSION_ID` / `MAESTRO_FATHOM_CUA_TURN_ID` | Receipt lineage IDs propagated into Fathom. |
| `MAESTRO_FATHOM_CUA_DISABLE_IPC` | Set to `1` for negotiation/tool-list checks without Helper IPC. |

To prove the full local path, run the live smoke on a Mac with Accessibility
permission granted:

```bash
MAESTRO_RUN_LIVE_FATHOM_CUA_MCP=1 npm run smoke:fathom-cua-mcp
```

The smoke opens Fathom's local AppKit dogfood target, connects `fathom-cua`
through Maestro's MCP manager, calls `get_app_state`, executes `set_value`, and
verifies the application state changed without printing the raw typed value.

## Creating a Custom MCP Server

### Minimal TypeScript Server
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@
"smoke": "node scripts/smoke-cli.js",
"smoke:local-e2e": "node scripts/smoke-cli.js",
"smoke:codex-app-server-live": "node scripts/smoke-codex-app-server-live.mjs",
"smoke:fathom-cua-mcp": "tsx scripts/smoke-fathom-cua-mcp.ts",
"smoke:event-bus": "tsx scripts/smoke-maestro-event-bus.ts",
"smoke:a2a-local": "tsx scripts/smoke-maestro-a2a-local.ts",
"smoke:a2a-local-swarm": "tsx scripts/smoke-maestro-a2a-local-swarm.ts",
"smoke:a2a-input-required": "tsx scripts/smoke-maestro-a2a-input-required.ts",
"smoke:a2a-tmux": "bash scripts/smoke-maestro-a2a-tmux.sh",
"a2a": "tsx src/cli.ts a2a",
"a2a:codex-bridge": "python3 scripts/codex-a2a-bridge.py",
"a2a:peer": "tsx src/cli.ts a2a",
"smoke:headless": "node scripts/smoke-headless.js",
"smoke:exec-replay-e2e": "node scripts/smoke-exec-replay-e2e.js",
"headless:responsiveness": "node scripts/headless-responsiveness-harness.js",
"smoke:pack": "node scripts/smoke-packed-cli.js",
"smoke:a2a-input-required": "tsx scripts/smoke-maestro-a2a-input-required.ts",
"smoke:a2a-tmux": "bash scripts/smoke-maestro-a2a-tmux.sh",
"a2a": "tsx src/cli.ts a2a",
"a2a:codex-bridge": "python3 scripts/codex-a2a-bridge.py",
"a2a:peer": "tsx src/cli.ts a2a",
"smoke:headless": "node scripts/smoke-headless.js",
"headless:responsiveness": "node scripts/headless-responsiveness-harness.js",
"smoke:pack": "node scripts/smoke-packed-cli.js",
"metadata:sync": "node scripts/sync-package-metadata.js",
"metadata:check": "node scripts/sync-package-metadata.js --check",
"cutover:check": "node scripts/check-package-cutover-readiness.js",
Expand Down
11 changes: 10 additions & 1 deletion scripts/check-smoke-scripts.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/usr/bin/env node

import { build } from "esbuild";
import { existsSync } from "node:fs";

const entryPoints = process.argv.slice(2).filter(Boolean);
const entryPoints = process.argv
.slice(2)
.filter(Boolean)
.map((entryPoint) =>
entryPoint.startsWith(".") || entryPoint.startsWith("/")
? entryPoint
: `./${entryPoint}`,
)
.filter((entryPoint) => existsSync(entryPoint));

if (entryPoints.length === 0) {
console.log("No smoke scripts to check.");
Expand Down
1 change: 1 addition & 0 deletions scripts/ci-nx-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ run_ci_guardrail_tests() {
run_smoke_script_static_checks() {
local smoke_scripts=()
while IFS= read -r file; do
[[ -f "$file" ]] || continue
smoke_scripts+=("$file")
done < <(grep -E '^scripts/smoke-[^/]+\.[cm]?[jt]sx?$' "$changed_files_log" || true)
if [[ "${#smoke_scripts[@]}" -eq 0 ]]; then
Expand Down
49 changes: 48 additions & 1 deletion scripts/plan-ci-checks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@ const RUNTIME_PACKAGE_VALIDATOR_FILES = new Set([
"scripts/check-docker-runtime-workspaces.mjs",
"scripts/check-packed-bundled-workspaces.mjs",
"scripts/check-runtime-deps.js",
"scripts/install-smoke-utils.js",
"scripts/release-readiness.js",
"scripts/runtime-workspaces.mjs",
"scripts/validate-public-package-deps.js",
"scripts/workspace-utils.js",
]);
const RELEASE_HELPER_PACKAGE_FILES = new Set([
"scripts/install-smoke-utils.js",
"scripts/release-readiness.js",
"scripts/smoke-packed-cli.js",
"scripts/workspace-utils.js",
]);

function isPackageManifest(path) {
Expand Down Expand Up @@ -159,7 +168,6 @@ function isProofHarnessPath(path) {
CI_GUARDRAIL_FILES.has(path) ||
isFastPrChecksInfrastructurePath(path) ||
(path.startsWith("docs/") && path.endsWith(".md")) ||
isPackageManifest(path) ||
isSmokeScript(path)
);
}
Expand All @@ -177,6 +185,23 @@ function isRustHostedConformancePath(path) {
return isRustSetupActionPath(path) || isRustOnlySourcePath(path);
}

function isLightPrChecksPath(path) {
return (
isCiInfrastructureOnlyPath(path) ||
CI_GUARDRAIL_FILES.has(path) ||
RUNTIME_PACKAGE_VALIDATOR_FILES.has(path) ||
isSmokeScript(path)
);
}

function isReleaseHelperOnlyPath(path) {
return (
isCiInfrastructureOnlyPath(path) ||
path === "scripts/plan-nx-test-command.mjs" ||
RELEASE_HELPER_PACKAGE_FILES.has(path)
);
}

export function planCiChecks({ eventName, labels = [], changedFiles = [] }) {
const normalizedLabels = normalizeLabels(labels);
const labelSet = new Set(normalizedLabels);
Expand All @@ -186,6 +211,8 @@ export function planCiChecks({ eventName, labels = [], changedFiles = [] }) {
return {
ciInfrastructureOnly: false,
coverage: true,
lightPrChecks: false,
releaseHelperOnly: false,
prChecks: true,
publicMirror: true,
rustHostedConformance: true,
Expand All @@ -197,6 +224,8 @@ export function planCiChecks({ eventName, labels = [], changedFiles = [] }) {
return {
ciInfrastructureOnly: false,
coverage: true,
lightPrChecks: false,
releaseHelperOnly: false,
prChecks: true,
publicMirror: true,
rustHostedConformance: true,
Expand Down Expand Up @@ -229,11 +258,24 @@ export function planCiChecks({ eventName, labels = [], changedFiles = [] }) {
labelSet.has("run-rust-hosted-conformance") ||
rustSetupActionChanged ||
files.some(isRustHostedConformancePath);
const lightPrChecks =
!coverage &&
!rustHostedConformance &&
files.length > 0 &&
files.every((path) => isLightPrChecksPath(path));
const releaseHelperOnly =
!coverage &&
!rustHostedConformance &&
files.length > 0 &&
files.some((path) => RELEASE_HELPER_PACKAGE_FILES.has(path)) &&
files.every((path) => isReleaseHelperOnlyPath(path));

return {
ciInfrastructureOnly,
coverage,
lightPrChecks,
proofHarnessOnly,
releaseHelperOnly,
prChecks,
publicMirror,
rustHostedConformance,
Expand Down Expand Up @@ -274,7 +316,9 @@ function writeGitHubOutputs(plan) {
[
`coverage=${plan.coverage}`,
`ci_infrastructure_only=${plan.ciInfrastructureOnly ?? false}`,
`light_pr_checks=${plan.lightPrChecks ?? false}`,
`proof_harness_only=${plan.proofHarnessOnly ?? false}`,
`release_helper_only=${plan.releaseHelperOnly ?? false}`,
`pr_checks=${plan.prChecks}`,
`public_mirror=${plan.publicMirror}`,
`rust_hosted_conformance=${plan.rustHostedConformance}`,
Expand All @@ -292,6 +336,8 @@ function writeGitHubSummary(plan, changedFiles) {
"",
`- CI infrastructure only: \`${plan.ciInfrastructureOnly ?? false}\``,
`- coverage: \`${plan.coverage}\``,
`- light PR checks: \`${plan.lightPrChecks ?? false}\``,
`- release helper only: \`${plan.releaseHelperOnly ?? false}\``,
`- pr checks: \`${plan.prChecks}\``,
`- public release mirror: \`${plan.publicMirror}\``,
`- rust hosted conformance: \`${plan.rustHostedConformance}\``,
Expand Down Expand Up @@ -321,6 +367,7 @@ async function main() {
process.stdout.write(
[
`coverage=${plan.coverage}`,
`release_helper_only=${plan.releaseHelperOnly ?? false}`,
`pr_checks=${plan.prChecks}`,
`public_mirror=${plan.publicMirror}`,
`rust_hosted_conformance=${plan.rustHostedConformance}`,
Expand Down
4 changes: 4 additions & 0 deletions scripts/plan-nx-test-command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ const RUNTIME_PACKAGE_VALIDATOR_FILES = new Set([
"scripts/check-docker-runtime-workspaces.mjs",
"scripts/check-packed-bundled-workspaces.mjs",
"scripts/check-runtime-deps.js",
"scripts/install-smoke-utils.js",
"scripts/release-readiness.js",
"scripts/runtime-workspaces.mjs",
"scripts/smoke-packed-cli.js",
"scripts/validate-public-package-deps.js",
"scripts/workspace-utils.js",
]);
const SMOKE_SCRIPT_PATTERN = /^scripts\/smoke-[^/]+\.[cm]?[jt]sx?$/;

Expand Down
5 changes: 0 additions & 5 deletions scripts/smoke-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ const commands = [
cmd: "node",
args: ["scripts/smoke-headless.js"],
},
{
name: "exec-replay-e2e",
cmd: "node",
args: ["scripts/smoke-exec-replay-e2e.js"],
},
{
name: "mock-agent-read",
cmd: "node",
Expand Down
Loading
Loading