feat: implement local MCP server#179
Open
cjlawson02 wants to merge 2 commits into
Open
Conversation
Deploying polyratings with
|
| Latest commit: |
d1763dd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://602862f0.polyratings.pages.dev |
| Branch Preview URL: | https://mcp.polyratings.pages.dev |
cd51222 to
5e6f901
Compare
|
View your CI Pipeline Execution ↗ for commit d1763dd
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Pull request overview
This PR adds a new @polyratings/mcp-server package to run a local MCP server (stdio transport) that exposes read-only public tools and authenticated admin moderation/inspection tools over the existing tRPC backend, alongside a small backend admin API expansion and monorepo dependency version standardization.
Changes:
- Added
@polyratings/mcp-serverwith MCP tool registrations, backend tRPC client wrapper, docs, and an interactive token helper script. - Extended backend admin router with
getRatingsByAnonymousIdentifierand refined bulk rating deletion/report cleanup behavior. - Standardized internal monorepo dependency versions (e.g.
@polyratings/backend,@polyratings/eslint-config) to"*"and updated repo docs/ignores accordingly.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mcp-server/tsconfig.json | TS config for the new MCP server package (strict, noEmit, backend path alias). |
| packages/mcp-server/src/index.ts | MCP server entrypoint registering public + admin tools over stdio. |
| packages/mcp-server/src/backendClient.ts | Typed tRPC proxy client + helper logic for listing professors/reports and admin actions. |
| packages/mcp-server/scripts/get-token.sh | Interactive helper to obtain an admin JWT via auth.login. |
| packages/mcp-server/package.json | New package metadata + dev/build scripts and dependencies. |
| packages/mcp-server/README.md | Setup/config/docs for running and integrating with Cursor MCP. |
| packages/mcp-server/.gitignore | Ignores dist/ for the new package. |
| packages/backend/src/routers/admin.ts | Adds getRatingsByAnonymousIdentifier admin endpoint + adjusts bulk deletion/report cleanup behavior. |
| packages/backend/package.json | Standardizes internal eslint-config dependency version to "*". |
| packages/frontend/package.json | Standardizes internal backend + eslint-config dependency versions to "*". |
| packages/cron/package.json | Standardizes internal backend + eslint-config dependency versions to "*". |
| AGENTS.md | Documents the new MCP server package and its dev/build commands. |
| .gitignore | Adds .cursor/mcp.json to ignored files. |
| package-lock.json | Lockfile updates for the new MCP server package and dependency graph changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+185
to
+196
| professorName: professor | ||
| ? `${String(professor.lastName ?? "")}, ${String(professor.firstName ?? "")}` | ||
| : null, | ||
| professorDepartment: professor ? (professor.department ?? null) : null, | ||
| rating: found?.rating.rating ?? null, | ||
| ratingCourse: found?.course ?? null, | ||
| ratingBy: found?.rating.anonymousIdentifier ?? null, | ||
| ratingOverall: found?.rating.overallRating ?? null, | ||
| ratingPresentsMaterialClearly: found?.rating.presentsMaterialClearly ?? null, | ||
| ratingRecognizesStudentDifficulties: | ||
| found?.rating.recognizesStudentDifficulties ?? null, | ||
| reports: report.reports, |
Comment on lines
+20
to
+25
| department: z | ||
| .string() | ||
| .optional() | ||
| .describe("Filter by department code, e.g. 'CSC', 'MATH'"), | ||
| ...pagination(200), | ||
| }, |
Comment on lines
+135
to
+138
| inputSchema: { | ||
| professorId: pendingProfessorIdField, | ||
| ...nameFields, | ||
| }, |
Comment on lines
+169
to
+172
| inputSchema: { | ||
| professorId: pendingProfessorIdField, | ||
| department: departmentField, | ||
| }, |
- Add @polyratings/mcp-server with public read and admin moderation tools - Backend: bulk rating deletion, professor locks, report cleanup, public schema safety - Frontend: admin and professor page updates; align with getMany response shape - Workspace: agent skills, AGENTS.md, dependency alignment with tRPC 11.17 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a new package,
@polyratings/mcp-server, which provides a local MCP server for read-only public tools and admin moderation tools over the Polyratings backend. It also adds new backend admin endpoints, improves bulk rating deletion logic, and standardizes internal dependency versions across packages.Key highlights:
@polyratings/mcp-serverpackage, including setup scripts, documentation, and backend client logic.New MCP Server Package
@polyratings/mcp-serverpackage with its ownREADME.md,.gitignore, andpackage.json, providing a local server for public and admin tools over the backend, including a script for obtaining admin JWT tokens (get-token.sh). [1] [2] [3] [4]src/backendClient.tsin@polyratings/mcp-server, offering typed functions to interact with the backend, including listing professors, fetching ratings, handling reported ratings, and supporting admin moderation actions.Backend Admin Improvements
getRatingsByAnonymousIdentifierto fetch ratings for a professor by anonymous identifier, and implemented the supporting function. [1] [2]removeRatingsBulkmutation to only remove reports for actually deleted ratings, ensuring consistency between rating and report removal.Documentation and Monorepo Metadata
AGENTS.mdto document the new MCP server package and its usage, including commands for development and build. [1] [2]Dependency Version Standardization
@polyratings/backend,@polyratings/eslint-config) to use"*"acrossfrontend,backend, andcronpackages for easier local development and version management. [1] [2] [3] [4] [5]