Complete agent rating system with UI, CLI, and API documentation #275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a complete end-to-end agent rating system for the MCP Gateway Registry, allowing users to rate agents and view aggregate ratings.
This PR contains and supersedes PR #268 which provided the initial backend implementation. This PR includes all of those changes plus the complete UI, CLI tools, and API documentation.
Closes #226
What's Included
Backend Implementation
POST /api/agents/{path}/rate- Submit or update a rating (1-5 stars)GET /api/agents/{path}/rating- Retrieve rating informationFrontend UI
CLI Tools
agent-rate --path <path> --rating <1-5>- Submit a rating via CLIagent-rating --path <path>- View rating information via CLIAPI Documentation
docs/api-specs/a2a-agent-management.yamlnum_starstype fromintegertofloatacross all agent schemasrating_detailsfield to AgentDetail schemaTechnical Details
Files Changed
registry/api/agent_routes.py- Added rating endpointsregistry/services/agent_service.py- Rating logic with rotating bufferregistry/schemas/agent_models.py- Updated num_stars type (int → float)api/registry_client.py- Added rating client methodsapi/registry_management.py- Added CLI commandsfrontend/src/components/StarRatingWidget.tsx- New interactive rating componentfrontend/src/components/AgentCard.tsx- Integrated rating widget, fixed rating count displaydocs/api-specs/a2a-agent-management.yaml- Complete rating API documentationBug Fixes
access_tokenfrom JSON token filesnum_starsfrominttofloatto support decimal averagesrating_details.lengthinstead ofusersCountData Flow
Security
Testing Performed
Manual Testing
Test Commands
Breaking Changes
None - All changes are additive and backward compatible.
Performance Impact
Deployment Notes
Screenshots
The UI includes an interactive star rating widget on each agent card that allows users to:
Commits Included
This PR includes the following commits from the
anrwangbranch:0069d8e- Add API endpoints for agent rating and user tracking Add API endpoints for agent rating and user tracking #226 (from PR Add API endpoints for agent rating and user tracking #268 by @anrwang11)8b17f4d- add rate agent31851cf- Add agent rating system with CLI support and API documentation9e60fcf- Add interactive star rating UI componente45a5fd- Fix rating count display to use rating_details.lengthRelated Issues/PRs
Co-authored-by: @anrwang11 (original backend implementation from PR #268)