Skip to content

Fix powermem-mcp help to exit without starting the server - #1124

Merged
wayyoungboy merged 1 commit into
oceanbase:mainfrom
wayyoungboy:codex/issue-1120-mcp-help-exits
Jun 30, 2026
Merged

Fix powermem-mcp help to exit without starting the server#1124
wayyoungboy merged 1 commit into
oceanbase:mainfrom
wayyoungboy:codex/issue-1120-mcp-help-exits

Conversation

@wayyoungboy

Copy link
Copy Markdown
Member

Summary

Fixes #1120.

  • Route powermem-mcp and python -m powermem.mcp through a lightweight CLI parser so --help exits before importing the MCP server.
  • Keep normal MCP server startup behavior delegated to the existing server implementation, including the default transport, sse/stdio, custom ports, and invalid-port fallback.
  • Update release binary entrypoint generation and smoke checks so packaged powermem-mcp --help uses the same lightweight path.

Validation

  • python -m pytest tests/unit/test_mcp_cli.py tests/unit/test_release_binary_ci.py -q
  • python -m pytest tests/unit/test_optional_dependency_imports.py tests/unit/server/test_main_mcp_optional.py -q
  • python -m py_compile src/powermem/mcp/args.py src/powermem/mcp/cli.py src/powermem/mcp/server.py src/powermem/mcp/__main__.py tests/unit/test_mcp_cli.py scripts/smoke_binary_package.py tests/unit/test_release_binary_ci.py
  • bash -n scripts/build_binary_package.sh
  • powermem-mcp --help
  • python -m powermem.mcp --help
  • git diff --check
  • python scripts/check_package_versions.py

The direct CLI E2E check returned 0, printed usage text, emitted no server-start log, and did not leave the default MCP port open.

Two independent code reviews found no blocking issues.

@wayyoungboy
wayyoungboy marked this pull request as ready for review June 30, 2026 05:59
@wayyoungboy
wayyoungboy merged commit 9f06e2f into oceanbase:main Jun 30, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: powermem-mcp --help starts the MCP server instead of printing help

1 participant