Skip to content

fix(mcp): handle client notifications#9

Merged
crup merged 1 commit intomainfrom
next
Apr 7, 2026
Merged

fix(mcp): handle client notifications#9
crup merged 1 commit intomainfrom
next

Conversation

@crup
Copy link
Copy Markdown
Owner

@crup crup commented Apr 7, 2026

Hardens the MCP server for stricter clients that send initialization notifications before tools/list.

Changes:

  • Ignores notifications/* instead of replying with no-id JSON-RPC errors.
  • Adds ping handling.
  • Returns -32600 for id-bearing requests missing method.
  • Adds MCP tool titles for get_api_docs, get_recipe, and search_docs.
  • Updates README, AI docs, and llms-full with tool titles/descriptions.
  • Extends the MCP smoke test to send notifications/initialized before tools/list.

Why:

  • The reported editor error was: failed to get tools: calling tools/list: invalid request.
  • The likely cause was the server replying to notifications/initialized as an unknown method with no id, which can make strict clients mark the session invalid before tools/list completes.

Validation run locally:

  • pnpm typecheck
  • pnpm test
  • pnpm build
  • pnpm docs:build
  • pnpm readme:check
  • pnpm mcp:check
  • pnpm size
  • pnpm pack --dry-run
  • git diff --check

Release note:

  • npm latest is 0.0.5, so this should publish as 0.0.6 after merge.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Bundle size report

Entry Files Raw Gzip Brotli Raw delta Gzip delta Brotli delta
core 2 4.44 kB 1.52 kB 1.40 kB 0 B 0 B 0 B
timer group add-on 3 10.93 kB 3.83 kB 3.50 kB 0 B 0 B 0 B
schedules add-on 3 8.62 kB 3.02 kB 2.78 kB 0 B 0 B 0 B
duration helper 1 318 B 224 B 192 B 0 B 0 B 0 B
diagnostics helper 1 105 B 115 B 90 B 0 B 0 B 0 B
MCP docs server 1 6.95 kB 2.72 kB 2.36 kB +268 B +123 B +112 B
core CJS 1 4.71 kB 1.63 kB 1.50 kB 0 B 0 B 0 B
timer group CJS 1 11.02 kB 3.86 kB 3.54 kB 0 B 0 B 0 B
schedules CJS 1 8.71 kB 3.04 kB 2.81 kB 0 B 0 B 0 B
duration CJS 1 808 B 475 B 424 B 0 B 0 B 0 B
diagnostics CJS 1 605 B 367 B 326 B 0 B 0 B 0 B

@crup crup merged commit e421a1f into main Apr 7, 2026
2 checks passed
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