Describe the bug
pnpm check:all runs pnpm -r typecheck, and pnpm silently skips workspace packages that do not define the script. Three do not:
@modelcontextprotocol/test-conformance
@modelcontextprotocol/test-helpers
@modelcontextprotocol/test-integration
All three define a check script that calls npm run typecheck, so the intent was clearly for them to be typechecked. The script just does not exist, and both pnpm and npm treat a missing script in a recursive run as a no-op rather than an error. So the gap is invisible: pnpm -r typecheck exits 0 today while never looking at those packages.
To Reproduce
On main:
$ pnpm -r typecheck
... examples typecheck: Done # exits 0, no mention of the three test packages
Then add "typecheck": "tsgo -p tsconfig.json --noEmit" to any of the three and re-run. Errors appear immediately.
Running the compiler against them directly, without changing anything:
$ cd test/conformance && tsgo -p tsconfig.json --noEmit | grep -c 'error TS'
1
$ cd test/integration && tsgo -p tsconfig.json --noEmit | grep -c 'error TS'
34
$ cd test/helpers && tsgo -p tsconfig.json --noEmit | grep -c 'error TS'
0
35 type errors currently sit in the repository with CI green.
Expected behavior
pnpm check:all typechecks every workspace package, including the test packages, so type errors in them fail CI.
One of the 35 is a real API defect, not test drift
Most of the 34 in test/integration are test-side type drift. One is not.
McpServer.registerPrompt() has two public overloads, and both constrain Args to a schema type. But when config carries no argsSchema, createPromptHandler takes its else branch and invokes the callback as callback(ctx) — the server context is the only argument. No overload describes that shape, so the argument-less form falls through to the deprecated raw-shape signature and types the first parameter as the arguments record.
The practical result: a callback that reads ctx.mcpReq does not compile, even though it works correctly at runtime. An explicit PromptCallback annotation does not rescue it either, because that also fails to match either overload. The only caller of this form in the repo lives in test/integration, which is exactly the package that was never typechecked — so the defect has been invisible since it was introduced.
Proposed fix
Three commits, kept separable for review:
- Add the missing
typecheck script (and the @typescript/native-preview devDependency it needs) to the three packages, so pnpm -r typecheck actually covers them.
- Fix the resulting test-side type errors.
- Add an
argsSchema?: undefined overload typing the callback as PromptCallback, and widen the implementation signature. Callbacks declaring no parameters already compiled and are unaffected, as is every schema-bearing form.
After: pnpm -r typecheck is clean across every package, and the full suite passes (4256 tests, plus 2788 e2e unaffected). A changeset is included for the registerPrompt fix since it changes public types.
I have this ready and can open the PR if you want it. Filing the issue first because it touches build configuration across multiple packages and changes a public overload set, which reads as "significant" under CONTRIBUTING.md.
I used an AI assistant while investigating; I have read the diff, run the suites, and can explain and defend the change in review.
Additional context
main @ 2a14dd8. pnpm test:conformance:server could not run on my machine (it needs a browser-capable environment); the identical failure reproduces on a clean checkout, so it is unrelated to the change.
Describe the bug
pnpm check:allrunspnpm -r typecheck, and pnpm silently skips workspace packages that do not define the script. Three do not:@modelcontextprotocol/test-conformance@modelcontextprotocol/test-helpers@modelcontextprotocol/test-integrationAll three define a
checkscript that callsnpm run typecheck, so the intent was clearly for them to be typechecked. The script just does not exist, and both pnpm and npm treat a missing script in a recursive run as a no-op rather than an error. So the gap is invisible:pnpm -r typecheckexits 0 today while never looking at those packages.To Reproduce
On
main:Then add
"typecheck": "tsgo -p tsconfig.json --noEmit"to any of the three and re-run. Errors appear immediately.Running the compiler against them directly, without changing anything:
35 type errors currently sit in the repository with CI green.
Expected behavior
pnpm check:alltypechecks every workspace package, including the test packages, so type errors in them fail CI.One of the 35 is a real API defect, not test drift
Most of the 34 in
test/integrationare test-side type drift. One is not.McpServer.registerPrompt()has two public overloads, and both constrainArgsto a schema type. But whenconfigcarries noargsSchema,createPromptHandlertakes itselsebranch and invokes the callback ascallback(ctx)— the server context is the only argument. No overload describes that shape, so the argument-less form falls through to the deprecated raw-shape signature and types the first parameter as the arguments record.The practical result: a callback that reads
ctx.mcpReqdoes not compile, even though it works correctly at runtime. An explicitPromptCallbackannotation does not rescue it either, because that also fails to match either overload. The only caller of this form in the repo lives intest/integration, which is exactly the package that was never typechecked — so the defect has been invisible since it was introduced.Proposed fix
Three commits, kept separable for review:
typecheckscript (and the@typescript/native-previewdevDependency it needs) to the three packages, sopnpm -r typecheckactually covers them.argsSchema?: undefinedoverload typing the callback asPromptCallback, and widen the implementation signature. Callbacks declaring no parameters already compiled and are unaffected, as is every schema-bearing form.After:
pnpm -r typecheckis clean across every package, and the full suite passes (4256 tests, plus 2788 e2e unaffected). A changeset is included for theregisterPromptfix since it changes public types.I have this ready and can open the PR if you want it. Filing the issue first because it touches build configuration across multiple packages and changes a public overload set, which reads as "significant" under CONTRIBUTING.md.
I used an AI assistant while investigating; I have read the diff, run the suites, and can explain and defend the change in review.
Additional context
main@2a14dd8.pnpm test:conformance:servercould not run on my machine (it needs a browser-capable environment); the identical failure reproduces on a clean checkout, so it is unrelated to the change.