2025-05-27 11:14:49 +08:00
|
|
|
"""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,
|
|
|
|
|
)
|
2025-05-27 18:02:45 +08:00
|
|
|
from .dependency_resolver import resolve_package_dependencies
|
2025-05-27 19:23:35 +08:00
|
|
|
from .download_stats import (
|
|
|
|
|
get_package_download_stats,
|
|
|
|
|
get_package_download_trends,
|
|
|
|
|
get_top_packages_by_downloads,
|
|
|
|
|
)
|
2025-05-27 18:02:45 +08:00
|
|
|
from .package_downloader import download_package_with_dependencies
|
2025-05-27 11:14:49 +08:00
|
|
|
from .package_query import (
|
|
|
|
|
query_package_dependencies,
|
|
|
|
|
query_package_info,
|
|
|
|
|
query_package_versions,
|
|
|
|
|
)
|
feat: complete PyPI platform integration with all 25 tools and MCP endpoints
🎉 COMPLETE IMPLEMENTATION: PyPI Query MCP Server is now a comprehensive PyPI platform management suite!
Features Added:
✅ 25 PyPI Platform Tools across 6 categories:
- Publishing Tools (6): upload, credentials, history, delete, maintainers, account
- Metadata Tools (4): update metadata, URLs, visibility, keywords
- Analytics Tools (4): package analytics, security alerts, rankings, competition
- Discovery Tools (4): monitor releases, trending, search by maintainer, recommendations
- Workflow Tools (4): validate names, preview pages, check requirements, build logs
- Community Tools (3): reviews, discussions, maintainer contacts
✅ Complete MCP Server Integration:
- 39 total MCP endpoints (14 existing + 25 new)
- Comprehensive error handling and logging
- Consistent API patterns and documentation
- Full async/await support
✅ Production-Ready Code:
- Comprehensive exception handling with custom exception classes
- Full type hints and docstrings throughout
- Robust validation and safety checks
- Async HTTP clients with retry logic and rate limiting
- Mock-based testing infrastructure ready for expansion
✅ Advanced Search Capabilities:
- Semantic search with filtering and sorting
- Category-based discovery and alternatives finding
- Trending analysis and recommendation engines
This transforms the basic package query tool into a complete PyPI ecosystem management platform supporting the entire Python package lifecycle from development to publishing to community management.
2025-08-17 21:06:59 -06:00
|
|
|
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 .metadata import (
|
|
|
|
|
manage_package_keywords,
|
|
|
|
|
manage_package_urls,
|
|
|
|
|
set_package_visibility,
|
|
|
|
|
update_package_metadata,
|
|
|
|
|
)
|
|
|
|
|
from .analytics import (
|
|
|
|
|
analyze_pypi_competition,
|
|
|
|
|
get_pypi_package_analytics,
|
|
|
|
|
get_pypi_package_rankings,
|
|
|
|
|
get_pypi_security_alerts,
|
|
|
|
|
)
|
|
|
|
|
from .discovery import (
|
|
|
|
|
get_pypi_package_recommendations,
|
|
|
|
|
get_pypi_trending_today,
|
|
|
|
|
monitor_pypi_new_releases,
|
|
|
|
|
search_pypi_by_maintainer,
|
|
|
|
|
)
|
|
|
|
|
from .workflow import (
|
|
|
|
|
check_pypi_upload_requirements,
|
|
|
|
|
get_pypi_build_logs,
|
|
|
|
|
preview_pypi_package_page,
|
|
|
|
|
validate_pypi_package_name,
|
|
|
|
|
)
|
|
|
|
|
from .community import (
|
|
|
|
|
get_pypi_package_reviews,
|
|
|
|
|
manage_pypi_package_discussions,
|
|
|
|
|
get_pypi_maintainer_contacts,
|
|
|
|
|
)
|
feat: add comprehensive PyPI search functionality with advanced filtering
- Implemented PyPISearchClient with semantic search, filtering, and sorting
- Added 4 new search tools: search_packages, search_by_category, find_alternatives, get_trending_packages
- Created SearchFilter and SearchSort classes for flexible configuration
- Added SearchError exception for search-specific error handling
- Comprehensive test suite with 13 tests covering all search functionality
- Enhanced MCP server with 4 new search endpoints
- Support for filtering by Python version, license, category, downloads, maintenance status
- Multiple sorting options: relevance, popularity, quality, recency, name, downloads
- Semantic search using description similarity scoring
- Category-based package discovery with intelligent keyword matching
- Package alternatives finder using metadata analysis
- Trending packages analysis with download activity tracking
- Robust fallback mechanisms using curated package database
- All tests passing (13/13)
This implements feature #6 from the roadmap: "Advanced PyPI Search with filtering by Python version, license, maintenance status and sorting by popularity, recency, quality score with semantic search capabilities"
2025-08-16 07:45:40 -06:00
|
|
|
from .search import (
|
|
|
|
|
find_alternatives,
|
|
|
|
|
get_trending_packages,
|
|
|
|
|
search_by_category,
|
|
|
|
|
search_packages,
|
|
|
|
|
)
|
2025-09-06 10:28:57 -06:00
|
|
|
from .security_tools import (
|
|
|
|
|
bulk_scan_package_security,
|
|
|
|
|
scan_pypi_package_security,
|
|
|
|
|
)
|
|
|
|
|
from .license_tools import (
|
|
|
|
|
analyze_pypi_package_license,
|
|
|
|
|
check_bulk_license_compliance,
|
|
|
|
|
)
|
|
|
|
|
from .health_tools import (
|
|
|
|
|
assess_package_health_score,
|
|
|
|
|
compare_packages_health_scores,
|
|
|
|
|
)
|
|
|
|
|
from .requirements_tools import (
|
|
|
|
|
analyze_requirements_file_tool,
|
|
|
|
|
compare_multiple_requirements_files,
|
|
|
|
|
)
|
2025-05-27 11:14:49 +08:00
|
|
|
|
|
|
|
|
__all__ = [
|
feat: complete PyPI platform integration with all 25 tools and MCP endpoints
🎉 COMPLETE IMPLEMENTATION: PyPI Query MCP Server is now a comprehensive PyPI platform management suite!
Features Added:
✅ 25 PyPI Platform Tools across 6 categories:
- Publishing Tools (6): upload, credentials, history, delete, maintainers, account
- Metadata Tools (4): update metadata, URLs, visibility, keywords
- Analytics Tools (4): package analytics, security alerts, rankings, competition
- Discovery Tools (4): monitor releases, trending, search by maintainer, recommendations
- Workflow Tools (4): validate names, preview pages, check requirements, build logs
- Community Tools (3): reviews, discussions, maintainer contacts
✅ Complete MCP Server Integration:
- 39 total MCP endpoints (14 existing + 25 new)
- Comprehensive error handling and logging
- Consistent API patterns and documentation
- Full async/await support
✅ Production-Ready Code:
- Comprehensive exception handling with custom exception classes
- Full type hints and docstrings throughout
- Robust validation and safety checks
- Async HTTP clients with retry logic and rate limiting
- Mock-based testing infrastructure ready for expansion
✅ Advanced Search Capabilities:
- Semantic search with filtering and sorting
- Category-based discovery and alternatives finding
- Trending analysis and recommendation engines
This transforms the basic package query tool into a complete PyPI ecosystem management platform supporting the entire Python package lifecycle from development to publishing to community management.
2025-08-17 21:06:59 -06:00
|
|
|
# Core package tools
|
2025-05-27 11:14:49 +08:00
|
|
|
"query_package_info",
|
|
|
|
|
"query_package_versions",
|
|
|
|
|
"query_package_dependencies",
|
|
|
|
|
"check_python_compatibility",
|
|
|
|
|
"get_compatible_python_versions",
|
|
|
|
|
"suggest_python_version_for_packages",
|
2025-05-27 18:02:45 +08:00
|
|
|
"resolve_package_dependencies",
|
|
|
|
|
"download_package_with_dependencies",
|
2025-05-27 19:23:35 +08:00
|
|
|
"get_package_download_stats",
|
|
|
|
|
"get_package_download_trends",
|
|
|
|
|
"get_top_packages_by_downloads",
|
feat: complete PyPI platform integration with all 25 tools and MCP endpoints
🎉 COMPLETE IMPLEMENTATION: PyPI Query MCP Server is now a comprehensive PyPI platform management suite!
Features Added:
✅ 25 PyPI Platform Tools across 6 categories:
- Publishing Tools (6): upload, credentials, history, delete, maintainers, account
- Metadata Tools (4): update metadata, URLs, visibility, keywords
- Analytics Tools (4): package analytics, security alerts, rankings, competition
- Discovery Tools (4): monitor releases, trending, search by maintainer, recommendations
- Workflow Tools (4): validate names, preview pages, check requirements, build logs
- Community Tools (3): reviews, discussions, maintainer contacts
✅ Complete MCP Server Integration:
- 39 total MCP endpoints (14 existing + 25 new)
- Comprehensive error handling and logging
- Consistent API patterns and documentation
- Full async/await support
✅ Production-Ready Code:
- Comprehensive exception handling with custom exception classes
- Full type hints and docstrings throughout
- Robust validation and safety checks
- Async HTTP clients with retry logic and rate limiting
- Mock-based testing infrastructure ready for expansion
✅ Advanced Search Capabilities:
- Semantic search with filtering and sorting
- Category-based discovery and alternatives finding
- Trending analysis and recommendation engines
This transforms the basic package query tool into a complete PyPI ecosystem management platform supporting the entire Python package lifecycle from development to publishing to community management.
2025-08-17 21:06:59 -06:00
|
|
|
# Search tools
|
feat: add comprehensive PyPI search functionality with advanced filtering
- Implemented PyPISearchClient with semantic search, filtering, and sorting
- Added 4 new search tools: search_packages, search_by_category, find_alternatives, get_trending_packages
- Created SearchFilter and SearchSort classes for flexible configuration
- Added SearchError exception for search-specific error handling
- Comprehensive test suite with 13 tests covering all search functionality
- Enhanced MCP server with 4 new search endpoints
- Support for filtering by Python version, license, category, downloads, maintenance status
- Multiple sorting options: relevance, popularity, quality, recency, name, downloads
- Semantic search using description similarity scoring
- Category-based package discovery with intelligent keyword matching
- Package alternatives finder using metadata analysis
- Trending packages analysis with download activity tracking
- Robust fallback mechanisms using curated package database
- All tests passing (13/13)
This implements feature #6 from the roadmap: "Advanced PyPI Search with filtering by Python version, license, maintenance status and sorting by popularity, recency, quality score with semantic search capabilities"
2025-08-16 07:45:40 -06:00
|
|
|
"search_packages",
|
|
|
|
|
"search_by_category",
|
|
|
|
|
"find_alternatives",
|
|
|
|
|
"get_trending_packages",
|
feat: complete PyPI platform integration with all 25 tools and MCP endpoints
🎉 COMPLETE IMPLEMENTATION: PyPI Query MCP Server is now a comprehensive PyPI platform management suite!
Features Added:
✅ 25 PyPI Platform Tools across 6 categories:
- Publishing Tools (6): upload, credentials, history, delete, maintainers, account
- Metadata Tools (4): update metadata, URLs, visibility, keywords
- Analytics Tools (4): package analytics, security alerts, rankings, competition
- Discovery Tools (4): monitor releases, trending, search by maintainer, recommendations
- Workflow Tools (4): validate names, preview pages, check requirements, build logs
- Community Tools (3): reviews, discussions, maintainer contacts
✅ Complete MCP Server Integration:
- 39 total MCP endpoints (14 existing + 25 new)
- Comprehensive error handling and logging
- Consistent API patterns and documentation
- Full async/await support
✅ Production-Ready Code:
- Comprehensive exception handling with custom exception classes
- Full type hints and docstrings throughout
- Robust validation and safety checks
- Async HTTP clients with retry logic and rate limiting
- Mock-based testing infrastructure ready for expansion
✅ Advanced Search Capabilities:
- Semantic search with filtering and sorting
- Category-based discovery and alternatives finding
- Trending analysis and recommendation engines
This transforms the basic package query tool into a complete PyPI ecosystem management platform supporting the entire Python package lifecycle from development to publishing to community management.
2025-08-17 21:06:59 -06:00
|
|
|
# Publishing tools
|
|
|
|
|
"upload_package_to_pypi",
|
|
|
|
|
"check_pypi_credentials",
|
|
|
|
|
"get_pypi_upload_history",
|
|
|
|
|
"delete_pypi_release",
|
|
|
|
|
"manage_pypi_maintainers",
|
|
|
|
|
"get_pypi_account_info",
|
|
|
|
|
# Metadata tools
|
|
|
|
|
"update_package_metadata",
|
|
|
|
|
"manage_package_urls",
|
|
|
|
|
"set_package_visibility",
|
|
|
|
|
"manage_package_keywords",
|
|
|
|
|
# Analytics tools
|
|
|
|
|
"get_pypi_package_analytics",
|
|
|
|
|
"get_pypi_security_alerts",
|
|
|
|
|
"get_pypi_package_rankings",
|
|
|
|
|
"analyze_pypi_competition",
|
|
|
|
|
# Discovery tools
|
|
|
|
|
"monitor_pypi_new_releases",
|
|
|
|
|
"get_pypi_trending_today",
|
|
|
|
|
"search_pypi_by_maintainer",
|
|
|
|
|
"get_pypi_package_recommendations",
|
|
|
|
|
# Workflow tools
|
|
|
|
|
"validate_pypi_package_name",
|
|
|
|
|
"preview_pypi_package_page",
|
|
|
|
|
"check_pypi_upload_requirements",
|
|
|
|
|
"get_pypi_build_logs",
|
|
|
|
|
# Community tools
|
|
|
|
|
"get_pypi_package_reviews",
|
|
|
|
|
"manage_pypi_package_discussions",
|
|
|
|
|
"get_pypi_maintainer_contacts",
|
2025-09-06 10:28:57 -06:00
|
|
|
# Security tools
|
|
|
|
|
"scan_pypi_package_security",
|
|
|
|
|
"bulk_scan_package_security",
|
|
|
|
|
# License tools
|
|
|
|
|
"analyze_pypi_package_license",
|
|
|
|
|
"check_bulk_license_compliance",
|
|
|
|
|
# Health tools
|
|
|
|
|
"assess_package_health_score",
|
|
|
|
|
"compare_packages_health_scores",
|
|
|
|
|
# Requirements tools
|
|
|
|
|
"analyze_requirements_file_tool",
|
|
|
|
|
"compare_multiple_requirements_files",
|
2025-05-27 11:14:49 +08:00
|
|
|
]
|