From 3e9414c223a28c12f4204d25f30b04bc706224f3 Mon Sep 17 00:00:00 2001 From: Akshit Kalra Date: Fri, 27 Mar 2026 13:02:47 -0400 Subject: [PATCH] feat: add MCP server packaging checks to /review and /ship MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds an "MCP Server Packaging" section to the review checklist and a Glama sync reminder to the ship workflow, based on failure patterns encountered when publishing an MCP server to Glama. review/checklist.md: - Flag package.json exports pointing to src/ instead of dist/ (AUTO-FIX) - Flag ESM imports missing .js extensions under NodeNext resolution (AUTO-FIX) - Flag moduleResolution: "bundler" on standalone Node.js MCP packages (ASK) - Flag missing or malformed glama.json (AUTO-FIX) ship/SKILL.md.tmpl (+ regenerated SKILL.md): - Step 8.25: after PR creation, check for glama.json and remind user to hit Sync in the Glama UI — Docker layer cache won't auto-update --- review/checklist.md | 12 ++++++++++++ ship/SKILL.md | 18 +++++++++++++++++- ship/SKILL.md.tmpl | 18 +++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/review/checklist.md b/review/checklist.md index cfedcf81f..afc5b6a96 100644 --- a/review/checklist.md +++ b/review/checklist.md @@ -154,6 +154,18 @@ To do this: use Grep to find all references to the sibling values (e.g., grep fo - Internal tools not distributed outside the team - Test-only CI changes (adding test steps, not publish steps) +#### MCP Server Packaging +When the diff adds or modifies an MCP server package (look for `glama.json`, `mcpServers` in package.json, or a `server.ts` entry point): + +- **`package.json` exports point to `src/` not `dist/`** — MCP registries (Glama, etc.) run Docker builds that execute the compiled output. If `"exports"` or `"main"` resolves to a `.ts` file or a `src/` path, the server will fail to start in the registry's container. Fix: change to `"./dist/index.js"` (or equivalent compiled output path). This is AUTO-FIX if the dist path is unambiguous. +- **ESM imports missing `.js` extensions** — If `tsconfig.json` uses `"moduleResolution": "NodeNext"` or `"Node16"`, TypeScript requires all relative imports to include `.js` extensions (e.g., `import { foo } from "./foo.js"` not `"./foo"`). Using `"bundler"` moduleResolution locally can hide this because bundlers resolve extensions automatically, but Node.js ESM does not. Grep for `from "\./` in `.ts` files and flag any import missing `.js`. This is AUTO-FIX. +- **`moduleResolution: "bundler"` on a Node.js MCP package** — `bundler` mode is correct for frontend/Vite projects but wrong for Node.js packages distributed via npm or Docker. If the package is a standalone Node.js MCP server, `tsconfig.json` should use `"module": "NodeNext"` and `"moduleResolution": "NodeNext"`. Flag if `bundler` is set on a non-frontend package. This is ASK. +- **`glama.json` missing or malformed** — If the diff adds a Glama MCP server but no `glama.json` exists at the repo root, flag it. Required fields: `$schema` and `maintainers` array. Fix: create `glama.json` with `{"$schema": "https://glama.ai/mcp/schemas/server.json", "maintainers": [""]}`. This is AUTO-FIX if the GitHub username is determinable from git config. + +**DO NOT flag:** +- Frontend packages using `"moduleResolution": "bundler"` — correct for that context +- MCP packages that are consumed as libraries (not standalone servers) — Docker packaging doesn't apply + --- ## Severity Classification diff --git a/ship/SKILL.md b/ship/SKILL.md index c634aa5ce..fb9728dad 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -1846,7 +1846,23 @@ EOF **If neither CLI is available:** Print the branch name, remote URL, and instruct the user to create the PR/MR manually via the web UI. Do not stop — the code is pushed and ready. -**Output the PR/MR URL** — then proceed to Step 8.5. +**Output the PR/MR URL** — then proceed to Step 8.25. + +--- + +## Step 8.25: MCP Registry Sync Reminder (conditional) + +After creating the PR, check if this repo contains an MCP server registered with an external registry: + +```bash +[ -f glama.json ] && echo "GLAMA_REGISTERED=true" || echo "GLAMA_REGISTERED=false" +``` + +If `GLAMA_REGISTERED=true`: output this one-line reminder before continuing: + +> **Glama reminder:** After this PR merges, go to [glama.ai/mcp/servers](https://glama.ai/mcp/servers), find your server, and hit **Sync** to trigger a fresh Docker build. Glama caches Docker layers and will not pick up the new commit automatically. + +This is informational only — do not block or ask for confirmation. Proceed to Step 8.5. --- diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index 62842fc52..bf7dbee22 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -581,7 +581,23 @@ EOF **If neither CLI is available:** Print the branch name, remote URL, and instruct the user to create the PR/MR manually via the web UI. Do not stop — the code is pushed and ready. -**Output the PR/MR URL** — then proceed to Step 8.5. +**Output the PR/MR URL** — then proceed to Step 8.25. + +--- + +## Step 8.25: MCP Registry Sync Reminder (conditional) + +After creating the PR, check if this repo contains an MCP server registered with an external registry: + +```bash +[ -f glama.json ] && echo "GLAMA_REGISTERED=true" || echo "GLAMA_REGISTERED=false" +``` + +If `GLAMA_REGISTERED=true`: output this one-line reminder before continuing: + +> **Glama reminder:** After this PR merges, go to [glama.ai/mcp/servers](https://glama.ai/mcp/servers), find your server, and hit **Sync** to trigger a fresh Docker build. Glama caches Docker layers and will not pick up the new commit automatically. + +This is informational only — do not block or ask for confirmation. Proceed to Step 8.5. ---