Cli
cli
AXM MCP CLI — Lifecycle management for the MCP server.
Subcommands
serve Start the Streamable HTTP server. status Check whether the server is running. stop Send SIGTERM to the running server.
Running axm-mcp with no subcommand preserves backward-compatible
stdio mode.
install(*, port=DEFAULT_PORT, binary=None)
Install the MCP server as a launchd service.
Source code in packages/axm-mcp/src/axm_mcp/cli.py
is_axm_mcp_process(pid)
Return True only if pid's command line identifies an axm-mcp server.
Guards against OS PID reuse: an existence probe (:func:is_process_alive)
cannot tell our server apart from an unrelated process that inherited the
same PID. We inspect the target's command line via ps (portable to
macOS and Linux; no /proc dependency, no psutil) and require the
axm-mcp marker. Any failure (process vanished, ps error, mismatch)
yields False — we never send SIGTERM on an unconfirmed identity.
Source code in packages/axm-mcp/src/axm_mcp/cli.py
is_process_alive(pid)
Check whether a process with pid is running.
main()
read_pid()
Read PID from file, returning None if absent or invalid.
remove_pid_file()
serve(*, host='127.0.0.1', port=DEFAULT_PORT)
Start the MCP server with Streamable HTTP transport.
Source code in packages/axm-mcp/src/axm_mcp/cli.py
status(*, host='127.0.0.1', port=DEFAULT_PORT)
Check whether the MCP server is running.
Source code in packages/axm-mcp/src/axm_mcp/cli.py
stop()
Stop the running MCP server.
Before sending SIGTERM, the target PID's identity is verified against the
axm-mcp command-line marker. If the PID has been reused by an unrelated
process (or vanished), the signal is NOT sent: the stale PID file is
removed and the command exits non-zero.