Skip to content

Add a Princeton course connector for Claude - #57

Open
aikhanjum wants to merge 1 commit into
mainfrom
feat/course-selection-mcp
Open

aikhanjum wants to merge 1 commit into
mainfrom
feat/course-selection-mcp

Conversation

@aikhanjum

Copy link
Copy Markdown
Collaborator

Students can currently use Princeton course tools through PI chat. This adds a remote MCP connector so they can research courses and plan semesters from their existing Claude account, with Princeton CAS sign-in and explicit consent.

The connector exposes 24 read tools from TigerJunction, PrincetonCourses, and TigerPath. A separate, unchecked permission enables 5 saved-plan operations. Students can revoke their connections from PI. The assistant handles model usage under its own account limits. The connector does not import memories or register students for courses.

Implementation

  • Add /mcp, OAuth discovery, PKCE authorization, token refresh, and revocation using Cloudflare's OAuth provider.
  • Bind consent to both the browser and the displayed CAS identity. Forward only that verified NetID and the server's engine credential upstream.
  • Enforce an explicit tool allowlist and read/write scopes. Close upstream sessions after each operation and reject redirects.
  • Add a semester-planning prompt, the PI connection page, and a setup and deployment guide in app/COURSE_CONNECTOR.md.

Validation

  • npm run typecheck passed.
  • npm test passed all 72 tests. New coverage exercises actual MCP transports and OAuth handlers in workerd with local KV and a mocked engine, including consent, PKCE, refresh, identity isolation, write permissions, revocation ownership, and session cleanup.
  • npm run build and git diff --check passed. The deployment dry run passed during implementation.
  • Desktop and mobile consent/setup checks passed during implementation.
  • A read-only live smoke check found all 24 read tools and retrieved COS 217 reviews and Fall 2026 sections, plus the COS-BSE class-of-2029 requirement tree.

Before rollout

  • Configure the production OAUTH_KV namespace and confirm that the engine requires its service credential before trusting identity headers and enforces ownership of schedule IDs.
  • Verify the full Princeton CAS-to-Claude connection and personal-plan reads/writes in an authorized staging environment. These have not been tested against real student plans.
  • The live catalog currently lists terms only through Fall 2026. Spring 2027 COS 217 searches returned no data. The assistant instructions require reporting missing coverage rather than substituting an older offering.
  • The upstream schedule checker screens a course set. It does not prove a complete selection of compatible sections or verify prerequisite eligibility.

This PR is based directly on main and does not depend on the earlier planner/demo PR stack. No production deployment or real plan changes have been made.

@aikhanjum
aikhanjum marked this pull request as ready for review November 20, 2026 04:16
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