Skip to content

Commit the MCP server lockfile and run its checks in CI - #2395

Open
rmabualhaija wants to merge 1 commit into
codeforboston:mainfrom
rmabualhaija:1-mcp-server-build-ci
Open

rmabualhaija wants to merge 1 commit into
codeforboston:mainfrom
rmabualhaija:1-mcp-server-build-ci

Conversation

@rmabualhaija

@rmabualhaija rmabualhaija commented Nov 26, 2026 •

Copy link
Copy Markdown

Summary

I decided to do this before starting work on adding features to the MCP server because:

  1. 4 of the MCP server tests were failing, and they weren't being run in CI
  2. Not having the lockfile committed debugging differences between a deploy that uses different packages than the ones that passed on my machine/ a previous deploy would be sad
  3. this makes changes deployable, previously i think this would have only been deployable by a maintainer who happens to already have an uncommitted lockfile on their machine
  4. This seemed like a small change that would be low risk for my first contribution.

Makes the MCP server buildable from a fresh clone, and checks it in CI.

  • Commit mcp-server/package-lock.json. The Dockerfile copies package-lock.json and runs npm ci, but the repo-wide .gitignore excludes every package-lock.json, so docker build fails on a fresh clone. One .gitignore exception line lets this one file be committed. The lockfile was generated on Node 22, and every package in it supports Node 20, so the current node:20-slim image keeps working.
  • Avoid a Node 24-only dependency. Without a lockfile, installs resolve versions anew. @firebase/database-compat@2.1.8 (released Nov 11, pulled in through firebase-admin) requires Node >= 24.12, and Yarn picks it. The lockfile pins 2.1.7, which supports Node >= 20.
  • Fix 4 failing tests in mcp-server/auth.test.ts. auth.ts now adds a help field to its 401 responses, and the tests still expected the old response body.
  • Add an "MCP Server" job to Repo Checks: npm ci, tsc --noEmit and npm test on Node 22. The server's tests weren't run in CI before, which is why the failures above went unnoticed.

The Docker image stays on Node 20, so this PR doesn't change the deployed server. The Node 22 upgrade in #2231 deliberately left this Dockerfile out because the MCP server deploys separately. Moving it to Node 22 is a follow-up that should get its own dev deploy test.

Tracking issue on my fork: rmabualhaija#1. Happy to open it here if that's preferred.

Checklist

  • On the frontend, I've made my strings translate-able. (No frontend changes.)
  • If I've added shared components, I've added a storybook story. (None.)
  • I've made pages responsive and look good on mobile. (No pages.)
  • If I've added new Firestore queries, I've added any new required indexes to firestore.indexes.json. (No queries.)

Screenshots

N/A. Docker build before and after this change:

# upstream/main
ERROR: failed to build: ... "/package-lock.json": not found

# this branch
#8 [builder 4/7] RUN npm ci              added 591 packages
#9 [runtime 4/5] RUN npm ci --omit=dev   added 297 packages
#12 [builder 7/7] RUN npm run build      DONE

$ docker run -p 18080:8080 -e FIREBASE_PROJECT_ID=demo-mcp-test -e CURRENT_COURT=194 maple-mcp-test
$ curl localhost:18080/health
{"status":"ok","server":"maple-mcp-server","version":"0.1.0"}   [HTTP 200]
$ curl -X POST localhost:18080/mcp ...   (no token)
{"error":"Unauthorized: Missing token","help":"A MAPLE account and API token are required. ..."}   [HTTP 401]

Known issues

  • package-lock.json is npm's format, while the rest of the repo uses Yarn. I kept npm because the Dockerfile already uses it. Switching the MCP server to Yarn would also mean changing the Dockerfile.
  • CI: Repo Checks, including the new MCP Server job, passed on my fork for this commit (https://github.com/rmabualhaija/maple/actions/runs/45874048454). On this PR the checks are waiting for a maintainer to approve the workflow run, since this is my first contribution.
  • Not part of this change: the server logs a warning at startup about binding to 0.0.0.0 without DNS rebinding protection.

Extra Deploy Steps

None. The MCP server is deployed to Cloud Run by hand, and this PR doesn't change its image or runtime. The next manual deploy can build from a clean checkout.

Steps to test/reproduce

  1. cd mcp-server && npm ci && npx tsc --noEmit && npm test. All 37 tests should pass (on main, 4 fail).
  2. docker build -t maple-mcp-test mcp-server. On main this fails with "/package-lock.json": not found.
  3. docker run --rm -p 18080:8080 -e FIREBASE_PROJECT_ID=demo-mcp-test -e CURRENT_COURT=194 maple-mcp-test, then curl localhost:18080/health should return 200, and a POST /mcp without a token should return 401 with the help link. Neither request contacts Firebase.
  4. On this PR, check that the new "MCP Server" job in Repo Checks passes.

🤖 Generated with Claude Code

The MCP server installs with npm (its Dockerfile runs `npm ci`), but
package-lock.json is gitignored repo-wide, so a fresh clone couldn't
build the image and each install resolved dependency versions anew.
A fresh install can now pull @firebase/database-compat 2.1.8, which
requires Node >= 24; the committed lockfile pins 2.1.7, which every
locked package's engines allow on both Node 20 (the current image)
and Node 22.

Update the auth tests for the `help` field auth.ts now adds to 401
responses, and add an MCP Server job to Repo Checks that type-checks
and tests mcp-server on Node 22.

The Docker image stays on Node 20 here; moving it to 22 needs its own
deploy test, as in the Node 22 upgrade that left this Dockerfile out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maple-dev Ready Ready Preview Nov 26, 2026 6:16pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – maple-dev — 76cf746c Deployed Nov 26, 2026 by vercel[bot]
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