Skip to content

Publish package to PyPI for easier installation (uvx / pip support) #138

@filhocf

Description

@filhocf

Problem

The huaweicloud-mcp-server package is not published on PyPI, which means users cannot install it via standard Python package managers:

# These don't work currently:
pip install huaweicloud-mcp-server
uvx huaweicloud-mcp-server

This makes it harder to integrate with MCP-compatible IDEs and tools (like Cursor, Kiro, Cline, etc.) that typically configure MCP servers using uvx for Python packages.

Currently, users must:

  1. Clone the entire repository
  2. Run uv run from the project root directory
  3. Or install locally with pip install -e .

Proposed Solution

Publish the package to PyPI so users can:

# Install globally
pip install huaweicloud-mcp-server

# Run directly with uvx (no install needed)
uvx huaweicloud-mcp-server mcp-server-ecs -t stdio

# Or use in MCP config (e.g., for Kiro/Cursor/Cline)
{
  "mcpServers": {
    "huawei-ecs": {
      "command": "uvx",
      "args": ["huaweicloud-mcp-server", "mcp-server-ecs", "-t", "stdio"],
      "env": {
        "HUAWEI_ACCESS_KEY": "...",
        "HUAWEI_SECRET_KEY": "..."
      }
    }
  }
}

Steps Needed

  1. Verify pyproject.toml - The project already has a well-structured pyproject.toml with entry points defined in [project.scripts]. This should work as-is for PyPI.

  2. Set up PyPI publishing - Add a GitHub Actions workflow for automated publishing:

    # .github/workflows/publish.yml
    name: Publish to PyPI
    on:
      release:
        types: [published]
    jobs:
      publish:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-python@v5
            with:
              python-version: '3.10'
          - run: pip install build twine
          - run: python -m build
          - run: twine upload dist/*
            env:
              TWINE_USERNAME: __token__
              TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
  3. Test the build locally:

    pip install build
    python -m build
    pip install dist/huaweicloud_mcp_server-0.3.0-py3-none-any.whl
    mcp-server-ecs -t stdio  # Should work
  4. Consider package naming - huaweicloud-mcp-server is a good name. Verify it's available on PyPI.

Benefits

  • Easier adoption by the MCP community
  • Standard installation workflow (pip install / uvx)
  • Seamless integration with MCP-compatible IDEs
  • Version management through PyPI releases
  • No need to clone the full repository

Additional Context

  • The pyproject.toml already defines 100+ entry points (mcp-server-ecs, mcp-server-cce, etc.)
  • Dependencies are already properly declared
  • The package structure with setuptools is ready for building

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions