Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Start the macOS MCP launch agent after bootstrap

Cursor Agentb51a93f863af
diff --git a/scripts/install-mcp.py b/scripts/install-mcp.py
index 64fbb988..437411a6 100644
--- a/scripts/install-mcp.py
+++ b/scripts/install-mcp.py
@@ -169,6 +169,7 @@ def service(home, executable, directory, port, token):
domain = f'gui/{os.getuid()}'
subprocess.run(['launchctl', 'bootout', domain + '/dev.codegraff.mcp'], capture_output=True)
subprocess.run(['launchctl', 'bootstrap', domain, str(target)], check=True, capture_output=True)
+ subprocess.run(['launchctl', 'kickstart', '-k', domain + '/dev.codegraff.mcp'], check=True, capture_output=True)
elif sys.platform.startswith('linux') and shutil.which('systemctl'):
target = home / '.config/systemd/user/codegraff-mcp.service'
if target.exists() and MARKER not in target.read_text():
diff --git a/scripts/test-install-mcp.py b/scripts/test-install-mcp.py
index e5611e49..2d5ae527 100644
--- a/scripts/test-install-mcp.py
+++ b/scripts/test-install-mcp.py
@@ -83,7 +83,13 @@ class InstallTests(unittest.TestCase):
self.assertEqual(data['ProgramArguments'][0], '/Applications/A B.app/graff')
self.assertEqual(data['EnvironmentVariables']['GRAFF_MCP_TOKEN'], self.token)
self.assertEqual(path.stat().st_mode & 0o777, 0o600)
- self.assertEqual(run.call_count, 2)
+ commands = [tuple(call.args[0]) for call in run.call_args_list]
+ domain = f'gui/{os.getuid()}/dev.codegraff.mcp'
+ self.assertEqual(commands, [
+ ('launchctl', 'bootout', domain),
+ ('launchctl', 'bootstrap', f'gui/{os.getuid()}', str(path)),
+ ('launchctl', 'kickstart', '-k', domain),
+ ])
def test_unmanaged_service_preserved(self):
path = self.home / 'Library/LaunchAgents/dev.codegraff.mcp.plist'