Skip to content

fix: improve adapter correctness and safety#27

Merged
scalvert merged 1 commit into
mainfrom
sc/fix-adapter-correctness
Apr 12, 2026
Merged

fix: improve adapter correctness and safety#27
scalvert merged 1 commit into
mainfrom
sc/fix-adapter-correctness

Conversation

@scalvert

Copy link
Copy Markdown
Owner

Summary

  • Fix generated Cloudflare adapter template to use data-based config instead of file paths that don't work in Workers
  • Lazy-load built-in FlexSearch providers in loader.ts via dynamic import to avoid pulling fs-extra into edge runtime consumers
  • Sanitize error messages in all adapter responses to prevent leaking internal details to clients
  • Add 1MB body size limit to Node adapter's parseRequestBody
  • Make CORS origin configurable across all adapters (default: '*')
  • Narrow Vercel/Netlify handler types from McpServerConfig to McpServerFileConfig to prevent runtime misuse

Test plan

  • npm run build passes
  • npm run typecheck passes
  • npm test passes

Closes #16

🤖 Generated with Claude Code

- Fix generated Cloudflare adapter template to use data-based config
  instead of file paths that don't work in Workers
- Lazy-load built-in FlexSearch providers in loader.ts via dynamic
  import to avoid pulling fs-extra into edge runtime consumers
- Sanitize error messages in all adapter responses to prevent leaking
  internal details to clients
- Add 1MB body size limit to Node adapter's parseRequestBody
- Make CORS origin configurable across all adapters (default: '*')
- Narrow Vercel/Netlify handler types from McpServerConfig to
  McpServerFileConfig to prevent runtime misuse

Closes #16

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scalvert scalvert added the bug Something isn't working label Apr 12, 2026
@scalvert
scalvert merged commit d4437a5 into main Apr 12, 2026
@scalvert
scalvert deleted the sc/fix-adapter-correctness branch April 12, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix adapter correctness: error sanitization, body limits, CORS, types

1 participant