mcp-vultr/BUILD.md
Ryan Malloy e6f66dc931
Some checks are pending
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
Tests / test (3.13) (push) Waiting to run
Tests / build (push) Blocked by required conditions
Tests / test-install (3.10) (push) Blocked by required conditions
Tests / test-install (3.13) (push) Blocked by required conditions
Tests / security (push) Waiting to run
Refactor package name from vultr-dns-mcp to mcp-vultr
- Rename package from vultr-dns-mcp to mcp-vultr for MCP organization
- Update module name from vultr_dns_mcp to mcp_vultr throughout codebase
- Rename src/vultr_dns_mcp/ to src/mcp_vultr/
- Update all import statements and references in Python files
- Update documentation files (README.md, CLAUDE.md, etc.)
- Update CLI script names in pyproject.toml
- Update test files with new import paths

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 21:49:38 -06:00

3.8 KiB

Building and Publishing to PyPI

This document provides instructions for building and publishing the mcp-vultr package to PyPI.

Prerequisites

  1. Install build tools:

    pip install build twine
    
  2. Set up PyPI credentials:

    • Create account on PyPI
    • Create account on TestPyPI for testing
    • Generate API tokens for both accounts
    • Configure credentials in ~/.pypirc:
      [distutils]
      index-servers =
          pypi
          testpypi
      
      [pypi]
      username = __token__
      password = pypi-your-api-token-here
      
      [testpypi]
      repository = https://test.pypi.org/legacy/
      username = __token__
      password = pypi-your-test-api-token-here
      

Building the Package

  1. Clean previous builds:

    rm -rf build/ dist/ *.egg-info/
    
  2. Build the package:

    python -m build
    

    This creates:

    • dist/mcp_vultr-1.0.0-py3-none-any.whl (wheel)
    • dist/mcp-vultr-1.0.0.tar.gz (source distribution)
  3. Verify the build:

    python -m twine check dist/*
    

Testing on TestPyPI

  1. Upload to TestPyPI:

    python -m twine upload --repository testpypi dist/*
    
  2. Test installation from TestPyPI:

    pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mcp-vultr
    
  3. Test functionality:

    mcp-vultr --help
    python -c "from mcp_vultr import VultrDNSClient; print('Import successful')"
    

Publishing to PyPI

  1. Upload to PyPI:

    python -m twine upload dist/*
    
  2. Verify publication:

Version Management

  1. Update version in _version.py:

    __version__ = "1.1.0"
    
  2. Update version in pyproject.toml:

    version = "1.1.0"
    
  3. Update CHANGELOG.md with new version details

  4. Create git tag:

    git tag v1.1.0
    git push origin v1.1.0
    

Automated Publishing (GitHub Actions)

Create .github/workflows/publish.yml:

name: Publish to PyPI

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.x'
    - name: Install build dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build twine
    - name: Build package
      run: python -m build
    - name: Publish to PyPI
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
      run: twine upload dist/*

Release Checklist

  • Update version numbers
  • Update CHANGELOG.md
  • Run tests: pytest
  • Check code quality: black --check src tests && isort --check src tests
  • Type check: mypy src
  • Build package: python -m build
  • Check package: twine check dist/*
  • Test on TestPyPI
  • Create git tag
  • Upload to PyPI
  • Verify installation works
  • Update documentation if needed

Package Maintenance

Dependencies

  • Keep dependencies updated in pyproject.toml
  • Test with latest versions of dependencies
  • Consider version constraints for stability

Documentation

  • Keep README.md updated with new features
  • Update API documentation for new methods
  • Add examples for new functionality

Testing

  • Add tests for new features
  • Maintain high test coverage
  • Test against multiple Python versions

Security

  • Regularly update dependencies
  • Monitor for security vulnerabilities
  • Follow security best practices