Prepared the beads-mcp package for publishing to PyPI, simplifying installation for users who want to use the MCP server with Claude Desktop or other MCP clients. Changes: - Added LICENSE file (MIT) to integrations/beads-mcp/ - Updated pyproject.toml with PyPI metadata (license, URLs, classifiers) - Updated README with simplified installation (uv tool install beads-mcp) - Created PYPI.md with detailed publishing guide - Updated examples/claude-desktop-mcp/README to reference the production MCP server Installation is now simplified from: git clone && cd && uv sync to: uv tool install beads-mcp Configuration is simplified from multi-line with --directory args to: "command": "beads-mcp" Tested build successfully. Package ready for: - Test PyPI: python -m twine upload --repository testpypi dist/* - Production PyPI: python -m twine upload dist/* 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.0 KiB
Publishing beads-mcp to PyPI
This guide covers how to build and publish the beads-mcp package to the Python Package Index (PyPI).
Prerequisites
-
PyPI Account: Create accounts on both:
-
API Tokens: Generate API tokens for authentication:
-
Build Tools: Install the Python build tools:
uv pip install --upgrade build twine
Building the Package
-
Clean previous builds (if any):
rm -rf dist/ build/ src/*.egg-info -
Build the distribution packages:
python -m buildThis creates both:
dist/beads_mcp-0.9.4-py3-none-any.whl(wheel)dist/beads-mcp-0.9.4.tar.gz(source distribution)
-
Verify the build:
tar -tzf dist/beads-mcp-0.9.4.tar.gzShould include:
- Source files in
src/beads_mcp/ README.mdLICENSEpyproject.toml
- Source files in
Testing the Package
Test on Test PyPI First
-
Upload to Test PyPI:
python -m twine upload --repository testpypi dist/*When prompted, use:
- Username:
__token__ - Password: Your Test PyPI API token (including the
pypi-prefix)
- Username:
-
Install from Test PyPI:
# In a fresh virtual environment uv venv test-env source test-env/bin/activate # Install from Test PyPI pip install --index-url https://test.pypi.org/simple/ beads-mcp # Test it works beads-mcp --help -
Verify the installation:
python -c "import beads_mcp; print(beads_mcp.__version__)"
Publishing to PyPI
Once you've verified the package works on Test PyPI:
-
Upload to PyPI:
python -m twine upload dist/*Use:
- Username:
__token__ - Password: Your PyPI API token
- Username:
-
Verify on PyPI:
- Visit https://pypi.org/project/beads-mcp/
- Check that the README displays correctly
- Verify all metadata is correct
-
Test installation:
# In a fresh environment pip install beads-mcp beads-mcp --help
Updating the README Installation Instructions
After publishing, users can install simply with:
pip install beads-mcp
# or with uv
uv pip install beads-mcp
Update the README.md to reflect this simpler installation method.
Version Management
When releasing a new version:
- Update version in
src/beads_mcp/__init__.py - Update version in
pyproject.toml - Use the version bump script from the parent project:
cd ../.. ./scripts/bump-version.sh 0.9.5 --commit - Create a git tag:
git tag v0.9.5 git push origin v0.9.5 - Clean, rebuild, and republish to PyPI
Troubleshooting
Package Already Exists
PyPI doesn't allow re-uploading the same version. If you need to fix something:
- Increment the version number (even for minor fixes)
- Rebuild and re-upload
Missing Files in Distribution
If files are missing from the built package, create a MANIFEST.in:
include README.md
include LICENSE
recursive-include src/beads_mcp *.py
Authentication Errors
- Ensure you're using
__token__as the username (exactly) - Token should include the
pypi-prefix - Check token hasn't expired
Test PyPI vs Production
Test PyPI is completely separate from production PyPI:
- Different accounts
- Different tokens
- Different package versions (can have different versions on each)
Always test on Test PyPI first!
Continuous Deployment (Future)
Consider setting up GitHub Actions to automate this:
- On tag push (e.g.,
v0.9.5) - Run tests
- Build package
- Publish to PyPI
See .github/workflows/ in the parent project for examples.