8000 Feat/mcp prompt templates by loonghao · Pull Request #22 · loonghao/pypi-query-mcp-server · GitHub
[go: up one dir, main page]

Skip to content

Feat/mcp prompt templates #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 29, 2025
Merged

Feat/mcp prompt templates #22

merged 5 commits into from
May 29, 2025

Conversation

loonghao
Copy link
Owner

No description provided.

loonghao added 5 commits May 29, 2025 15:52
…-making

- Add comprehensive prompt templates for package analysis, dependency management, and migration planning
- Implement 8 prompt templates covering quality analysis, package comparison, alternative
8000
s suggestion, dependency conflicts, version upgrades, security audits, and migration planning
- Add detailed documentation in PROMPT_TEMPLATES.md with usage examples
- Include demo script and test coverage for prompt template functionality
- Update README.md to highlight new prompt template features
- Templates provide structured guidance for common PyPI package scenarios

Signed-off-by: longhao <hal.long@outlook.com>
- Implement standard MCP prompt workflow with template variables
- Use {{parameter_name}} placeholders instead of direct string interpolation
- Add proper parameter replacement in server prompt registrations
- Update templates to return template strings with placeholders
- Follow MCP workflow: load template → parameter replacement → return final prompt
- Update documentation to reflect standard MCP workflow implementation
- Remove TEMPLATES_USE environment variable as requested
- Maintain all existing functionality while improving MCP compliance

Signed-off-by: longhao <hal.long@outlook.com>
…lates

Environment Analysis Templates:
- analyze_environment_dependencies: Analyze current Python environment and dependencies
- check_outdated_packages: Check for outdated packages with update priorities
- generate_update_plan: Create comprehensive package update plans with strategies

Trending Analysis Templates:
- analyze_daily_trends: Analyze daily PyPI download trends and popular packages
- find_trending_packages: Discover trending packages over different time periods
- track_package_updates: Track recent package updates and releases

Key Features:
- Follow standard MCP workflow with {{parameter}} template variables
- Support environment analysis (uvx pip list integration ready)
- Enable trending package discovery and popularity analysis
- Provide structured update planning with different strategies
- Include comprehensive parameter validation and documentation
- Add usage examples and integration guides

All templates follow the established MCP prompt workflow:
1. User calls tool → MCP client sends request
2. Tool function executes → Collects necessary data and parameters
3. Call Prompt generator → Pass parameters to corresponding generator
4. Load template → Get template with {{parameter}} placeholders
5. Parameter replacement → Replace {{parameter_name}} with actual values
6. Return final prompt → As tool's response back to AI

Updated documentation and README with new template examples and usage patterns.

Signed-off-by: longhao <hal.long@outlook.com>
- Fix blank line whitespace issues (W293) using ruff --unsafe-fixes
- Reformat code using ruff format for consistent styling
- Fix analyze_package_quality function to return list[Message] instead of string
- Add missing 'assessment' keyword to package analysis template
- Update tests to use real prompt functions instead of mocks for structure validation
- Fix import ordering in test files
- All 64 tests now pass with 47% code coverage

Signed-off-by: longhao <hal.long@outlook.com>
@loonghao loonghao merged commit a28d999 into main May 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0