MCP Server Package Fixes: - Add build-system configuration to pyproject.toml - Fix module imports to use relative imports for proper packaging - Fix TypedDict import for Python 3.10 compatibility - Remove unsupported MCP SDK parameters (tags, meta) - Add GitHub Actions workflow for automatic PyPI publishing - Add PyPI publishing documentation and checklist Code Quality Improvements: - Fix code formatting in graphiti_core (line length, whitespace) This prepares v1.0.0 for publication to PyPI, enabling users to install with: uvx graphiti-mcp-varming 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3.1 KiB
3.1 KiB
PyPI Publishing Setup Instructions
This guide explains how to publish the graphiti-mcp-varming package to PyPI.
One-Time Setup
1. Add PyPI Token to GitHub Secrets
- Go to your repository on GitHub: https://github.com/Varming73/graphiti
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
PYPI_API_TOKEN - Value: Paste your PyPI API token (starts with
pypi-) - Click Add secret
Publishing a New Version
Option 1: Automatic Publishing (Recommended)
-
Update the version in
mcp_server/pyproject.toml:version = "1.0.1" # Increment version -
Commit the change:
cd mcp_server git add pyproject.toml git commit -m "Bump MCP server version to 1.0.1" git push -
Create and push a tag:
git tag mcp-v1.0.1 git push origin mcp-v1.0.1 -
GitHub Actions will automatically:
- Build the package
- Publish to PyPI
- Create a GitHub release
-
Monitor the workflow:
- Go to Actions tab in GitHub
- Watch the "Publish MCP Server to PyPI" workflow
Option 2: Manual Publishing
If you prefer to publish manually:
cd mcp_server
# Remove local graphiti-core override
sed -i.bak '/\[tool\.uv\.sources\]/,/graphiti-core/d' pyproject.toml
# Build the package
uv build
# Publish to PyPI
uv publish --token your-pypi-token-here
# Restore the backup if needed for local development
mv pyproject.toml.bak pyproject.toml
After Publishing
Users can install your package with:
# Basic installation (Neo4j support included)
uvx graphiti-mcp-varming
# With FalkorDB support
uvx --with graphiti-mcp-varming[falkordb] graphiti-mcp-varming
# With all LLM providers (Anthropic, Groq, Gemini, Voyage, etc.)
uvx --with graphiti-mcp-varming[providers] graphiti-mcp-varming
# With everything
uvx --with graphiti-mcp-varming[all] graphiti-mcp-varming
Version Numbering
Follow Semantic Versioning:
- MAJOR (1.0.0 → 2.0.0): Breaking changes
- MINOR (1.0.0 → 1.1.0): New features, backwards compatible
- PATCH (1.0.0 → 1.0.1): Bug fixes
Tag Naming Convention
Use mcp-v{VERSION} format for tags:
mcp-v1.0.0- Initial releasemcp-v1.0.1- Patch releasemcp-v1.1.0- Minor releasemcp-v2.0.0- Major release
This distinguishes MCP server releases from graphiti-core releases.
Troubleshooting
Publishing Fails with "File already exists"
You tried to publish a version that already exists on PyPI. Increment the version number in pyproject.toml and try again.
"Invalid or missing authentication token"
The PyPI token in GitHub secrets is incorrect or expired:
- Generate a new token at https://pypi.org/manage/account/token/
- Update the
PYPI_API_TOKENsecret in GitHub
Workflow doesn't trigger
Make sure:
- Tag matches pattern
mcp-v*.*.* - Tag is pushed to GitHub:
git push origin mcp-v1.0.0 - Workflow file is on the
mainbranch
Checking Published Package
After publishing, verify at:
- PyPI page: https://pypi.org/project/graphiti-mcp-varming/
- Test installation:
uvx graphiti-mcp-varming --help