- Add new metadata.py module with 4 core functions: * update_package_metadata: Update description, keywords, classifiers * manage_package_urls: Update homepage, documentation, repository URLs * set_package_visibility: Make packages private/public (for organizations) * manage_package_keywords: Update search keywords and tags - Add PyPIMetadataClient with comprehensive async/await patterns - Include robust error handling and validation for all metadata formats - Provide implementation guidance for metadata updates via package uploads - Add MCP server endpoints for all 4 metadata management functions - Update tools/__init__.py with proper imports and exports - Create comprehensive test suite with 50+ test cases covering: * Client initialization and validation * All metadata management functions * Error handling and edge cases * URL validation and accessibility checking * Keyword quality analysis and scoring * Integration workflows Features: - Production-ready code following existing patterns - Comprehensive docstrings and type hints - Authentication with API tokens - Dry-run mode for safe validation - URL quality scoring and accessibility validation - Keyword quality analysis with recommendations - Organization detection for visibility management - Detailed validation errors and recommendations
72 lines
1.9 KiB
Python
72 lines
1.9 KiB
Python
"""MCP tools for PyPI package queries.
|
|
|
|
This package contains the FastMCP tool implementations that provide
|
|
the user-facing interface for PyPI package operations.
|
|
"""
|
|
|
|
from .compatibility_check import (
|
|
check_python_compatibility,
|
|
get_compatible_python_versions,
|
|
suggest_python_version_for_packages,
|
|
)
|
|
from .dependency_resolver import resolve_package_dependencies
|
|
from .download_stats import (
|
|
get_package_download_stats,
|
|
get_package_download_trends,
|
|
get_top_packages_by_downloads,
|
|
)
|
|
from .package_downloader import download_package_with_dependencies
|
|
from .package_query import (
|
|
query_package_dependencies,
|
|
query_package_info,
|
|
query_package_versions,
|
|
)
|
|
from .metadata import (
|
|
manage_package_keywords,
|
|
manage_package_urls,
|
|
set_package_visibility,
|
|
update_package_metadata,
|
|
)
|
|
from .publishing import (
|
|
check_pypi_credentials,
|
|
delete_pypi_release,
|
|
get_pypi_account_info,
|
|
get_pypi_upload_history,
|
|
manage_pypi_maintainers,
|
|
upload_package_to_pypi,
|
|
)
|
|
from .search import (
|
|
find_alternatives,
|
|
get_trending_packages,
|
|
search_by_category,
|
|
search_packages,
|
|
)
|
|
|
|
__all__ = [
|
|
"query_package_info",
|
|
"query_package_versions",
|
|
"query_package_dependencies",
|
|
"check_python_compatibility",
|
|
"get_compatible_python_versions",
|
|
"suggest_python_version_for_packages",
|
|
"resolve_package_dependencies",
|
|
"download_package_with_dependencies",
|
|
"get_package_download_stats",
|
|
"get_package_download_trends",
|
|
"get_top_packages_by_downloads",
|
|
"search_packages",
|
|
"search_by_category",
|
|
"find_alternatives",
|
|
"get_trending_packages",
|
|
"upload_package_to_pypi",
|
|
"check_pypi_credentials",
|
|
"get_pypi_upload_history",
|
|
"delete_pypi_release",
|
|
"manage_pypi_maintainers",
|
|
"get_pypi_account_info",
|
|
"update_package_metadata",
|
|
"manage_package_urls",
|
|
"set_package_visibility",
|
|
"manage_package_keywords",
|
|
]
|